/* =====================================================================
   DPS Leki — Wariant B "Opiekuńczy / tablet-first"
   Paleta: szałwiowa zieleń, kremowy, miękkie akcenty
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Mulish:wght@400;500;600;700;800&display=swap');

:root {
  /* Powierzchnie / kremowe tła */
  --cream:        #f6f1e7;
  --cream-2:      #efe8d8;
  --paper:        #fffdf8;
  --paper-2:      #fbf7ee;

  /* Szałwiowa zieleń */
  --sage-900:     #2f4338;
  --sage-700:     #3f5d4c;
  --sage-600:     #557a63;
  --sage-500:     #6b9078;
  --sage-400:     #8aab93;
  --sage-200:     #c3d6c5;
  --sage-100:     #dde8dc;
  --sage-50:      #ecf2e9;

  /* Akcenty ciepłe */
  --terracotta:   #cd7e54;
  --terracotta-50:#f7e6da;
  --honey:        #e0a85b;
  --honey-50:     #f8edd6;
  --clay:         #b65b4c;

  /* Status */
  --ok:           #5b8a6a;
  --ok-bg:        #e3efe2;
  --warn:         #c98a2e;
  --warn-bg:      #faecd2;
  --danger:       #b6493c;
  --danger-bg:    #f6e0db;
  --info:         #4f7a93;
  --info-bg:      #e0ecf1;

  /* Tekst */
  --ink:          #2a322c;
  --ink-soft:     #5b665d;
  --ink-faint:    #8b958c;

  --line:         #e3dccb;
  --line-soft:    #ece5d6;

  --radius:       26px;
  --radius-sm:    18px;
  --radius-lg:    34px;

  --shadow:       0 18px 40px -22px rgba(47,67,56,.40);
  --shadow-sm:    0 8px 20px -14px rgba(47,67,56,.40);
  --shadow-lg:    0 30px 60px -30px rgba(47,67,56,.45);

  --tap:          64px; /* minimalny touch target */

  --font-head:    'Fraunces', Georgia, serif;
  --font-body:    'Mulish', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 85% -10%, var(--sage-50), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, var(--honey-50), transparent 55%),
    var(--cream);
  background-attachment: fixed;
  padding-bottom: 120px; /* miejsce na dolny pasek */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }

/* ===================== UKŁAD STRONY ===================== */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---- Górny pasek ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(246,241,231,.96), rgba(246,241,231,.82));
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 18px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--sage-600), var(--sage-700));
  color: var(--paper); box-shadow: var(--shadow-sm);
  font-size: 26px;
}
.brand-text b { font-family: var(--font-head); font-size: 22px; font-weight: 600; display: block; line-height: 1.1; }
.brand-text span { font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }

.topbar-spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 16px 8px 8px; border-radius: 50px; box-shadow: var(--shadow-sm);
}
.user-chip .ava {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(150deg, var(--honey), var(--terracotta));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px;
}
.user-chip .meta b { display: block; font-size: 16px; }
.user-chip .meta span { font-size: 13px; color: var(--ink-soft); }

/* ---- Górne duże zakładki (desktop/tablet poziomo) ---- */
.tabs {
  max-width: 1180px; margin: 16px auto 0; padding: 0 22px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.tab {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 50px; min-height: 56px;
  background: var(--paper); border: 1px solid var(--line);
  font-weight: 700; font-size: 16px; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: .18s ease;
}
.tab .ic { font-size: 20px; }
.tab:hover { transform: translateY(-2px); color: var(--ink); border-color: var(--sage-200); }
.tab.active {
  background: linear-gradient(150deg, var(--sage-600), var(--sage-700));
  color: var(--paper); border-color: transparent;
  box-shadow: 0 14px 26px -14px rgba(63,93,76,.7);
}
.tab .badge {
  background: var(--terracotta); color: #fff; font-size: 12px; font-weight: 800;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-grid; place-items: center;
}
.tab.active .badge { background: var(--honey); color: var(--sage-900); }

/* ---- Dolny pasek (tablet/mobile) ---- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(255,253,248,.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: none;
  padding: 8px max(14px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom));
}
.bottomnav-inner { display: flex; justify-content: space-around; max-width: 760px; margin: 0 auto; width: 100%; }
.bnav {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border-radius: 16px; color: var(--ink-faint);
  font-size: 11px; font-weight: 700; min-height: var(--tap);
  position: relative;
}
.bnav .ic { font-size: 24px; }
.bnav.active { color: var(--sage-700); }
.bnav.active .ic {
  background: var(--sage-100); border-radius: 14px; padding: 4px 12px;
}
.bnav .dot {
  position: absolute; top: 6px; right: 22%; width: 9px; height: 9px;
  border-radius: 50%; background: var(--terracotta); border: 2px solid var(--paper);
}

/* ===================== PAGE HEADER ===================== */
.page-head { margin: 30px 0 10px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.page-head .sub { color: var(--ink-soft); font-size: 17px; margin-top: 6px; max-width: 60ch; }
.breadcrumb { font-size: 14px; color: var(--ink-faint); margin-bottom: 6px; font-weight: 600; letter-spacing: .02em; }
.breadcrumb a:hover { color: var(--sage-600); }

/* ===================== KARTY ===================== */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px;
}
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px){ .g-3,.g-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px){ .g-2,.g-3,.g-4 { grid-template-columns: 1fr; } }

/* ===================== ALERT / STAT KARTY (pulpit) ===================== */
.alert-card {
  border-radius: var(--radius-lg); padding: 26px; position: relative; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 8px; min-height: 188px;
  transition: .2s ease;
}
.alert-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.alert-card .ic-bubble {
  width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center;
  font-size: 30px; background: rgba(255,255,255,.55);
}
.alert-card .num { font-family: var(--font-head); font-size: 52px; font-weight: 600; line-height: 1; }
.alert-card .lbl { font-weight: 800; font-size: 17px; }
.alert-card .hint { font-size: 14px; opacity: .8; }
.alert-card .go { margin-top: auto; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.alert-card::after {
  content:''; position: absolute; right: -40px; bottom: -50px;
  width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.28);
}
.ac-danger { background: linear-gradient(155deg, #f6ddd6, #f2cbc0); color: #6e2c22; }
.ac-warn   { background: linear-gradient(155deg, #faeccf, #f5dcae); color: #6a4a14; }
.ac-info   { background: linear-gradient(155deg, #dfecf1, #cbe0e8); color: #2b4a58; }
.ac-money  { background: linear-gradient(155deg, var(--sage-100), var(--sage-200)); color: var(--sage-900); }

/* ===================== PRZYCISKI ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 26px; border-radius: 50px;
  font-family: var(--font-body); font-weight: 800; font-size: 17px;
  border: 1px solid transparent; cursor: pointer; transition: .16s ease;
  background: var(--paper); color: var(--ink); border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(150deg, var(--sage-600), var(--sage-700)); color: var(--paper); border-color: transparent; }
.btn-accent  { background: linear-gradient(150deg, var(--terracotta), var(--clay)); color: #fff; border-color: transparent; }
.btn-ghost   { background: transparent; box-shadow: none; }
.btn-sm { min-height: 48px; padding: 0 20px; font-size: 15px; }
.btn .ic { font-size: 20px; }
.btn-block { width: 100%; }

.action-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* ===================== SKRÓTY (kafelki akcji) ===================== */
.shortcut {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: .18s ease; min-height: 88px;
}
.shortcut:hover { transform: translateY(-3px); border-color: var(--sage-200); box-shadow: var(--shadow); }
.shortcut .ic {
  width: 58px; height: 58px; flex: none; border-radius: 18px; display: grid; place-items: center;
  font-size: 27px; background: var(--sage-50); color: var(--sage-700);
}
.shortcut.hot .ic { background: var(--terracotta-50); color: var(--terracotta); }
.shortcut b { font-size: 18px; display: block; }
.shortcut span { font-size: 14px; color: var(--ink-soft); }

/* ===================== BADGE / PILLS ===================== */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 50px; font-size: 14px; font-weight: 800;
  line-height: 1;
}
.pill .d { width: 9px; height: 9px; border-radius: 50%; }
.pill-ok     { background: var(--ok-bg); color: #2f5a3c; }
.pill-ok .d  { background: var(--ok); }
.pill-warn   { background: var(--warn-bg); color: #7a5615; }
.pill-warn .d{ background: var(--warn); }
.pill-danger { background: var(--danger-bg); color: #7d2b22; }
.pill-danger .d{ background: var(--danger); }
.pill-info   { background: var(--info-bg); color: #2f5163; }
.pill-info .d{ background: var(--info); }
.pill-neutral{ background: var(--cream-2); color: var(--ink-soft); }
.pill-neutral .d{ background: var(--ink-faint); }

/* ===================== MIESZKANIEC — KARTY ===================== */
.resident-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px; transition: .18s ease;
  display: flex; flex-direction: column; gap: 14px;
}
.resident-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage-200); }
.res-top { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 66px; height: 66px; border-radius: 22px; flex: none;
  display: grid; place-items: center; font-family: var(--font-head);
  font-size: 24px; font-weight: 600; color: #fff;
}
.avatar.lg { width: 88px; height: 88px; border-radius: 28px; font-size: 32px; }
.av-1 { background: linear-gradient(150deg, #7aa0e0, #5a78c4); }
.av-2 { background: linear-gradient(150deg, var(--honey), var(--terracotta)); }
.av-3 { background: linear-gradient(150deg, var(--sage-500), var(--sage-700)); }
.av-4 { background: linear-gradient(150deg, #c98aa8, #a85f86); }
.av-5 { background: linear-gradient(150deg, #6fb3ad, #428a83); }
.av-6 { background: linear-gradient(150deg, #d39a6b, #b67340); }
.res-top .name { font-size: 21px; font-weight: 600; font-family: var(--font-head); }
.res-top .room { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.res-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-soft); }
.res-meta b { color: var(--ink); font-weight: 700; }
.res-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ===================== LEK — DUŻE KARTY ===================== */
.med-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  padding: 20px; box-shadow: var(--shadow-sm); display: flex; gap: 16px; align-items: flex-start;
}
.med-card .pillicon {
  width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center;
  font-size: 26px; background: var(--sage-50); color: var(--sage-700);
}
.med-card .mname { font-size: 20px; font-weight: 700; font-family: var(--font-head); }
.med-card .mdose { font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.dose-times { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dose-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 14px; border-radius: 14px; background: var(--cream); border: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 700; color: var(--ink-soft); min-width: 64px;
}
.dose-slot b { font-size: 18px; color: var(--ink); font-family: var(--font-head); }
.dose-slot.on { background: var(--sage-100); border-color: var(--sage-200); color: var(--sage-900); }
.dose-slot.on b { color: var(--sage-900); }

/* ===================== MAGAZYN — KARTY POZYCJI ===================== */
.stock-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: .18s ease;
}
.stock-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stock-card .head { display: flex; gap: 16px; padding: 20px 20px 14px; }
.qr {
  width: 76px; height: 76px; flex: none; border-radius: 16px; padding: 8px;
  background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center;
}
.qr svg { width: 100%; height: 100%; }
.stock-card .mname { font-size: 19px; font-weight: 700; font-family: var(--font-head); }
.stock-card .owner { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.stock-card .body { padding: 0 20px 18px; }
.stock-rows { display: grid; gap: 8px; }
.stock-rows .r { display: flex; justify-content: space-between; font-size: 15px; }
.stock-rows .r span { color: var(--ink-soft); }
.stock-rows .r b { font-weight: 700; }
.stock-card .foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--paper-2); display: flex; justify-content: space-between; align-items: center; }

/* pasek zapasu */
.gauge { height: 12px; border-radius: 50px; background: var(--cream-2); overflow: hidden; margin-top: 10px; }
.gauge i { display: block; height: 100%; border-radius: 50px; }
.gauge.ok i { background: var(--ok); }
.gauge.warn i { background: var(--warn); }
.gauge.danger i { background: var(--danger); }

/* ===================== ZAMÓWIENIA — wiersze z przełącznikiem ===================== */
.order-line {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); transition: .15s ease;
}
.order-line.sel { border-color: var(--sage-500); background: var(--sage-50); }
.order-line .grow { flex: 1; min-width: 0; }
.order-line .mname { font-weight: 700; font-size: 18px; }
.order-line .who { font-size: 14px; color: var(--ink-soft); }

/* duży checkbox / toggle */
.bigcheck { position: relative; width: 40px; height: 40px; flex: none; cursor: pointer; }
.bigcheck input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bigcheck .box {
  width: 40px; height: 40px; border-radius: 13px; border: 2.5px solid var(--sage-400);
  background: var(--paper); display: grid; place-items: center; transition: .15s ease;
  color: transparent; font-size: 22px; font-weight: 900;
}
.bigcheck input:checked + .box { background: var(--sage-600); border-color: var(--sage-600); color: #fff; }

.toggle { position: relative; width: 64px; height: 36px; flex: none; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  width: 64px; height: 36px; border-radius: 50px; background: var(--cream-2);
  transition: .18s ease; border: 1px solid var(--line);
}
.toggle .track::after {
  content:''; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .18s ease;
}
.toggle input:checked + .track { background: var(--sage-600); border-color: var(--sage-600); }
.toggle input:checked + .track::after { transform: translateX(28px); }

/* koszyk pływający */
.cart-bar {
  position: sticky; bottom: 16px; z-index: 30; margin-top: 24px;
  background: linear-gradient(150deg, var(--sage-700), var(--sage-900)); color: var(--paper);
  border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.cart-bar .big { font-family: var(--font-head); font-size: 26px; font-weight: 600; }
.cart-bar .lbl { font-size: 14px; opacity: .8; }

/* ===================== TABELE (gdy potrzebne, lekkie) ===================== */
.softtable { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.softtable th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding: 0 18px; font-weight: 800; }
.softtable td { background: var(--paper); padding: 18px; font-size: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.softtable td:first-child { border-left: 1px solid var(--line); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.softtable td:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.softtable tr { box-shadow: var(--shadow-sm); }

/* ===================== RECEPTY / PERSON CHIPS ===================== */
.person-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 7px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 50px; font-weight: 700; font-size: 14px;
}
.person-chip .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }

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

/* ===================== ROZLICZENIA ===================== */
.balance-strong { font-family: var(--font-head); font-size: 22px; font-weight: 600; }
.amount-due { color: var(--clay); }
.amount-ok { color: var(--ok); }

/* ===================== SKANER ===================== */
.scanner-wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: start; }
@media (max-width: 880px){ .scanner-wrap { grid-template-columns: 1fr; } }

.scanview {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #33453a 0%, #1f2c25 70%);
  min-height: 460px; box-shadow: var(--shadow-lg); display: grid; place-items: center;
  border: 1px solid #2c3a31;
}
.scan-frame {
  width: 64%; aspect-ratio: 1; border-radius: 28px; position: relative;
}
.scan-frame .corner { position: absolute; width: 46px; height: 46px; border: 5px solid var(--honey); }
.scan-frame .tl { top:0; left:0; border-right:0; border-bottom:0; border-radius: 22px 0 0 0; }
.scan-frame .tr { top:0; right:0; border-left:0; border-bottom:0; border-radius: 0 22px 0 0; }
.scan-frame .bl { bottom:0; left:0; border-right:0; border-top:0; border-radius: 0 0 0 22px; }
.scan-frame .br { bottom:0; right:0; border-left:0; border-top:0; border-radius: 0 0 22px 0; }
.scan-line {
  position: absolute; left: 6%; right: 6%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--honey), transparent);
  box-shadow: 0 0 18px 4px rgba(224,168,91,.55);
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 8%; } 50% { top: 88%; } }
.scan-qr { width: 42%; opacity: .9; filter: drop-shadow(0 0 12px rgba(0,0,0,.4)); }
.scan-hint {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: #cfe0d2; font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.scan-pulse {
  position: absolute; top: 22px; left: 22px; display: flex; align-items: center; gap: 9px;
  color: #cfe0d2; font-weight: 700; font-size: 14px;
}
.scan-pulse .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--honey); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.8);} }

.confirm-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.confirm-head { background: linear-gradient(150deg, var(--sage-100), var(--sage-200)); padding: 22px; display: flex; align-items: center; gap: 14px; }
.confirm-head .tick { width: 54px; height: 54px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 28px; box-shadow: var(--shadow-sm); }
.confirm-body { padding: 22px; display: grid; gap: 4px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-soft); font-size: 15px; }
.kv .v { font-weight: 800; font-size: 17px; text-align: right; }
.kv .v.big { font-family: var(--font-head); font-size: 21px; font-weight: 600; }

/* ===================== POMOCNICZE ===================== */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 32px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 26px; }
.section-title .ic { color: var(--sage-600); }
.muted { color: var(--ink-soft); }
.tiny { font-size: 13px; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }

.searchbar {
  display: flex; align-items: center; gap: 12px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 50px; padding: 6px 8px 6px 22px;
  box-shadow: var(--shadow-sm); min-height: 60px;
}
.searchbar .ic { font-size: 22px; color: var(--ink-faint); }
.searchbar input { border: 0; background: transparent; outline: none; font-size: 17px; font-family: var(--font-body); flex: 1; color: var(--ink); }
.searchbar input::placeholder { color: var(--ink-faint); }

.filter-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.fchip { padding: 10px 18px; border-radius: 50px; background: var(--paper); border: 1px solid var(--line); font-weight: 700; font-size: 15px; color: var(--ink-soft); cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; gap: 8px; }
.fchip.active { background: var(--sage-700); color: #fff; border-color: transparent; }

/* responsywność nawigacji */
@media (max-width: 760px){
  .tabs { display: none; }
  .bottomnav { display: block; }
  body { padding-bottom: 96px; }
  .user-chip .meta { display: none; }
}

/* delikatne wejście */
.reveal { animation: rise .5s ease both; }
.reveal:nth-child(2){ animation-delay:.05s; }
.reveal:nth-child(3){ animation-delay:.1s; }
.reveal:nth-child(4){ animation-delay:.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

footer.foot { text-align: center; color: var(--ink-faint); font-size: 13px; padding: 30px 0 10px; }

/* ===================== INFO / WSKAZÓWKA ===================== */
.note-tip {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--info-bg); border: 1px solid #cbe0e8; color: #2b4a58;
  border-radius: var(--radius); padding: 18px 22px; margin-top: 16px;
  font-size: 15px; line-height: 1.5; box-shadow: var(--shadow-sm);
}
.note-tip .ic { font-size: 24px; line-height: 1; flex: none; }

/* ===================== ZAMÓWIENIA — grupy mieszkańców ===================== */
.order-group { margin-bottom: 18px; }
.order-group > .gh {
  display: flex; align-items: center; gap: 12px; padding: 6px 4px 12px;
  font-family: var(--font-head); font-size: 19px; font-weight: 600;
}
.order-group > .gh .room { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.order-lines { display: grid; gap: 12px; }

/* ===================== RECEPTY — pakiet (1 recepta = 1 lek) ===================== */
.rx-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); padding: 20px; display: grid; gap: 14px;
}
.rx-card .rx-top { display: flex; align-items: center; gap: 14px; }
.rx-pkg { display: flex; gap: 8px; flex-wrap: wrap; }
.rx-slip {
  border: 1.5px dashed var(--sage-400); border-radius: 14px; background: var(--sage-50);
  padding: 12px 16px; min-width: 150px; flex: 1;
}
.rx-slip.empty { border-color: var(--line); background: var(--cream); color: var(--ink-faint); }
.rx-slip .rx-num { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); }
.rx-slip b { font-size: 16px; }

/* ===================== ROZLICZENIA — paski kwot ===================== */
.bill-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow-sm); padding: 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.bill-card .grow { flex: 1; min-width: 200px; }
.split-bar { display: flex; height: 16px; border-radius: 50px; overflow: hidden; margin-top: 10px; background: var(--cream-2); }
.split-bar .dps { background: var(--sage-500); }
.split-bar .fam { background: var(--honey); }
.split-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.split-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.bigamount { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1; }

/* ===================== FORMULARZE (skanowanie / potwierdzenie) ===================== */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: 14px; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 58px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; font-weight: 600; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--sage-500); box-shadow: 0 0 0 4px var(--sage-50); }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.two label { grid-column: 1 / -1; }
