/* ==========================================================================
   CRM kliniki — panel operacyjny w tym samym świecie co strona i karta.
   Posadzka jako tło pracy, atrament w lewym torze, papier na kartach.
   Pięć kolorów linii znaczy specjalizację i nic innego; niebieski to akcja.
   ========================================================================== */

:root {
  --floor: #edefec;
  --floor-2: #e2e5e1;
  --paper: #f8f9f7;
  --white: #fff;
  --ink: #14171a;
  --ink-2: #2b3035;
  --ink-3: #3a4147;
  --muted: #535a61;
  --faint: #5b6168;
  --hair: rgba(20, 23, 26, 0.12);
  --hair-2: rgba(20, 23, 26, 0.22);

  --accent: #1f5fd6;
  --accent-dark: #1a4fb4;
  --accent-soft: rgba(31, 95, 214, 0.1);
  --ok: #13875a;
  --warn: #b26a00;
  --alert: #b3261e;

  --l-kregoslup: #1f5fd6;
  --l-sport: #e8590c;
  --l-uraz: #13875a;
  --l-ciaza: #c2255c;
  --l-dzieci: #f2b705;

  --f-display: 'Overpass', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rail: 248px;
  --r: 12px;
  --r-sm: 9px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  accent-color: var(--accent);
}

body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 0.95rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
}

svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--floor);
  border-radius: 8px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--faint);
}

/* ── Pasek demo ───────────────────────────────────────────────────────── */

.demo-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 9px 52px 9px 20px;
  background: var(--ink);
  color: #cfd3d6;
  font-size: 0.85rem;
}

.demo-bar strong {
  color: #fff;
}

.demo-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.demo-bar__link:hover {
  text-decoration: underline;
}

.demo-bar__close {
  position: absolute;
  right: 10px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #cfd3d6;
  cursor: pointer;
}

.demo-bar__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.demo-bar :focus-visible {
  outline-color: #fff;
}

/* ── Szkielet aplikacji ───────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  background: var(--ink);
  color: #cfd3d6;
}

.rail :focus-visible {
  outline-color: #fff;
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
}

.rail__mark {
  width: 24px;
  height: 24px;
}

.rail__mark path {
  stroke-width: 3.6;
}

.rail__list {
  display: grid;
  gap: 2px;
}

.rail__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: #cfd3d6;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.rail__btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.rail__btn[aria-current='true'] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
}

.rail__badge {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
}

.rail__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rail__who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.rail__who em {
  display: block;
  font-style: normal;
  color: #8f959b;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.8rem;
}

/* ── Górny pasek ──────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 2.4vw, 28px);
  background: rgba(237, 239, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
}

.top__menu {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  background: var(--white);
  cursor: pointer;
}

.top__title h1 {
  font-size: 1.35rem;
}

.top__title p {
  font-size: 0.82rem;
  color: var(--muted);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 0 14px;
  width: min(360px, 38vw);
  height: 42px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search input::placeholder {
  color: var(--faint);
}

.search__out {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  padding: 6px;
  border-radius: var(--r);
  background: var(--white);
  box-shadow: 0 20px 40px -24px rgba(20, 23, 26, 0.6), 0 0 0 1px var(--hair);
}

.search__out li button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search__out li button:hover {
  background: var(--floor);
}

.search__out em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.search__empty {
  padding: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Przyciski ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: var(--white);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn--accent {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: var(--accent-dark);
  border-color: transparent;
}

.btn--ink {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
}

.btn--ghost {
  background: transparent;
}

.btn--sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
}

/* ── Widoki i karty ───────────────────────────────────────────────────── */

.view {
  padding: clamp(16px, 2.4vw, 28px);
  overflow: auto;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--dash {
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.04), 0 18px 32px -30px rgba(20, 23, 26, 0.6);
}

.card--chart {
  grid-column: span 4;
}

.grid--dash > .card:nth-child(2) {
  grid-column: span 2;
}

.grid--dash > .card:nth-child(3),
.grid--dash > .card:nth-child(4),
.grid--dash > .card:nth-child(5) {
  grid-column: span 2;
}

.card__head {
  margin-bottom: 14px;
}

.card__head h2 {
  font-size: 1.05rem;
}

.card__note {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Kafle z liczbami ─────────────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.tile {
  padding: 16px 18px 18px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.04), 0 18px 32px -30px rgba(20, 23, 26, 0.6);
}

.tile--ink {
  background: var(--ink);
  color: #cfd3d6;
}

.tile__label {
  font-size: 0.82rem;
  color: var(--muted);
}

.tile--ink .tile__label {
  color: #aab1b6;
}

.tile__value {
  margin-top: 6px;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tile--ink .tile__value {
  color: #fff;
}

.tile__foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tile--ink .tile__foot {
  color: #aab1b6;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.trend--up {
  color: var(--ok);
}

.trend--down {
  color: var(--alert);
}

.tile--ink .trend--up {
  color: #6fd3a3;
}

.trend svg {
  width: 14px;
  height: 14px;
}

/* ── Wykres słupkowy ──────────────────────────────────────────────────── */

.chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 10px;
  height: 190px;
  padding-top: 6px;
}

.bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
  text-align: center;
}

.bar__stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
}

.bar__seg {
  border-radius: 4px;
  transition: height 0.6s var(--ease-out);
}

.bar__seg--online {
  background: var(--accent);
}

.bar__seg--tel {
  background: var(--floor-2);
}

.bar__label {
  font-size: 0.72rem;
  color: var(--muted);
}

.bar__sum {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.82rem;
}

.bar:last-child .bar__sum {
  color: var(--accent);
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend__key {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend__key--online {
  background: var(--accent);
}

.legend__key--tel {
  background: var(--floor-2);
}

/* ── Lista wizyt ──────────────────────────────────────────────────────── */

.visits {
  display: grid;
  gap: 2px;
  max-height: 420px;
  overflow: auto;
  scrollbar-width: thin;
}

.visits li button {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 4px 12px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.visits li button:hover {
  background: var(--floor);
}

.visit__time {
  grid-row: span 2;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.visit__who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  min-width: 0;
}

.visit__who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit__what {
  font-size: 0.85rem;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--ink));
}

.pill {
  grid-row: span 2;
  align-self: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--floor-2);
  color: var(--ink-2);
}

.pill--ok {
  background: rgba(19, 135, 90, 0.12);
  color: var(--ok);
}

.pill--warn {
  background: rgba(178, 106, 0, 0.14);
  color: var(--warn);
}

.pill--live {
  background: var(--accent);
  color: #fff;
}

.pill--done {
  background: var(--floor-2);
  color: var(--faint);
}

/* ── Zadania ──────────────────────────────────────────────────────────── */

.tasks {
  display: grid;
  gap: 2px;
}

.task {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 9px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.task:hover {
  background: var(--floor);
}

.task__check {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.task input {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.task__text {
  font-size: 0.92rem;
}

.task__meta {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.task.is-done .task__text {
  color: var(--faint);
  text-decoration: line-through;
}

.tag {
  display: inline-block;
  white-space: nowrap;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--hair-2);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.tag--now {
  border-color: transparent;
  background: rgba(179, 38, 30, 0.12);
  color: var(--alert);
}

/* ── Lejek i źródła ───────────────────────────────────────────────────── */

.funnel {
  display: grid;
  gap: 10px;
}

.funnel li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: baseline;
}

.funnel__name {
  font-size: 0.9rem;
}

.funnel__val {
  font-family: var(--f-display);
  font-weight: 800;
}

.funnel__track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--floor-2);
  overflow: hidden;
}

.funnel__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  transition: width 0.7s var(--ease-out);
}

.funnel li:first-child .funnel__fill {
  background: var(--accent);
}

.sources {
  display: grid;
  gap: 12px;
}

.sources li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
  font-size: 0.9rem;
}

.sources b {
  font-family: var(--f-display);
}

.sources__track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--floor-2);
  overflow: hidden;
}

.sources__fill {
  display: block;
  height: 100%;
  background: var(--ink-2);
}

/* ── Kalendarz ────────────────────────────────────────────────────────── */

.cal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cal__hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--ink);
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip__key {
  width: 12px;
  height: 4px;
  border-radius: 999px;
  background: var(--c, currentColor);
}

.cal {
  display: grid;
  grid-template-columns: 56px repeat(6, minmax(0, 1fr));
  border-radius: var(--r);
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.04), 0 18px 32px -30px rgba(20, 23, 26, 0.6);
}

.cal__head {
  padding: 12px 10px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.9rem;
}

.cal__head span {
  display: block;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
}

.cal__head--today {
  background: var(--accent-soft);
}

.cal__hours {
  border-right: 1px solid var(--hair);
}

.cal__hour {
  height: 52px;
  padding-right: 8px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--faint);
  transform: translateY(-7px);
}

.cal__col {
  position: relative;
  border-right: 1px solid var(--hair);
}

.cal__col:last-child {
  border-right: 0;
}

.cal__line {
  height: 52px;
  border-bottom: 1px solid rgba(20, 23, 26, 0.06);
}

.event {
  position: absolute;
  left: 4px;
  right: 4px;
  display: block;
  padding: 5px 8px 5px 12px;
  border: 0;
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--hair), 0 6px 14px -12px rgba(20, 23, 26, 0.8);
  text-align: left;
  font-size: 0.76rem;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.event::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 4px;
  border-radius: 999px;
  background: var(--c);
}

.event:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--hair-2), 0 10px 18px -12px rgba(20, 23, 26, 0.8);
}

.event b {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event span {
  color: var(--muted);
}

.event.is-dim {
  opacity: 0.25;
}

/* ── Tabela pacjentów ─────────────────────────────────────────────────── */

.table__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.table__count {
  font-size: 0.85rem;
  color: var(--muted);
}

.table-wrap {
  border-radius: var(--r);
  background: var(--paper);
  overflow: auto;
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.04), 0 18px 32px -30px rgba(20, 23, 26, 0.6);
}

.table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--floor-2);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  white-space: nowrap;
}

.table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s;
}

.table tbody tr:hover {
  background: var(--floor);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.who__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
  color: var(--on);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.78rem;
}

.who__name {
  display: block;
  font-weight: 700;
}

.who__sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.progress__track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--floor-2);
  overflow: hidden;
}

.progress__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--c, var(--ink));
}

.progress b {
  font-family: var(--f-display);
  font-size: 0.82rem;
  white-space: nowrap;
}

.money {
  font-family: var(--f-display);
  font-weight: 800;
}

/* ── Skrzynka ─────────────────────────────────────────────────────────── */

.grid--inbox {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.inbox {
  display: grid;
  gap: 2px;
}

.inbox button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}

.inbox button:hover {
  background: var(--floor);
}

.inbox li.is-open button {
  background: var(--floor-2);
}

.inbox__from {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.inbox__time {
  font-size: 0.78rem;
  color: var(--muted);
}

.inbox__subj {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.card--thread {
  gap: 14px;
  min-height: 420px;
}

.thread__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.thread__msg {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--floor);
  font-size: 0.95rem;
}

.thread__reply {
  display: grid;
  gap: 10px;
}

.thread__reply textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  background: var(--white);
  font: inherit;
  resize: vertical;
}

.thread__reply textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.thread__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Automatyzacje ────────────────────────────────────────────────────── */

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.rule {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.04), 0 18px 32px -30px rgba(20, 23, 26, 0.6);
}

.rule__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rule h3 {
  font-size: 1rem;
}

.rule__when {
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
}

.rule p {
  font-size: 0.9rem;
  color: var(--ink-2);
}

.rule__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
  font-size: 0.82rem;
  color: var(--muted);
}

.rule__foot b {
  font-family: var(--f-display);
  color: var(--ink);
}

.rule.is-off {
  background: var(--floor);
  box-shadow: none;
}

.rule.is-off h3,
.rule.is-off p {
  color: var(--muted);
}

/* ── Karta pacjenta ───────────────────────────────────────────────────── */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer__veil {
  position: absolute;
  inset: 0;
  background: rgba(20, 23, 26, 0.35);
  animation: fade 0.25s var(--ease-out);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  padding: 26px clamp(20px, 3vw, 30px) 34px;
  background: var(--paper);
  overflow: auto;
  box-shadow: -30px 0 60px -40px rgba(20, 23, 26, 0.8);
  animation: slide 0.35s var(--ease-out);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes slide {
  from {
    translate: 100% 0;
  }
}

.drawer__close {
  position: absolute;
  right: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hair-2);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

.drawer__close:hover {
  border-color: var(--ink);
}

.pat__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 44px;
}

.pat__mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
  color: var(--on);
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.05rem;
}

.pat__name {
  font-size: 1.3rem;
}

.pat__sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.pat__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 20px;
  border-radius: var(--r-sm);
  background: var(--hair);
  overflow: hidden;
}

.pat__facts div {
  padding: 12px 14px;
  background: var(--paper);
}

.pat__facts dt {
  font-size: 0.78rem;
  color: var(--muted);
}

.pat__facts dd {
  margin-top: 2px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.pat__block {
  margin-top: 22px;
}

.pat__block h3 {
  margin-bottom: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pat__note {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--floor);
  font-size: 0.92rem;
}

.timeline {
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--floor-2);
}

.timeline li {
  position: relative;
  padding: 0 0 14px;
  font-size: 0.9rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--c, var(--ink));
}

.timeline b {
  font-family: var(--f-display);
}

.timeline span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.pat__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ── Komunikat ────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  width: max-content;
  max-width: min(calc(100vw - 32px), 460px);
  padding: 13px 18px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 20px 40px -20px rgba(20, 23, 26, 0.8);
  translate: -50% 140%;
  opacity: 0;
  transition: translate 0.45s var(--ease-out), opacity 0.3s;
  pointer-events: none;
}

.toast.is-on {
  translate: -50% 0;
  opacity: 1;
}

/* ── Wąskie ekrany ────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .grid--dash {
    grid-template-columns: repeat(4, 1fr);
  }

  .card--chart,
  .grid--dash > .card:nth-child(2) {
    grid-column: span 4;
  }

  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 262px;
    translate: -100% 0;
    transition: translate 0.3s var(--ease-out);
  }

  .app.is-open .rail {
    translate: 0 0;
    box-shadow: 30px 0 60px -40px rgba(20, 23, 26, 0.9);
  }

  .top__menu {
    display: grid;
  }

  .top {
    flex-wrap: wrap;
  }

  .search {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .grid--dash,
  .grid--inbox {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--dash > .card {
    grid-column: 1 / -1 !important;
  }

  .cal {
    grid-template-columns: 44px repeat(6, minmax(94px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .top__title h1 {
    font-size: 1.15rem;
  }

  .btn span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Radar terapii ────────────────────────────────────────────────────── */

.card--radar {
  margin-bottom: 16px;
}

.card--radar .card__head h2::after {
  content: attr(data-ile);
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--alert);
  color: #fff;
  font-family: var(--f-body);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.card__head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.radar {
  display: grid;
  gap: 2px;
}

.radar__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 10px;
  border-radius: var(--r-sm);
  transition: background-color 0.2s;
}

.radar__row:hover {
  background: var(--floor);
}

.radar__row + .radar__row {
  border-top: 1px solid var(--hair);
}

.radar__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c);
  color: var(--on);
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.82rem;
}

.radar__name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1rem;
}

.radar__meta {
  display: block;
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
}

.radar__why {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.why {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--floor-2);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-2);
}

.why--termin {
  background: rgba(179, 38, 30, 0.12);
  color: var(--alert);
}

.why--bol {
  background: rgba(178, 106, 0, 0.16);
  color: var(--warn);
}

.why--cwiczenia {
  background: rgba(31, 95, 214, 0.12);
  color: var(--accent);
}

.radar__act {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.radar__empty {
  padding: 14px 10px;
  color: var(--muted);
}

.tile--alert {
  background: rgba(179, 38, 30, 0.06);
}

.tile--alert .tile__value {
  color: var(--alert);
}

/* ── Krzywa bólu ──────────────────────────────────────────────────────── */

.spark {
  flex: none;
  overflow: visible;
}

.spark polyline {
  fill: none;
  stroke: var(--c, var(--ink));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark circle {
  fill: var(--c, var(--ink));
  stroke: none;
}

.spark--empty {
  font-size: 0.76rem;
  color: var(--faint);
}

/* ── Tablica terapii ──────────────────────────────────────────────────── */

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.board__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 16px;
  border-radius: var(--r);
  background: var(--floor-2);
}

.board__col:first-child {
  background: rgba(179, 38, 30, 0.08);
}

.board__head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.board__head h2 span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
}

.board__head p {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.board__cards {
  display: grid;
  gap: 10px;
}

.board__empty {
  padding: 6px 2px;
  font-size: 0.85rem;
  color: var(--faint);
}

.epizod {
  display: grid;
  gap: 6px;
  padding: 13px 14px 14px;
  border-radius: var(--r-sm);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.05), 0 10px 20px -18px rgba(20, 23, 26, 0.7);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.epizod:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(20, 23, 26, 0.05), 0 16px 26px -18px rgba(20, 23, 26, 0.8);
}

.epizod--wysokie {
  background: rgba(179, 38, 30, 0.05);
  box-shadow: 0 0 0 1px rgba(179, 38, 30, 0.35), 0 10px 20px -18px rgba(20, 23, 26, 0.7);
}

.epizod--srednie {
  background: rgba(178, 106, 0, 0.05);
  box-shadow: 0 0 0 1px rgba(178, 106, 0, 0.35), 0 10px 20px -18px rgba(20, 23, 26, 0.7);
}

.epizod__who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 800;
}

.epizod__diag {
  font-size: 0.82rem;
  color: var(--muted);
}

.epizod__cel {
  font-size: 0.85rem;
}

.epizod__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.epizod__progress b {
  font-family: var(--f-display);
  font-size: 0.8rem;
  white-space: nowrap;
}

.epizod__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--hair);
}

.epizod__wynik {
  font-size: 0.78rem;
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
}

.epizod__why {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--alert);
}

/* ── Epizod w karcie pacjenta ─────────────────────────────────────────── */

.pat__epizod {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  background: var(--floor);
}

.pat__diag {
  font-family: var(--f-display);
  font-weight: 800;
}

.pat__cel {
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.pat__bars {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pat__bars .progress__track {
  display: block;
  width: 100%;
  height: 8px;
}

.epizod__progress .progress__track {
  height: 6px;
}

.pat__bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.pat__bar-label em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--faint);
}

.pat__bar-label b {
  font-family: var(--f-display);
  color: var(--ink);
}

.pat__bol {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}

.pat__bol p {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.pat__risk {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .board {
    grid-template-columns: minmax(0, 1fr);
  }

  .radar__row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .radar__act {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Prototyp: siatki, listy z akcjami, formularze, okno dialogowe
   ═══════════════════════════════════════════════════════════════════════ */

.grid--dzis {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.grid--dzis > .card:first-child {
  grid-row: span 2;
}

.grid--ust {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pusto {
  margin: 0;
  padding: 18px 2px;
  color: var(--faint);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ── Grafik dnia: wiersz z akcjami ──────────────────────────────────── */
.wizyty {
  display: grid;
  gap: 2px;
}

.wizyta {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px;
  border-radius: var(--r-sm);
  transition: background-color 0.2s;
}

.wizyta__tresc {
  min-width: 0;
}

.wizyta__naglowek {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.wizyta:hover,
.wizyta:focus-within {
  background: var(--floor);
}

.wizyta__czas {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.wizyta__kto {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.wizyta__kto:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wizyta__co {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Przyciski łamią się w dwa rzędy, żeby opis wizyty miał szerokość na jedną linię. */
.wizyta__akcje {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 290px;
}

/* ── Proste listy: nowi pacjenci, wizyty i log w karcie ─────────────── */
.prosta {
  display: grid;
  gap: 2px;
}

.prosta > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
}

.prosta > li:nth-child(odd) {
  background: var(--floor);
}

.prosta__kto {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.prosta__kto:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prosta em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 400;
}

.prosta--wizyty > li > span:first-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Ćwiczenia w karcie pacjenta ────────────────────────────────────── */
.cwiczenia {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.cwiczenia li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--floor);
}

.cwiczenia span {
  font-weight: 700;
}

.cwiczenia em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 400;
}

.cwiczenia b {
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Karta pacjenta: dodatki prototypu ──────────────────────────────── */
.pat__epizod-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.pat__epizod--pusty {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.pat__epizod--pusty p {
  margin: 0;
  color: var(--muted);
}

.pat__bol-txt {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.pat__bol-txt strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pat__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.pat__akcje--male {
  margin-top: 12px;
}

.radar__body {
  min-width: 0;
}

/* ── Ustawienia ─────────────────────────────────────────────────────── */
.dane {
  display: grid;
  gap: 2px;
  margin: 0;
}

.dane > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
}

.dane > div:nth-child(odd) {
  background: var(--floor);
}

.dane dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.dane dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.dane__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mini td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}

.mini td:first-child {
  font-weight: 700;
  font-variant-numeric: normal;
}

.mini td:not(:first-child) {
  color: var(--muted);
  text-align: right;
}

.mini tr:last-child td {
  border-bottom: 0;
}

.table__akcje {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Kalendarz: wolne godziny i dni zamknięte ───────────────────────── */
.cal__col--off {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(135deg, transparent 0 7px, var(--floor-2) 7px 8px);
}

.cal__off {
  margin: 0;
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wolny {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 24px;
  padding: 0;
  border: 1px dashed var(--hair-2);
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.cal__col:hover .wolny,
.wolny:focus-visible {
  opacity: 1;
}

/* Bez kursora (dotyk) nie ma najechania — wolne godziny muszą być widoczne od razu. */
@media (hover: none) {
  .wolny {
    opacity: 0.6;
  }
}

.wolny:hover,
.wolny:focus-visible {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ── Okno dialogowe ─────────────────────────────────────────────────── */
[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__veil {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 23, 26, 0.5);
  animation: veil 0.2s var(--ease-out);
}

@keyframes veil {
  from {
    opacity: 0;
  }
}

.modal__box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  border-radius: var(--r);
  background: var(--white);
  box-shadow: 0 30px 70px rgba(20, 23, 26, 0.3);
  animation: box 0.26s var(--ease-out);
}

@keyframes box {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal__veil,
  .modal__box {
    animation: none;
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hair);
}

.modal__head h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.modal__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--floor);
  cursor: pointer;
}

.modal__close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.modal__close:hover {
  background: var(--floor-2);
}

.modal__body {
  padding: 18px 20px;
  overflow: auto;
  scrollbar-width: thin;
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--hair);
}

.modal__info {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.modal__body > .modal__info:first-child {
  margin: 0 0 16px;
}

.modal__err {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(179, 38, 30, 0.08);
  color: var(--alert);
  font-size: 0.88rem;
  font-weight: 700;
}

.modal__label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Formularze ─────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field--full,
.form-grid > .modal__info {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.82rem;
  font-weight: 700;
}

.field label em {
  color: var(--faint);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--hair-2);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.field textarea {
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field input[readonly],
.field textarea[readonly] {
  background: var(--floor);
  color: var(--muted);
}

/* ── Wybór godziny ──────────────────────────────────────────────────── */
.sloty {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slot {
  padding: 7px 11px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.slot:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.slot[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
}

/* ── Wybór ćwiczeń ──────────────────────────────────────────────────── */
.wybor {
  display: grid;
  gap: 2px;
}

.wybor > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
}

.wybor > li:nth-child(odd) {
  background: var(--floor);
}

.wybor__check {
  display: flex;
  align-items: start;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}

.wybor__check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.wybor__check strong {
  display: block;
  font-size: 0.9rem;
}

.wybor__check em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.wybor__ile {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.wybor__ile input {
  padding: 5px 7px;
  border: 1px solid var(--hair-2);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
}

.wybor__ile input[type="text"] {
  width: 110px;
}

.wybor__ile input[type="number"] {
  width: 48px;
  text-align: center;
}

/* ── Cofnięcie w komunikacie ────────────────────────────────────────── */
.toast__undo {
  margin-left: 14px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.toast__undo:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ── Wąskie ekrany ──────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid--dzis {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid--dzis > .card:first-child {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .wizyta {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .wizyta__naglowek {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .wizyta__akcje {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 6px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wybor > li {
    display: grid;
    gap: 8px;
  }

  .wybor__ile {
    padding-left: 26px;
  }

  .modal {
    padding: 0;
    align-items: end;
  }

  .modal__box {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r) var(--r) 0 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Kolejka wiadomości, podsumowanie miesiąca, blokady, seria wizyt
   ═══════════════════════════════════════════════════════════════════════ */

.wyjasnienie {
  max-width: 76ch;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.wyjasnienie--uwaga {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink-2);
}

/* ── Kolejka wiadomości ─────────────────────────────────────────────── */
.kolejka {
  display: grid;
  gap: 2px;
}

.kolejka > li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 10px;
  border-radius: var(--r-sm);
}

.kolejka > li:nth-child(odd) {
  background: var(--floor);
}

.kolejka > li.is-off {
  opacity: 0.55;
}

.kolejka__czas {
  font-family: var(--f-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kolejka__co {
  min-width: 0;
}

.kolejka__co strong {
  display: block;
  font-size: 0.95rem;
}

.kolejka__kto {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.kolejka__kto:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.kolejka__co em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ── Przełącznik włączone/wyłączone ─────────────────────────────────── */
.switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.switch > span {
  display: block;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--hair-2);
  transition: background-color 0.2s;
}

.switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s var(--ease-out);
}

.switch[aria-checked='true'] {
  color: var(--ink);
}

.switch[aria-checked='true'] > span {
  background: var(--ok);
}

.switch[aria-checked='true'] > span::after {
  transform: translateX(16px);
}

.ustawienia-sms {
  display: grid;
  gap: 2px;
}

.ustawienia-sms > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
}

.ustawienia-sms > li:nth-child(odd) {
  background: var(--floor);
}

.ustawienia-sms em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

/* ── Podsumowanie miesiąca ──────────────────────────────────────────── */
.duza {
  margin: 12px 0 0;
  font-family: var(--f-display);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.duza span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.prosta__akcje {
  flex: none;
  display: flex;
  gap: 6px;
}

/* ── Blokada w kalendarzu ───────────────────────────────────────────── */
.blok {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 2;
  display: flex;
  align-items: start;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: repeating-linear-gradient(135deg, var(--floor-2) 0 6px, #d7dbd6 6px 12px);
  color: var(--faint);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.blok span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blok:hover {
  color: var(--alert);
  outline: 2px solid var(--alert);
}

/* ── Seria wizyt ────────────────────────────────────────────────────── */
.seria {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--floor);
}

.seria__check {
  display: flex;
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.seria__check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.seria__check strong {
  display: block;
  font-size: 0.92rem;
}

.seria__check em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
  line-height: 1.45;
}

.seria__pola {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0 27px;
  color: var(--muted);
  font-size: 0.85rem;
}

.seria__pola input {
  width: 62px;
  padding: 7px 9px;
  border: 1px solid var(--hair-2);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: center;
}

/* ── Wynik terapii ──────────────────────────────────────────────────── */
.wynik {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 18px;
}

.wynik > div {
  padding: 12px 14px;
  background: var(--floor);
}

.wynik span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.wynik b {
  display: block;
  margin-top: 4px;
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.pat__zamknieta {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .kolejka > li {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .kolejka .switch {
    grid-column: 2;
    justify-content: start;
  }

  .wynik {
    grid-template-columns: minmax(0, 1fr);
  }

  .duza {
    font-size: 2.6rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Zespół: filtr, znaczki osób, grafik w ustawieniach
   ═══════════════════════════════════════════════════════════════════════ */

.zespol-filtr {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.osoba {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 7px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background-color 0.18s;
}

.osoba:not(:has(.osoba__mark)) {
  padding: 7px 16px;
}

.osoba:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.osoba.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.osoba__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.osoba__mark--duzy {
  width: 40px;
  height: 40px;
  font-size: 0.92rem;
}

/* Znaczek osoby przy wizycie. */
.kto {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c, var(--muted));
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Inicjały wewnątrz zdarzenia w kalendarzu. */
.event b i {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 800;
  vertical-align: 1px;
}

/* Wolna godzina pokazuje, kto może ją wziąć. */
.wolny em {
  margin-left: 6px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.slot em {
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.slot[aria-pressed='true'] em {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Zespół w ustawieniach ──────────────────────────────────────────── */
.card--szeroka {
  grid-column: 1 / -1;
}

.osoby {
  display: grid;
  gap: 2px;
}

.osoba-wiersz {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-radius: var(--r-sm);
}

.osoba-wiersz:nth-child(odd) {
  background: var(--floor);
}

.osoba-wiersz.is-off {
  opacity: 0.5;
}

.osoba-wiersz__dane strong {
  display: block;
  font-size: 1rem;
}

.osoba-wiersz__dane em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
}

.osoba-wiersz__grafik {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.osoba-wiersz__linie {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.osoba-wiersz__linie .tag {
  border-left: 0;
  box-shadow: inset 3px 0 0 var(--c);
  padding-left: 10px;
}

.osoba-wiersz__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Formularz osoby ────────────────────────────────────────────────── */
.kolory {
  display: flex;
  gap: 8px;
}

.kolor {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out);
}

.kolor:hover {
  transform: scale(1.1);
}

.kolor[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--white);
}

.wybor-linii {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
}

.linia-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.92rem;
}

.linia-check input {
  flex: none;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.linia-check span[style] {
  position: relative;
  padding-left: 14px;
}

.linia-check span[style]::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--c);
}

.grafik {
  width: 100%;
  border-collapse: collapse;
}

.grafik td {
  padding: 5px 4px;
  vertical-align: middle;
}

.grafik td:first-child {
  width: 100%;
}

.grafik input[type='number'] {
  width: 62px;
  padding: 7px 8px;
  border: 1px solid var(--hair-2);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  text-align: center;
}

.grafik td[aria-hidden] {
  color: var(--faint);
}

/* ── Prowadzący w karcie pacjenta ───────────────────────────────────── */
.pat__prowadzi {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.wybor-osoby {
  padding: 6px 10px;
  border: 1px solid var(--hair-2);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .osoba-wiersz {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .osoba-wiersz__akcje {
    grid-column: 1 / -1;
  }

  .zespol-filtr {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .osoba {
    flex: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Pierwsze uruchomienie
   ═══════════════════════════════════════════════════════════════════════ */

.start {
  max-width: 700px;
  padding: 8px 0;
}

.start__kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.start__h {
  margin: 0 0 14px;
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.start__lead {
  max-width: 54ch;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.start__kroki {
  display: grid;
  gap: 2px;
  margin: 0 0 28px;
}

.start__krok {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--r-sm);
  background: var(--paper);
}

.start__num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--floor-2);
  color: var(--muted);
  font-family: var(--f-display);
  font-weight: 800;
}

.start__krok.is-ok .start__num {
  background: var(--ok);
  color: #fff;
}

.start__krok.is-ok .start__num::after {
  content: '✓';
  font-size: 0.95rem;
}

.start__krok.is-ok .start__num {
  font-size: 0;
}

.start__krok h3 {
  margin: 4px 0 4px;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.start__krok p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.start__stan {
  margin-top: 8px !important;
  color: var(--ink) !important;
  font-size: 0.85rem !important;
  font-weight: 700;
}

.start__krok:not(.is-ok) .start__stan {
  color: var(--faint) !important;
  font-weight: 400;
}

.start__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.start__stopka {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 0.9rem;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════
   Wiadomości: rodzaje i kolejka
   ═══════════════════════════════════════════════════════════════════════ */

/* Cztery rodzaje układają się w kwadrat; trzy w rzędzie zostawiały sierotę. */
.rodzaje {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.rodzaj {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r);
  background: var(--white);
  box-shadow: 0 1px 2px rgba(20, 23, 26, 0.06);
  transition: opacity 0.2s;
}

.rodzaj.is-off {
  background: var(--floor);
  box-shadow: none;
}

.rodzaj.is-off .rodzaj__szablon,
.rodzaj.is-off .rodzaj__dane {
  opacity: 0.5;
}

.rodzaj__gora {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.rodzaj__nazwa {
  margin: 0 0 4px;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.rodzaj__opis {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.rodzaj__dane {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0;
}

.rodzaj__dane dt {
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rodzaj__dane dd {
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.rodzaj__szablon {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--floor);
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.55;
}

.rodzaj.is-off .rodzaj__szablon {
  background: var(--floor-2);
}

.rodzaj__akcje {
  margin-top: auto;
}

.sekcja-h {
  margin: 0 0 10px;
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

/* ── Kolejka ────────────────────────────────────────────────────────── */
.kolejka__dzien {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.kolejka__znak {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--f-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kolejka__skad,
.kolejka__powod {
  display: block;
  margin-top: 5px;
  font-size: 0.76rem;
  font-weight: 700;
}

.kolejka__skad {
  color: var(--faint);
  font-weight: 400;
}

.kolejka__powod {
  color: var(--warn);
}

.kolejka__akcje {
  flex: none;
  display: flex;
  gap: 6px;
}

/* ── Szablon w oknie ────────────────────────────────────────────────── */
.pola {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pole-btn {
  padding: 6px 12px;
  border: 1px dashed var(--hair-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.pole-btn:hover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.podglad {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #e9ecea;
  font-size: 0.9rem;
  line-height: 1.55;
}

.podglad span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .rodzaje {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {

  .kolejka__akcje {
    grid-column: 2;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Akcje w kontekście: wizyta w karcie, nowy pacjent w umawianiu, okno wizyty
   ═══════════════════════════════════════════════════════════════════════ */

.pat__h3--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Wizyta w karcie pacjenta ───────────────────────────────────────── */
.wizyta-mini {
  display: block !important;
  padding: 10px 12px !important;
}

.wizyta-mini__gora {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizyta-mini__gora > span:first-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wizyta-mini__gora em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 400;
  font-variant-numeric: normal;
}

.wizyta-mini__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

/* ── Pole z akcją obok ──────────────────────────────────────────────── */
.pole-z-akcja {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pole-z-akcja select {
  flex: 1 1 auto;
  min-width: 0;
}

.pole-z-akcja .link-btn {
  flex: none;
  font-size: 0.85rem;
}

.nowy-inline {
  margin-top: -4px;
  padding: 16px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

.nowy-inline__h {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.nowy-inline .link-btn {
  margin-top: 12px;
  font-size: 0.85rem;
}

/* ── Okno pojedynczej wizyty ────────────────────────────────────────── */
.wizyta-okno__kto {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  background: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s;
}

.wizyta-okno__kto:hover {
  border-color: var(--ink);
  background: var(--floor);
}

.wizyta-okno__kto strong {
  display: block;
  font-size: 1rem;
}

.wizyta-okno__kto em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.82rem;
}

.wizyta-okno__strzalka {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.wizyta-okno__strzalka svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.wizyta-okno__akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

/* Podpowiedź w wyszukiwarce, gdy nikogo nie ma. */
.search__empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.search__empty .link-btn {
  display: block;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .wizyta-okno__kto {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wizyta-okno__strzalka {
    grid-column: 2;
  }

  .pole-z-akcja {
    flex-wrap: wrap;
  }
}

.pat__h3-akcje {
  display: flex;
  gap: 6px;
}

.pat__nastepna-wiad {
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.5;
}

.pat__nastepna-wiad .link-btn {
  font-size: 0.86rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Wiadomości w karcie pacjenta
   ═══════════════════════════════════════════════════════════════════════ */

.wiad-lista {
  display: grid;
  gap: 2px;
  margin-bottom: 22px;
}

.wiad-lista__poz {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--floor);
}

.wiad-lista__poz.is-off {
  opacity: 0.55;
}

.wiad-lista__kiedy {
  display: grid;
  align-content: start;
  gap: 1px;
}

.wiad-lista__kiedy strong {
  font-family: var(--f-display);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wiad-lista__kiedy em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.wiad-lista__nazwa {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.wiad-lista__co em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.5;
}

.wiad-lista__akcje {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.kolejka__znak--pora {
  background: rgba(19, 135, 90, 0.14);
  color: #0f6e49;
}

/* ── Rodzaje przy pacjencie ─────────────────────────────────────────── */
.wiad-naglowek {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wiad-rodzaje {
  display: grid;
  gap: 2px;
}

.wiad-rodzaje > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--floor);
}

.wiad-rodzaje > li.is-off {
  opacity: 0.6;
}

.wiad-rodzaje__co strong {
  display: block;
  font-size: 0.9rem;
}

.wiad-rodzaje__co em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.wiad-rodzaje__uwaga {
  display: block;
  margin-top: 5px;
  color: var(--warn);
  font-size: 0.76rem;
  font-weight: 700;
}

.wiad-rodzaje__akcje {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiad-rodzaje__akcje .switch[disabled],
.wiad-rodzaje__akcje .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Gotowe treści ──────────────────────────────────────────────────── */
.gotowce {
  display: grid;
  gap: 6px;
}

.gotowiec {
  padding: 11px 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s;
}

.gotowiec:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 720px) {
  .wiad-rodzaje > li {
    flex-wrap: wrap;
  }

  .wiad-rodzaje__akcje {
    width: 100%;
    justify-content: space-between;
  }
}
