/* Garaz - interfejs mobile-first. Duze pola dotykowe, czytelne liczby. */

:root {
  --tlo: #f6f7f5;
  --powierzchnia: #ffffff;
  --powierzchnia-2: #eef0ec;
  --obrys: #d9ddd6;
  --tekst: #1d2320;
  --tekst-slaby: #6b736c;
  --akcent: #2f6f4e;
  --akcent-jasny: #e6f0ea;
  --ostrzezenie: #b06e12;
  --ostrzezenie-tlo: #fdf3e2;
  --blad: #b03030;
  --blad-tlo: #fbeaea;
  --cien: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 12px rgba(20, 30, 25, .05);
  --promien: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tlo: #14181a;
    --powierzchnia: #1c2124;
    --powierzchnia-2: #262c30;
    --obrys: #333b40;
    --tekst: #e8ecea;
    --tekst-slaby: #99a3a0;
    --akcent: #4f9f74;
    --akcent-jasny: #1e2f28;
    --ostrzezenie: #d9a04a;
    --ostrzezenie-tlo: #2e2717;
    --blad: #e0736c;
    --blad-tlo: #33201f;
    --cien: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tlo);
  color: var(--tekst);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 88px;
}

a { color: var(--akcent); text-decoration: none; }
a:hover { text-decoration: underline; }

.zawartosc { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* --- naglowek --- */
.gora {
  position: sticky; top: 0; z-index: 30;
  background: var(--powierzchnia);
  border-bottom: 1px solid var(--obrys);
}
.gora-wnetrze {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.logo { font-weight: 700; letter-spacing: .02em; color: var(--tekst); font-size: 18px; }
.logo span { color: var(--akcent); }
.menu { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.menu a {
  color: var(--tekst-slaby); padding: 7px 11px; border-radius: 8px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.menu a:hover { background: var(--powierzchnia-2); text-decoration: none; }
.menu a.aktywny { background: var(--akcent-jasny); color: var(--akcent); }

@media (max-width: 720px) {
  .menu { display: none; }
}

/* --- dolny pasek na telefonie --- */
.dol {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--powierzchnia); border-top: 1px solid var(--obrys);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
@media (max-width: 720px) { .dol { display: flex; } }
.dol a {
  flex: 1; text-align: center; font-size: 11px; color: var(--tekst-slaby);
  padding: 6px 2px; border-radius: 8px; line-height: 1.3;
}
.dol a b { display: block; font-size: 17px; font-weight: 600; }
.dol a.aktywny { color: var(--akcent); background: var(--akcent-jasny); }

/* --- karty --- */
.karta {
  background: var(--powierzchnia); border: 1px solid var(--obrys);
  border-radius: var(--promien); box-shadow: var(--cien);
  padding: 16px; margin-bottom: 14px;
}
.karta.zwarta { padding: 12px; }
.karta h2, .karta h3 { margin: 0 0 12px; font-size: 16px; letter-spacing: .01em; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 18px; }

.siatka { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.siatka-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .siatka-2 { grid-template-columns: 1fr; } }

/* --- kafle liczbowe --- */
.kafle { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kafel { background: var(--powierzchnia-2); border-radius: 10px; padding: 12px; }
.kafel .etykieta { font-size: 12px; color: var(--tekst-slaby); text-transform: uppercase; letter-spacing: .04em; }
.kafel .liczba { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kafel .pod { font-size: 12px; color: var(--tekst-slaby); margin-top: 2px; }

/* --- pasek auta --- */
.auto-pasek { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.znacznik { width: 10px; height: 34px; border-radius: 5px; flex: 0 0 auto; }
.auto-pasek .nazwa { font-weight: 650; font-size: 17px; }
.auto-pasek .opis { font-size: 13px; color: var(--tekst-slaby); }

/* --- tabele --- */
.tabela-oplot { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--tekst-slaby); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--obrys); white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--obrys); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.liczbowa, th.liczbowa { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--powierzchnia-2); }

/* --- lista wpisow na telefonie --- */
.wpis {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 4px; border-bottom: 1px solid var(--obrys);
}
.wpis:last-child { border-bottom: 0; }
.wpis .srodek { flex: 1; min-width: 0; }
.wpis .tytul { font-weight: 550; }
.wpis .meta { font-size: 13px; color: var(--tekst-slaby); margin-top: 2px; }
.wpis .kwota { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- formularze --- */
label { display: block; font-size: 13px; color: var(--tekst-slaby); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--tekst);
  background: var(--powierzchnia); border: 1px solid var(--obrys);
  border-radius: 10px; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akcent); outline-offset: -1px; border-color: var(--akcent);
}
textarea { min-height: 76px; resize: vertical; }
.pole { margin-bottom: 14px; }
.pola { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.przelacznik { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--tekst); }
.przelacznik input { width: 20px; height: 20px; accent-color: var(--akcent); }

/* --- przyciski --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--obrys);
  background: var(--powierzchnia); color: var(--tekst); font-size: 15px; font-weight: 550;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn:hover { background: var(--powierzchnia-2); text-decoration: none; }
.btn.glowny { background: var(--akcent); border-color: var(--akcent); color: #fff; }
.btn.glowny:hover { filter: brightness(1.08); }
.btn.niebezpieczny { color: var(--blad); border-color: var(--blad); background: transparent; }
.btn.maly { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.pelny { width: 100%; }
.przyciski { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- plywajacy przycisk dodawania --- */
.fab {
  position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--akcent); color: #fff; font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(30, 80, 55, .35); border: 0;
}
.fab:hover { text-decoration: none; filter: brightness(1.08); }
@media (min-width: 721px) { .fab { bottom: 24px; } }

/* --- plakietki --- */
.plakietka {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--powierzchnia-2); color: var(--tekst-slaby);
  white-space: nowrap;
}
.plakietka.ja { background: var(--akcent-jasny); color: var(--akcent); }
.plakietka.spolka { background: #e5ecf7; color: #2a5599; }
.plakietka.mama { background: #f6e9f2; color: #8a4079; }
.plakietka.pilne, .plakietka.po-terminie { background: var(--blad-tlo); color: var(--blad); }
.plakietka.wkrotce { background: var(--ostrzezenie-tlo); color: var(--ostrzezenie); }
@media (prefers-color-scheme: dark) {
  .plakietka.spolka { background: #1c2838; color: #8ab0e8; }
  .plakietka.mama { background: #2f2030; color: #d79bc8; }
}

/* --- komunikaty --- */
.komunikat {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 15px;
  border: 1px solid transparent;
}
.komunikat.ok { background: var(--akcent-jasny); color: var(--akcent); border-color: var(--akcent); }
.komunikat.blad { background: var(--blad-tlo); color: var(--blad); border-color: var(--blad); }
.komunikat.uwaga { background: var(--ostrzezenie-tlo); color: var(--ostrzezenie); border-color: var(--ostrzezenie); }

/* --- terminy --- */
.termin { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--obrys); }
.termin:last-child { border-bottom: 0; }
.termin .kropka { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: 0 0 auto; background: var(--tekst-slaby); }
.termin.po-terminie .kropka, .termin.pilne .kropka { background: var(--blad); }
.termin.wkrotce .kropka { background: var(--ostrzezenie); }
.termin .tresc { flex: 1; }
.termin .czas { font-size: 13px; color: var(--tekst-slaby); white-space: nowrap; }

/* --- pomocnicze --- */
.slaby { color: var(--tekst-slaby); }
.male { font-size: 13px; }
.prawo { text-align: right; }
.rozdziel { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pusto { text-align: center; padding: 32px 16px; color: var(--tekst-slaby); }
hr { border: 0; border-top: 1px solid var(--obrys); margin: 16px 0; }

/* --- wykresy --- */
.wykres { width: 100%; height: 220px; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.legenda span { display: flex; align-items: center; gap: 6px; }
.legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* --- pasek udzialu --- */
.udzial { height: 8px; border-radius: 4px; background: var(--powierzchnia-2); overflow: hidden; margin-top: 6px; }
.udzial > div { height: 100%; background: var(--akcent); }
