:root {
  --bni-czarny: #111111;
  --bni-czerwony: #d42027;
  --tlo: #f4f4f2;
  --powierzchnia: #ffffff;
  --tekst: #1a1a1a;
  --tekst-wyciszony: #6b6b6b;
  --linia: #e4e2dd;
  --zielony: #1d9e75;
  --zielony-tlo: #e1f5ee;
  --bursztyn: #ba7517;
  --bursztyn-tlo: #faeeda;
  --czerwony-tlo: #fcebeb;
  --niebieski-tlo: #e6f1fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--tlo);
  color: var(--tekst);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  min-height: 100vh;
}

.card {
  background: var(--powierzchnia);
  border-radius: 16px;
  border: 1px solid var(--linia);
  padding: 24px 20px;
}

.center-card {
  text-align: center;
  margin-top: 20vh;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bni-czerwony);
}

h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--bni-czarny);
}

.muted {
  color: var(--tekst-wyciszony);
  font-size: 14px;
  margin: 0 0 16px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--linia);
  background: var(--tlo);
  color: var(--tekst);
  margin-bottom: 12px;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--bni-czerwony);
}

.lista {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}

.osoba {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--tekst);
  cursor: pointer;
}
.osoba:hover { background: var(--tlo); }
.osoba--zameldowana { background: var(--zielony-tlo); }
.osoba--zameldowana:hover { background: var(--zielony-tlo); }

.osoba-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.osoba-avatar--inicjaly {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bni-czarny);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.osoba-nazwa { flex: 1; }

.osoba-check {
  color: var(--zielony);
  font-weight: 700;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  background: var(--bni-czerwony);
  color: #fff;
  cursor: pointer;
  flex: 1;
}
.btn:active { opacity: 0.85; }
.btn-outline {
  background: transparent;
  color: var(--bni-czarny);
  border: 1px solid var(--linia);
}
.btn-ghost {
  background: transparent;
  color: var(--tekst-wyciszony);
  border: none;
}

.modal-tlo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}
.modal-tlo[hidden] {
  display: none;
}
.modal {
  background: var(--powierzchnia);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
}
.modal-nazwa {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}
.modal-pytanie {
  font-size: 14px;
  color: var(--tekst-wyciszony);
  margin: 0 0 12px;
}
.modal-przyciski {
  display: flex;
  gap: 10px;
}

/* --- Panel admina --- */

.admin-body { background: var(--tlo); }

.topbar {
  background: var(--bni-czarny);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-marka {
  font-weight: 700;
  font-size: 15px;
}
.topbar-marka span { color: var(--bni-czerwony); }
.topbar-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.topbar-nav a {
  color: #d8d8d6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}
.topbar-nav a:hover, .topbar-nav a.aktywny {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.topbar-wyloguj {
  color: #d8d8d6;
  font-size: 13px;
  text-decoration: none;
}

.admin-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.admin-naglowek {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-naglowek h1 { font-size: 20px; margin: 0; }

.statystyki-rzad {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-kafelek {
  background: var(--powierzchnia);
  border: 1px solid var(--linia);
  border-radius: 12px;
  padding: 16px;
}
.stat-kafelek .label {
  font-size: 12px;
  color: var(--tekst-wyciszony);
  margin: 0 0 4px;
}
.stat-kafelek .wartosc {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--powierzchnia);
  border: 1px solid var(--linia);
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--linia);
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tekst-wyciszony);
  background: var(--tlo);
}
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
}
.badge-obecny { background: var(--zielony-tlo); color: var(--zielony); }
.badge-zastepstwo { background: var(--niebieski-tlo); color: #185fa5; }
.badge-medical { background: var(--czerwony-tlo); color: var(--bni-czerwony); }
.badge-nieobecnosc { background: #ececec; color: var(--tekst-wyciszony); }
.badge-brak { background: var(--bursztyn-tlo); color: var(--bursztyn); }

select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--linia);
  background: var(--powierzchnia);
}

.karta-formularz {
  background: var(--powierzchnia);
  border: 1px solid var(--linia);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 12px;
}
label:first-child { margin-top: 0; }

.avatar-podglad {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bni-czarny);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.blad {
  background: var(--czerwony-tlo);
  color: var(--bni-czerwony);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.sukces {
  background: var(--zielony-tlo);
  color: var(--zielony);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.link-akcja {
  color: var(--bni-czerwony);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.pusto {
  color: var(--tekst-wyciszony);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}
