/* ==========================================================================
   EmbrioLife — prototyp (wersja poglądowa)
   PALETA: wszystkie kolory marki są w zmiennych poniżej. Po otrzymaniu logo
   wystarczy podmienić --brand*, --accent*, --info* (jasny i ciemny motyw).
   ========================================================================== */
:root {
  /* kolory marki — róż z logo EmbrioLife (#E4599A) */
  --brand-logo: #e4599a;     /* dokładny róż z logo: tylko dekoracja (paski, podkreślenia) */
  --brand: #b42f6c;          /* róż pogłębiony: przyciski, linki, tekst — biały tekst spełnia WCAG AA */
  --brand-strong: #962458;
  --brand-soft: #fbeaf2;
  --on-brand: #ffffff;
  --accent: #8a570c;         /* uzupełniający ciepły: wpisy hodowcy */
  --accent-soft: #f6ecdc;
  --info: #2a6b68;           /* uzupełniający chłodny: lekarz, wykres, statusy */
  --info-soft: #e3f0ef;
  --hero: #26262b;           /* grafit */
  --hero-text: #ffffff;

  /* baza neutralna: ciepła biel / grafit */
  --bg: #f7f5f3;
  --surface: #ffffff;
  --surface-2: #f0edea;
  --border: #e3dfdb;
  --border-strong: #c2bcb6;
  --text: #26262b;
  --muted: #63605f;

  /* stany */
  --ok: #24744a;
  --ok-soft: #e1f2e8;
  --danger: #b0352d;
  --danger-soft: #fbe9e7;
  --demo: #26262b;
  --demo-text: #f3f1ee;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(38, 38, 43, .05), 0 6px 20px rgba(38, 38, 43, .06);
  --shadow-lg: 0 20px 60px rgba(20, 20, 24, .28);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --bar-h: 44px;
  --side-w: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand: #f088b6;
  --brand-strong: #f7a8cb;
  --brand-soft: #3a1c2b;
  --on-brand: #2a0817;
  --accent: #e2a868;
  --accent-soft: #33271a;
  --info: #72c4be;
  --info-soft: #17302f;
  --hero: #2c2c33;
  --hero-text: #ffffff;

  --bg: #151517;
  --surface: #1d1d21;
  --surface-2: #26262b;
  --border: #34343a;
  --border-strong: #505058;
  --text: #efedea;
  --muted: #a8a4a2;

  --ok: #6cc795;
  --ok-soft: #163324;
  --danger: #f08a80;
  --danger-soft: #3a1c19;
  --demo: #0b0b0d;
  --demo-text: #e6e3df;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  overflow-x: hidden; min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 12px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- pasek wersji poglądowej ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 40; min-height: var(--bar-h);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 0 12px; background: var(--demo); color: var(--demo-text);
  font-size: 12.5px; letter-spacing: .04em;
}
.demo-bar__txt { min-width: 0; }
.demo-bar__btn {
  min-height: 44px; padding: 0 12px; background: transparent; border: 0; cursor: pointer;
  color: var(--demo-text); font-weight: 700; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- logo (pliki od grafika: logo-roz.png jasny motyw, logo-bialy.png ciemny) ---------- */
.logo { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.logo img { height: 46px; width: auto; display: block; }
.logo .logo__d { display: none; }
[data-theme="dark"] .logo .logo__l, .logo--white .logo__l { display: none; }
[data-theme="dark"] .logo .logo__d, .logo--white .logo__d { display: block; }
.logo--lg img { height: 76px; }
.side .logo img { height: 56px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.iconbtn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text);
  transition: background-color .15s ease, border-color .15s ease;
}
.iconbtn:hover { border-color: var(--brand); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---------- formularze ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .fs > legend, .lbl { font-size: 14px; font-weight: 700; }
.opt { font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.unit { position: relative; }
.unit .input { padding-right: 58px; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.fs { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.fs > legend { padding: 0; margin-bottom: 8px; }
.fs--box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 2px; margin-bottom: 16px; }
.fs--box > legend { padding: 0 8px; margin-left: -8px; margin-bottom: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 15px; font-weight: 600; text-align: center; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.seg input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.seg input:focus-visible + span { outline: 3px solid var(--info); outline-offset: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; min-height: 44px; min-width: 56px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { width: 52px; height: 30px; border-radius: 30px; background: var(--border-strong); position: relative; transition: background-color .2s ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 3px solid var(--info); outline-offset: 2px; }

/* ---------- logowanie ---------- */
.login { min-height: calc(100vh - var(--bar-h)); display: grid; grid-template-columns: 1.05fr 1fr; }
.login__aside {
  background: #26262b; border-right: 4px solid var(--brand-logo);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
[data-theme="dark"] .login__aside { background: #0f0f11; }
.login__aside h1 { font-family: var(--font-head); font-size: clamp(34px, 3.8vw, 52px); font-weight: 600; max-width: 15ch; line-height: 1.08; }
.login__aside ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; max-width: 46ch; }
.login__aside li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; opacity: .95; }
.login__aside li svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--brand-logo); }
.login__aside small { opacity: .8; font-size: 13px; }
.login__main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 24px; gap: 20px; }
.login__card { width: 100%; max-width: 430px; animation: rise .45s ease both; }
.login__card h2 { font-family: var(--font-head); font-size: 36px; font-weight: 700; margin-bottom: 6px; }
.login__card > p { color: var(--muted); margin-bottom: 22px; }
.login__top { width: 100%; max-width: 430px; display: flex; justify-content: space-between; align-items: center; }
.login__top .logo { display: none; }
.login__links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14.5px; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text); font-size: 14px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--info); }
.notice--warn { background: var(--accent-soft); }
.notice--warn svg { color: var(--accent); }
.login__demo { margin-top: 22px; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.login__demo h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.login__demo .btn { margin-bottom: 10px; }
.login__demo .btn:last-of-type { margin-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- układ aplikacji ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.side {
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); align-self: start;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
}
.side__who { font-size: 13px; color: var(--muted); padding: 0 10px; }
.side__who strong { display: block; color: var(--text); font-size: 14.5px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}
.nav__item svg { width: 20px; height: 20px; flex: none; color: var(--muted); transition: color .15s ease; }
.nav__item:hover { background: var(--surface-2); }
.nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav__item[aria-current="page"] svg { color: var(--brand); }
.nav__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.side__foot { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.topbar { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 32px 24px; flex: 1; animation: fade .25s ease both; }
.page--narrow { max-width: 760px; }
.page__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page__title { font-family: var(--font-head); font-size: 38px; font-weight: 700; line-height: 1.05; }
.page__sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.footer { padding: 20px 32px 28px; color: var(--muted); font-size: 13px; text-align: center; }
.bottomnav { display: none; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; font-size: 14.5px; margin-bottom: 4px; }
.back svg { width: 18px; height: 18px; }

/* ---------- karty, kafle ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card__title { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card__title .btn { margin-left: auto; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols > .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.stat__label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat__value { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat__value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat--hero { background: var(--hero); border-color: var(--hero); color: var(--hero-text); }
.stat--hero .stat__label, .stat--hero .stat__note, .stat--hero .stat__value small { color: inherit; opacity: .85; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.stat--hero .progress { background: rgba(255, 255, 255, .18); }
.progress__bar { height: 100%; border-radius: 8px; background: var(--brand-logo); transition: width .6s ease; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- znaczniki ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge--brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--new { background: var(--accent); color: var(--on-brand); }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sample { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 1px 7px; letter-spacing: .01em; white-space: normal; }

/* ---------- lista pacjentek ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .num { opacity: .7; margin-left: 4px; }
.plist { display: grid; gap: 10px; }
.prow {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) 150px 170px 24px; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.prow:hover { border-color: var(--brand); transform: translateY(-1px); }
.prow__name { font-weight: 800; font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prow__meta { color: var(--muted); font-size: 14px; }
.prow__k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.prow__v { font-weight: 700; font-variant-numeric: tabular-nums; }
.prow__chev { width: 20px; height: 20px; color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.prow__id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.prow__id > div { min-width: 0; }

/* ---------- nagłówek karty i zakładki ---------- */
.chead { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.chead__id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.chead__id .avatar { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }
.chead h1 { font-family: var(--font-head); font-size: 36px; font-weight: 700; line-height: 1.05; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; font-weight: 700; font-size: 15px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand-logo); }

/* ---------- działania ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.todo li { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.todo li:last-child { border-bottom: 0; }
.todo__date { margin-left: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.todo__txt { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.todo .done .todo__txt { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.tick { width: 44px; height: 44px; margin: 0 -8px 0 -10px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--brand); }
.tick i { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s ease, border-color .15s ease; }
.tick[aria-pressed="true"] i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tick svg { width: 14px; height: 14px; opacity: 0; }
.tick[aria-pressed="true"] svg { opacity: 1; }
.tick--ro { cursor: default; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; margin-top: 12px; align-items: end; }
.inline-form .field { margin: 0; }

/* ---------- chronologia ---------- */
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl__item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tl__item--lekarz { border-left-color: var(--info); }
.tl__item--hodowca { border-left-color: var(--accent); }
.tl__item--fresh { animation: flash 1.6s ease 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.tl__head { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tl__date { margin-left: auto; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl__who { font-size: 13.5px; color: var(--muted); }
.tl__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; }
.tl__grid div { min-width: 0; }
.tl__k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.tl__v { font-weight: 700; overflow-wrap: anywhere; }
.tl__block { margin-top: 10px; }
.tl__block p { overflow-wrap: anywhere; white-space: pre-line; }
.daysep { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 -2px; }

/* ---------- wykres ---------- */
.chart-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head .chips .chip { min-height: 44px; padding: 0 14px; font-size: 13.5px; }
.chart { position: relative; width: 100%; min-height: 220px; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--info); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--info); stroke: var(--surface); stroke-width: 2; transition: r .12s ease; }
.chart .dot.on { r: 7; }
.chart .cross { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .cross.on { opacity: 1; }
.chart .lastlbl { fill: var(--text); font-weight: 800; font-size: 13px; }
.chart__tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.3; white-space: nowrap; opacity: 0; transform: translate(-50%, -100%); transition: opacity .12s ease; z-index: 2; }
.chart__tip.on { opacity: 1; }
.chart__tip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-desc { font-size: 14px; color: var(--muted); margin-top: 10px; }
details.tblwrap { margin-top: 10px; }
details.tblwrap summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--brand); font-size: 14.5px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ---------- hodowcy / przypomnienia ---------- */
.rowcard { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.rowcard + .rowcard { margin-top: 10px; }
.rowcard__name { font-weight: 800; font-size: 16.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rowcard__meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.rowcard__act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.rem { grid-template-columns: auto minmax(0, 1fr) auto; }
.email { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.email__head { background: var(--surface-2); padding: 12px 16px; font-size: 13.5px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.email__head b { font-weight: 700; }
.email__body { padding: 16px; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.email__subj { font-weight: 800; font-size: 16px; padding: 14px 16px 0; }

/* ---------- okna ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(8, 16, 14, .55); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s ease both; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: rise .22s ease both; border: 1px solid var(--border); }
.modal--sm { max-width: 460px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 19px; font-weight: 800; }
.modal__body { padding: 20px 22px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.modal__foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: rise .25s ease both; text-align: center; }

/* ---------- powiadomienia ---------- */
.notif { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.notif + .notif { margin-top: 10px; }
.notif__ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.notif__ico svg { width: 20px; height: 20px; }
.notif--lekarz .notif__ico { background: var(--info-soft); color: var(--info); }
.notif__t { font-weight: 800; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notif__d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif > div { min-width: 0; }
.notif p { overflow-wrap: anywhere; }

/* ---------- telefon / tablet ---------- */
@media (max-width: 1020px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .prow__breeder { grid-column: 1 / -1; order: 3; }
  .prow__day { order: 4; }
  .prow__due { order: 5; text-align: right; }
  .prow__chev { grid-row: 1; grid-column: 2; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__aside { display: none; }
  .login__top .logo { display: inline-flex; }
  .login__main { justify-content: flex-start; padding-top: 20px; }
  .shell { display: block; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar__act { display: flex; gap: 8px; }
  .page { padding: 18px 16px 16px; }
  .page__title { font-size: 31px; }
  .footer { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottomnav a { flex: 1 1 0; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 12px; position: relative; transition: color .15s ease, background-color .15s ease; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }
  .bottomnav .nav__badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
  .cols { grid-template-columns: 1fr; }
  .rowcard { grid-template-columns: 1fr; }
  .rowcard__act { justify-content: flex-start; }
  .rem { grid-template-columns: auto minmax(0, 1fr); }
  .rem .rowcard__act { grid-column: 1 / -1; }
  .chead h1 { font-size: 30px; }
  .chead .btn { flex: 1 1 auto; }
  .tabs { margin-left: -16px; margin-right: -16px; padding: 0 12px; }
  .tab { padding: 0 12px; font-size: 14.5px; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal--sm { max-width: none; border-radius: 20px 20px 0 0; max-height: calc(100vh - var(--bar-h)); max-height: calc(100dvh - 24px); animation-name: sheet; border-bottom: 0; }
  .modal__foot .btn { flex: 1 1 auto; }
  .modal__body { padding: 18px 16px; }
  .modal__head { padding-left: 16px; }
  .modal__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .inline-form { grid-template-columns: 1fr; }
  .toasts { bottom: 84px; }
  .stat__value { font-size: 26px; }
  .card { padding: 16px; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
  .row2--keep { grid-template-columns: 1fr 1fr; }
  .demo-bar { font-size: 11.5px; gap: 4px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media print { .demo-bar, .side, .bottomnav, .topbar { display: none; } }

/* poprawki po przeglądzie zrzutów */
#main:focus, #main:focus-visible { outline: none; }
.badge, .sample { font-family: var(--font); letter-spacing: 0; line-height: 1.3; }
@media (max-width: 1020px) {
  .prow__id { grid-column: 1; grid-row: 1; order: 0; }
  .prow__chev { grid-column: 2; grid-row: 1; justify-self: end; order: 0; }
  .prow__breeder { grid-column: 1 / -1; grid-row: 2; order: 0; }
  .prow__day { grid-column: 1; grid-row: 3; order: 0; align-self: end; }
  .prow__due { grid-column: 2; grid-row: 3; order: 0; text-align: right; }
}
