/* Rozwój+ — narzędzie stowarzyszenia. Paleta i typografia 1:1 z rozwoj.plus
   (krem #f4efe6, czerwień #c8102e, grafit #23262b, Poppins + Source Serif 4). */
:root {
    --navy: #23262b;      /* grafit — nazwy zmiennych historyczne */
    --navy-2: #c8102e;    /* czerwień akcentowa */
    --red: #c8102e;
    --red-d: #a50d26;
    --cream2: #ede6d9;
    --bg: #f4efe6;
    --card: #ffffff;
    --ink: #23262b;
    --muted: #6b6560;
    --line: #e2dacc;
    --ok: #178a52;
    --radius: 12px;
}
* { box-sizing: border-box; margin: 0; }
body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    padding-bottom: 76px; /* miejsce na bottomnav */
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 26px; padding-bottom: 40px; }
/* Tablica i formularze czytają się najlepiej w kolumnie ~720px, wyśrodkowanej
   w szerokim wrapie — reszta stron (struktura, składki) korzysta z pełnej szerokości. */
.feedwrap, .authcard { max-width: 720px; margin-left: auto; margin-right: auto; }

/* Tablica 3-kolumnowa jak Twitter (desktop) */
.feedgrid { display: grid; grid-template-columns: 270px minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.feedgrid .feedwrap { max-width: 720px; width: 100%; }
.sidecol { position: sticky; top: calc(74px + env(safe-area-inset-top)); display: grid; gap: 0; }
.sidecard { padding: 16px 18px; }
.sidecard h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.sidecard--me { display: flex; align-items: center; gap: 12px; }
.sidecard--me > div { flex: 1; min-width: 0; }
.sidecard--accent { border-color: var(--red); background: #fbf0ee; }
.siderow { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.siderow:last-of-type { border-bottom: none; }
.siderow > div { min-width: 0; }
.sideclamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidemore { font-size: 13px; font-weight: 700; text-decoration: none; display: inline-block; margin-top: 6px; }
.sideok { color: var(--ok); font-weight: 700; }
.sidewarn { color: var(--red); font-weight: 700; }
@media (max-width: 1120px) { .feedgrid { grid-template-columns: minmax(0, 1fr) 300px; } .sidecol--left { display: none; } }
@media (max-width: 900px) { .feedgrid { grid-template-columns: minmax(0, 1fr); } .sidecol { display: none; } }
a { color: var(--navy-2); }

.demo-ribbon {
    background: var(--cream2); color: var(--muted); text-align: center;
    font-size: 12px; font-weight: 700; padding: 4px 8px; letter-spacing: .02em;
    border-bottom: 1px solid var(--line);
}

/* Topbar */
.topbar {
    /* jak na rozwoj.plus: kremowy sticky header z blurem i linią */
    background: rgba(244, 239, 230, .95); backdrop-filter: blur(8px);
    color: var(--ink); position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid var(--line);
    /* iOS standalone (black-translucent): treść wchodzi pod zegar/notch —
       header musi sam zrobić sobie miejsce na systemowy pasek. */
    padding-top: env(safe-area-inset-top);
}
.topbar__inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { font-weight: 800; font-size: 22px; color: var(--ink); text-decoration: none; }
.brand span { color: var(--red); }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
    color: #3a3e45; text-decoration: none; font-weight: 600; font-size: 14px;
    padding: 7px 13px; border-radius: 999px;
}
.topnav a:hover { background: var(--cream2); }
.topnav a.on { color: #fff; background: var(--red); }
.topbar__user { display: flex; align-items: center; gap: 12px; margin-left: auto; } /* na mobile topnav znika — auto-margin trzyma ikony przy prawej */
.hamburger { color: var(--ink); font-size: 24px; } /* zawsze widoczny — drawer trzyma dane usera i wylogowanie */

/* Bottom nav (mobile, app-like) */
.bottomnav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
}
.bottomnav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.bottomnav a span { font-size: 20px; }
.bottomnav a.on { color: var(--navy-2); }

/* Cards / feed */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin-bottom: 10px; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.pagetitle { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-size: 26px; margin-bottom: 16px; }
.empty { text-align: center; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; font-weight: 500; }
.err { color: var(--red); font-size: 13px; margin-top: 6px; }
.flash--ok { background: #e5f6ec; color: var(--ok); padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }

.post__head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex: none;
}
.avatar--poll { background: var(--red); }
.post__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.post__body { font-size: 15px; line-height: 1.55; white-space: normal; }
.post--pinned { border-color: #e8c66b; background: #fffdf4; }
.post__foot { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 12px; background: #faf7f1; margin-left: -22px; margin-right: -22px; margin-bottom: -22px; padding-left: 22px; padding-right: 22px; padding-bottom: 14px; border-radius: 0 0 var(--radius) var(--radius); }

.chip {
    display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
    background: #e8edf8; color: var(--navy-2);
}
.chip { background: var(--cream2); color: var(--ink); }
.chip--kraj { background: var(--ink); color: #fff; }
.chip--wojewodztwo { background: #e9dfc9; color: #6b5a2a; }
.chip--powiat { background: #e6efe0; color: #1c6b3c; }
.chip--kolo { background: #f7e3e0; color: var(--red-d); }

/* Komentarze — dymki jak na FB, wyraźnie oddzielone od treści posta */
.comments__label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.comment { display: flex; gap: 8px; margin: 8px 0; font-size: 14px; align-items: flex-start; }
.comment__bubble { background: var(--cream2); border-radius: 4px 14px 14px 14px; padding: 8px 12px; flex: 1; min-width: 0; }
.comment__who { font-weight: 800; font-size: 13px; display: block; margin-bottom: 1px; }
.comment__at { color: var(--muted); font-size: 11px; display: block; margin-top: 3px; }
.commentform { display: flex; gap: 8px; margin-top: 10px; }
.commentform input { flex: 1; }

/* Composer */
.composer textarea, .pollform textarea, .pollform input, textarea { width: 100%; }
textarea, input, select {
    font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--ink);
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--navy-2); border-color: transparent; }
.composer__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer__actions { display: flex; gap: 8px; }
.composer__scope { font-size: 13px; color: var(--muted); }
.pollform { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }

/* Buttons */
.btn {
    font: inherit; font-weight: 700; border: none; border-radius: 10px; cursor: pointer;
    padding: 9px 16px; font-size: 14px;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-d); }
.btn--ghost { background: var(--cream2); color: var(--ink); }
.btn--ghost:hover { background: #e3dbcb; }
.btn--danger { background: #f7e3e0; color: var(--red); }
.btn--sm { padding: 5px 11px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }

/* Poll */
.poll__options { display: grid; gap: 6px; margin: 10px 0; }
.poll__vote {
    font: inherit; text-align: left; padding: 10px 12px; border: 1.5px solid var(--navy-2);
    background: #fff; color: var(--navy-2); border-radius: 10px; cursor: pointer; font-weight: 600;
}
.poll__vote:hover { background: #eaf0fc; }
.poll__result { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; overflow: hidden; }
.poll__result--mine { border-color: var(--navy-2); }
.poll__bar { position: absolute; inset: 0 auto 0 0; background: #f0d9cf; z-index: 0; }
.poll__label { position: relative; z-index: 1; font-weight: 600; }
.poll__pct { position: relative; z-index: 1; float: right; color: var(--muted); font-size: 13px; }

/* Structure */
.unitrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.unitrow__main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.unitrow__coord { font-size: 12px; color: var(--muted); }
.unitrow__coord--vacant { color: var(--red); font-weight: 700; }
.unitrow__actions { display: flex; gap: 6px; }
.inlineform { display: flex; gap: 8px; padding: 8px 0; flex-wrap: wrap; align-items: center; }

/* Members */
.memberrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.memberrow__main { flex: 1; min-width: 0; }
.memberrow__main .muted { display: block; }
.memberrow__actions { display: flex; gap: 6px; flex: none; }
.memberrow--off { opacity: .55; }
.search { max-width: 220px; }

/* Dues */
.duesmine { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.duespill { border-radius: 10px; padding: 8px 12px; font-size: 12px; text-align: center; }
.duespill strong { display: block; font-size: 13px; }
.duespill--paid { background: #e5f6ec; color: var(--ok); }
.duespill--due { background: #fdeaea; color: var(--red); }
.tablescroll { overflow-x: auto; }
.duestable { border-collapse: collapse; width: 100%; font-size: 13px; }
.duestable th, .duestable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.duestable td:first-child, .duestable th:first-child { text-align: left; }
.duescell {
    width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; cursor: pointer; font-weight: 800; color: var(--muted);
}
.duescell--paid { background: #e5f6ec; color: var(--ok); border-color: #bfe6cf; }

/* Studio */
.bannergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bannercard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bannercard img { width: 100%; display: block; }
.bannercard figcaption { padding: 10px 12px; font-size: 13px; }

/* Auth */
.authcard { max-width: 420px; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.authcard h1 { font-size: 22px; margin-bottom: 14px; }
.authcard form { display: grid; gap: 12px; }
.authcard label { font-size: 13px; font-weight: 700; display: grid; gap: 5px; }
.authcard__alt { margin-top: 14px; font-size: 14px; text-align: center; }
.demo-hint { margin-top: 18px; background: var(--cream2); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.demo-hint code { background: #e3dbcb; padding: 0 5px; border-radius: 5px; }

/* Mobile */
@media (max-width: 860px) {
    .topnav { display: none; }
    .bottomnav { display: flex; }
    .duestable { font-size: 12px; }
    .card { padding: 16px; }
    .wrap { padding: 0 14px; }
}

/* Drawer (hamburger) */
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); z-index: 80;
    background: #fff; box-shadow: -12px 0 40px rgba(10,20,50,.25);
    display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
}
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,16,35,.5); z-index: 70; }
/* display:flex/grid wygrywa z atrybutem hidden — przywracamy mu moc. */
.drawer[hidden], .drawer-backdrop[hidden], .installbar[hidden] { display: none; }
.drawer__head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer__nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; }
.drawer__nav a { padding: 13px 8px; font-weight: 700; text-decoration: none; color: var(--ink); border-radius: 10px; }
.drawer__nav a:hover { background: var(--bg); }
.drawer__foot { border-top: 1px solid var(--line); padding-top: 12px; }
body.drawer-open { overflow: hidden; }

/* Profile / awatary */
.avatar--img { border-radius: 50%; object-fit: cover; display: block; }
.avlink { text-decoration: none; flex: none; }
.namelink { color: var(--ink); text-decoration: none; }
.namelink:hover { color: var(--navy-2); text-decoration: underline; }
.profilehead { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.profilehead__main { flex: 1; min-width: 220px; }
.profilehead h1 { font-size: 24px; margin-bottom: 4px; }
.profilehead__bio { margin: 10px 0; background: var(--cream2); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.profileform { display: grid; gap: 12px; max-width: 560px; }
.profileform label { font-size: 13px; font-weight: 700; display: grid; gap: 5px; }
.profileform__avatar { display: flex; gap: 16px; align-items: center; }
.avupload { display: inline-block; cursor: pointer; }

.iconbtn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }

/* Ekran blokady PIN */
.lockcard { text-align: center; }
.lockcard .avatar--lock { width: 64px; height: 64px; font-size: 28px; margin: 0 auto 12px; background: var(--navy); }
.pininput {
    width: 100%; text-align: center; font-size: 30px; letter-spacing: 14px;
    padding: 12px; font-weight: 800;
}

/* Baner auto-instalacji PWA */
.installbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px;
    display: flex; align-items: center; gap: 12px; z-index: 60;
    box-shadow: 0 8px 30px rgba(10, 20, 50, .35);
}
.installbar p { flex: 1; font-size: 13px; line-height: 1.35; margin: 0; }
.installbar .btn--primary { background: var(--red); }
@media (min-width: 721px) { .installbar { max-width: 420px; left: auto; right: 20px; bottom: 20px; } }

/* ── v0.5.0: warstwa wow ─────────────────────────────────────── */

/* Hero na tablicy */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(120deg, #fff 55%, #fbf3ea); }
.hero__hi { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-size: 24px; }
.hero__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.hero__growth { text-align: right; }
.hero__growth svg { width: 120px; height: 36px; display: block; margin-left: auto; }
.hero__delta { font-size: 12px; font-weight: 800; color: var(--red); }

/* Karty wydarzeń */
.eventcard { display: flex; gap: 16px; border-left: 4px solid var(--red); }
.eventcard__date { flex: none; width: 58px; height: 62px; background: var(--ink); color: #fff;
    border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.eventcard__date--sm { width: 42px; height: 46px; border-radius: 10px; }
.eventcard__day { font-size: 22px; font-weight: 800; line-height: 1; }
.eventcard__date--sm .eventcard__day { font-size: 16px; }
.eventcard__mon { font-size: 11px; text-transform: uppercase; color: #d9b6ba; }
.eventcard__main { flex: 1; min-width: 0; }
.eventcard__title { font-size: 17px; }
.eventcard__rsvp { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.eventcard__faces { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.eventcard__faces .avatar { border: 2px solid #fff; margin-left: -6px; }

/* Mikrointerakcje i animacje */
.card { transition: transform .18s ease, box-shadow .18s ease; }
.feedwrap .post:hover, .feedwrap .poll:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(35, 38, 43, .09); }
.btn { transition: transform .12s ease, background .15s ease; }
.btn:active { transform: scale(.96); }
.poll__bar { transition: width .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.feedwrap .card, .sidecol .card { animation: fadeUp .35s ease both; }
.feedwrap .card:nth-child(2) { animation-delay: .04s; }
.feedwrap .card:nth-child(3) { animation-delay: .08s; }
.feedwrap .card:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Obrączki ról na awatarach (koordynator/zarząd) */
.avlink { position: relative; display: inline-block; }
.avatar { box-shadow: 0 0 0 0 transparent; }
.role-koordynator > .avatar, .role-koordynator > img.avatar { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--red); }
.role-admin > .avatar, .role-admin > img.avatar { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--ink); }

/* Split logowania */
.authsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; max-width: 980px; margin: 30px auto; }
.authsplit .authcard { margin: 0; width: 100%; }
.authhero__brand { font-size: 30px; font-weight: 800; }
.authhero__brand span { color: var(--red); }
.authhero__tag { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-size: 42px; line-height: 1.12; margin: 14px 0 12px;
    background: linear-gradient(100deg, var(--ink) 60%, var(--red)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.authhero__sub { color: var(--muted); font-size: 15px; max-width: 400px; }
.authhero__feats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 9px; font-weight: 600; font-size: 14px; }
@media (max-width: 860px) { .authsplit { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; } .authhero { text-align: center; }
    .authhero__tag { font-size: 30px; } .authhero__feats { display: none; } .authhero__sub { margin: 0 auto; } }

.audittable td { text-align: left; }
