@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700,800|Caveat:600");
/* Wygląd nawiązuje do binduga.pl: ciemny pasek #18191B, grafit #789, akcent #ff4081, krój Raleway */
:root {
  --dark: #18191B; --slate: #789; --pink: #ff4081; --pink-d: #e0306f;
  --bg: #f2f3f5; --card: #fff; --ink: #2a2c30; --muted: #6b7280; --line: #dfe2e7; --ok: #1f8a5b; --err: #c0392b; --soft: #fff0f5;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Raleway", system-ui, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--pink-d); }

/* pasek górny */
.nav { background: var(--dark); }
.nav .in { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav img { height: 38px; display: block; }
.nav a.site { color: #cdd3da; text-decoration: none; font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; border: 1px solid #4a4e55; padding: 6px 12px; border-radius: 3px; }
.nav a.site:hover { background: var(--pink); border-color: var(--pink); color: #fff; }

/* nagłówek ze zdjęciem */
.hero { background: linear-gradient(rgba(24,25,27,.55), rgba(24,25,27,.8)), url(/img/hero.jpg) center/cover; color: #fff; text-align: center; padding: 56px 16px 64px; }
.hero .kicker { font-family: "Caveat", cursive; font-size: 1.7rem; color: #ffb3cb; margin: 0; }
.hero h1 { margin: 4px 0 6px; font-weight: 800; font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.15; letter-spacing: .01em; }
.hero .meta { font-size: 1.05rem; color: #e8ebef; }
.hero .meta b { font-weight: 700; }
.pill { display: inline-block; margin-top: 14px; background: var(--pink); color: #fff; padding: 5px 16px; border-radius: 99px; font-weight: 700; font-size: .85rem; letter-spacing: .04em; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px 70px; }
.wide { max-width: 1200px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px; margin: -34px 0 18px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.card.flat { margin-top: 18px; box-shadow: none; }
.card h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; }
.muted { color: var(--muted); font-size: .92rem; }
.hint { margin: 0 0 14px; }

label { display: block; font-weight: 700; font-size: .85rem; margin: 10px 0 4px; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: -1px; border-color: var(--pink); }
input:disabled, select:disabled { background: #f0f1f3; color: #555; }

button, .btn { font: inherit; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; cursor: pointer; border: 2px solid var(--dark); background: transparent; color: var(--dark); padding: 10px 20px; border-radius: 3px; text-decoration: none; display: inline-block; transition: .15s; }
button:hover, .btn:hover { background: var(--dark); color: #fff; }
button.primary, .btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--pink-d); border-color: var(--pink-d); }
button.small { padding: 5px 11px; font-size: .75rem; }
button.danger { border-color: var(--err); color: var(--err); }
button.danger:hover { background: var(--err); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

.msg { padding: 10px 14px; border-radius: 4px; margin: 12px 0; font-weight: 600; font-size: .93rem; }
.msg.ok { background: #e7f6ee; color: var(--ok); border: 1px solid #b9e3cd; }
.msg.err { background: #fdecea; color: var(--err); border: 1px solid #f3c2bc; }
.banner { background: var(--soft); border: 1px solid #ffc2d6; padding: 10px 14px; border-radius: 4px; margin: 14px 0; }

/* arkusz ala Excel */
.sheetwrap { overflow-x: auto; margin-top: 14px; border: 1px solid #c9ced6; border-radius: 3px; }
table.sheet { border-collapse: collapse; width: 100%; min-width: 860px; background: #fff; }
.sheet th { background: var(--dark); color: #fff; font-weight: 700; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; text-align: left; padding: 9px 10px; border-right: 1px solid #3a3d42; }
.sheet td { border: 1px solid #d5d9df; padding: 0; height: 44px; }
.sheet td.n { width: 44px; text-align: center; background: #eef0f3; color: var(--muted); font-weight: 700; font-size: .85rem; }
.sheet td input, .sheet td select { border: 0; border-radius: 0; height: 43px; background: transparent; padding: 0 10px; }
.sheet td input:focus, .sheet td select:focus { outline: 2px solid var(--pink); outline-offset: -2px; background: #fff; }
.sheet tr.locked td { background: #f6f7f9; }
.sheet tr.locked input, .sheet tr.locked select { color: #3b4048; }
.sheet td.st { width: 46px; text-align: center; font-size: 1.05rem; background: #fafbfc; }
.sheet td.st button { border: 0; padding: 0; background: none; color: var(--err); font-size: 1.2rem; text-transform: none; letter-spacing: 0; }
.sheet td.st button:hover { background: none; color: #7a1d12; }
.sheet .lock { color: var(--ok); cursor: help; }
.legend { margin-top: 10px; }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 8px; }
table.data td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: middle; }
table.data td input, table.data td select { padding: 6px 8px; }
.tablewrap { overflow-x: auto; }

/* panel */
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 0; }
.topbar h1 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; margin-bottom: -2px; padding: 10px 16px; }
.tabs button.act { border-bottom-color: var(--pink); color: var(--pink-d); }
.tabs button:hover { background: none; color: var(--pink-d); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--pink); border-radius: 4px; padding: 14px 16px; }
.tile .n { font-size: 1.9rem; font-weight: 800; }
.tile .l { color: var(--muted); font-size: .85rem; }
.bar { height: 8px; background: #e6e8ec; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pink); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input { max-width: 300px; }

.pp { display: grid; grid-template-columns: 1fr; }
.sheet td .pp select, .sheet td .pp input { height: 22px; font-size: .82rem; padding: 0 8px; }
.sheet td:has(.pp) { min-width: 210px; }
.sheet td .pp select:first-child, .sheet td .pp input:first-child { border-bottom: 1px solid #e3e6ea; }
.herotabs { display: inline-flex; gap: 6px; margin-top: 22px; background: rgba(255,255,255,.12); padding: 5px; border-radius: 99px; }
.herotabs button { border: 0; color: #fff; border-radius: 99px; padding: 8px 22px; }
.herotabs button:hover { background: rgba(255,255,255,.2); }
.herotabs button.act { background: var(--pink); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge.none { background: #eceef1; color: #5b6270; }
.badge.declared { background: #fff3cd; color: #8a6500; }
.badge.paid { background: #e0f4ea; color: var(--ok); }
.acc { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #f6f7f9; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; }
.accnum { font-family: "Roboto Mono", ui-monospace, monospace; font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.payrow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); margin: 0; font-weight: 600; cursor: pointer; }
.payrow input { width: 20px; height: 20px; flex: none; }
.payrow .who { flex: 1; }
.payrow.off { color: #7b8190; cursor: default; background: #f6f7f9; }
textarea[readonly] { background: #f6f7f9; font-family: "Roboto Mono", ui-monospace, monospace; font-size: .92rem; }
footer.foot { background: var(--dark); color: #aab0b8; text-align: center; padding: 22px 16px; font-size: .9rem; }
footer.foot a { color: #fff; }

@media (max-width: 600px) {
  html { font-size: 16px; }
  .card { padding: 16px; }
  .hero { padding: 40px 14px 56px; }
}

.paylist { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; margin-bottom: 6px; }

/* drzewo rodzinne */
.treewrap { overflow: auto; padding: 14px 4px 18px; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; max-height: 75vh; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; position: relative; }
.tree ul { padding-top: 22px; }
.tree li { position: relative; padding: 22px 8px 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.tree > li { padding-top: 0; }
.tree ul > li::before, .tree ul > li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid #aab0b8; }
.tree ul > li::after { right: auto; left: 50%; border-left: 2px solid #aab0b8; }
.tree ul > li:only-child::before, .tree ul > li:only-child::after { border-top: 0; }
.tree ul > li:only-child::after { border-left: 2px solid #aab0b8; }
.tree ul > li:first-child::before, .tree ul > li:last-child::after { border: 0; }
.tree ul > li:last-child::before { border-right: 2px solid #aab0b8; border-radius: 0 6px 0 0; }
.tree ul > li:first-child::after { border-radius: 6px 0 0 0; }
.tree ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid #aab0b8; height: 22px; }
.hh { display: inline-flex; gap: 0; position: relative; }
.hh .pcard + .pcard { margin-left: -2px; }
.hh .pcard + .pcard::before { content: '♥'; position: absolute; left: -9px; top: 50%; transform: translateY(-50%); font-size: .7rem; color: var(--pink); }
.pcard { position: relative; min-width: 120px; max-width: 170px; text-transform: none; letter-spacing: 0; font-size: .85rem; padding: 7px 10px; border: 2px solid var(--dark); border-left-width: 6px; background: #fff; color: var(--ink); border-radius: 4px; text-align: left; display: flex; flex-direction: column; margin: 0 6px; }
.pcard:hover { background: #fff0f5; color: var(--ink); }
.pcard .pn { font-weight: 700; line-height: 1.2; }
.pcard .pb { font-size: .72rem; color: var(--muted); font-weight: 600; }
.pcard.hit { outline: 3px solid var(--pink); background: #fff0f5; }
.pcard.b0 { border-left-color: #e6194b; } .pcard.b1 { border-left-color: #3cb44b; } .pcard.b2 { border-left-color: #4363d8; } .pcard.b3 { border-left-color: #f58231; }
.pcard.b4 { border-left-color: #911eb4; } .pcard.b5 { border-left-color: #008080; } .pcard.b6 { border-left-color: #9a6324; } .pcard.bx { border-left-color: #9aa0a6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .pcard { margin: 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 8px; padding: 22px; max-width: 420px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.modal h2 { margin: 0 0 6px; }
