/* PM Boxing Studio CRM — dark, gold used sparingly */
:root {
  --ink: #1c1c1c;
  --ink-2: #242424;
  --ink-3: #2d2d2d;
  --line: #363636;
  --paper: #ece9e2;
  --muted: #9a968c;
  --gold: #ccba78;
  --gold-soft: rgba(204, 186, 120, .14);
  --ok: #7faf8a;
  --ok-soft: rgba(127, 175, 138, .16);
  --bad: #c9776b;
  --bad-soft: rgba(201, 119, 107, .16);
  --warn: #d9925a;
  --warn-soft: rgba(217, 146, 90, .14);
  --display: Futura, "Futura PT", "Century Gothic", "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-s: 6px;
  --r-m: 10px;
  --tap: 44px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 15px/1.5 var(--body); font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: .01em; line-height: 1.2; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; margin-bottom: 12px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── shell ── */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; background: var(--ink);
}
.rail .logo { display: block; padding: 4px 8px 22px; }
.rail .logo img { width: 150px; height: auto; display: block; }
.rail a.nav {
  display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-s);
  text-decoration: none; color: var(--muted);
}
.rail a.nav:hover { color: var(--paper); background: var(--ink-2); }
.rail a.nav.on { color: var(--paper); background: var(--ink-2); box-shadow: inset 3px 0 0 var(--gold); }
.rail .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.rail .me { margin-top: auto; padding: 12px 8px 0; font-size: 13px; color: var(--muted); }
.rail .me form { display: inline; }
.main { padding: 24px 32px 80px; max-width: 1180px; width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .rail { display: none; }
  .main { padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
    background: rgba(28, 28, 28, .96); backdrop-filter: blur(8px);
  }
  .topbar img { height: 34px; width: auto; display: block; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(28, 28, 28, .98); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 58px; text-decoration: none; color: var(--muted); font-size: 12px;
  }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--gold); }
  h1 { font-size: 22px; }
}

/* ── page header ── */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.pager { display: flex; align-items: center; gap: 6px; }
.pager a, .pager span { min-height: 38px; display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-s); text-decoration: none; }
.pager a:hover { border-color: var(--muted); }
.pager .cur { border-color: transparent; color: var(--muted); }

/* ── buttons & forms ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--ink-2); color: var(--paper);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 0 8px; }
.btn.quiet:hover { color: var(--paper); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 8px 10px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--ink-2); color: var(--paper); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--gold); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 10px; color: var(--paper); font-size: 15px; min-height: var(--tap); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.field { margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; margin: 0 0 16px; }
legend { padding: 0 6px; color: var(--muted); font-size: 13px; }

/* ── flash / toasts ── */
.flash { padding: 10px 14px; border-radius: var(--r-s); margin-bottom: 12px; border-left: 3px solid; background: var(--ink-2); }
.flash.ok { border-color: var(--ok); }
.flash.error { border-color: var(--bad); }
.flash.warn { border-color: var(--warn); }
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink-3); border: 1px solid var(--line); padding: 10px 16px; border-radius: var(--r-m);
  max-width: min(92vw, 520px); z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.toast.error { border-color: var(--bad); }
.warnlist { list-style: none; padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--warn); border-radius: var(--r-m); background: var(--warn-soft); }
.warnlist li { padding: 2px 0; }

/* ── surfaces ── */
.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; margin-bottom: 16px; }
.panel > h2:first-child { margin-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px 0; }

/* ── tags ── */
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: rgba(127, 175, 138, .4); }
.tag.bad { color: var(--bad); border-color: rgba(201, 119, 107, .45); }
.tag.warn { color: var(--warn); border-color: rgba(217, 146, 90, .45); }
.tag.gold { color: var(--gold); border-color: rgba(204, 186, 120, .45); }

/* ── Dzisiaj ── */
.attn { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.attn a { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px; border-radius: var(--r-s);
  background: var(--ink-2); border: 1px solid var(--line); text-decoration: none; }
.attn a b { font-family: var(--display); font-size: 18px; font-weight: 500; }
.attn a.hot { border-color: var(--warn); }
.attn a.hot b { color: var(--warn); }
.attn .clear { color: var(--muted); padding: 8px 0; }

.timeline { position: relative; }
.slot { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.slot:first-child { border-top: 0; }
.slot .time { font-family: var(--display); font-size: 34px; line-height: 1; letter-spacing: -.01em; }
.slot .time small { display: block; font-family: var(--body); font-size: 13px; letter-spacing: 0; margin-top: 6px; }
.slot.past .time { color: var(--muted); }
.slot.cancelled .time, .slot.cancelled .what h3 { text-decoration: line-through; color: var(--muted); }
.slot .what { min-width: 0; }
.slot .what .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.slot .what h3 { font-size: 17px; }
.slot .what h3 a { text-decoration: none; }
.nowline { display: grid; grid-template-columns: 92px 1fr; gap: 0 18px; align-items: center; margin: -1px 0; position: relative; z-index: 2; }
.nowline span { color: var(--gold); font-size: 13px; font-weight: 600; }
.nowline i { height: 2px; background: var(--gold); display: block; }
@media (max-width: 560px) {
  .slot { grid-template-columns: 1fr; gap: 6px; }
  .slot .time { font-size: 28px; display: flex; align-items: baseline; gap: 10px; }
  .slot .time small { margin: 0; }
  .nowline { grid-template-columns: auto 1fr; gap: 10px; }
}

/* participant row */
.people { display: flex; flex-direction: column; gap: 6px; }
.person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 8px 8px 12px; border-radius: var(--r-s); background: var(--ink-2); border: 1px solid var(--line); }
.person .who { min-width: 0; }
.person .who a { text-decoration: none; font-weight: 500; }
.person .who .st { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.person.is-present { border-color: rgba(127, 175, 138, .45); }
.person.is-absent { border-color: rgba(201, 119, 107, .45); }
.person.is-cancelled { opacity: .7; }
.mark { display: flex; gap: 4px; }
.mark button {
  min-width: var(--tap); min-height: var(--tap); padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer;
}
.mark button:hover { color: var(--paper); border-color: var(--muted); }
.mark button.on-present { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.mark button.on-absent { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.mark button[aria-busy=true] { opacity: .5; }
@media (max-width: 420px) { .mark button .lbl { display: none; } }
.addrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--line); background: transparent;
  color: var(--paper); font: inherit; font-size: 14px; cursor: pointer; }
.chip:hover { border-color: var(--gold); border-style: solid; }
.addform { display: flex; gap: 6px; margin-top: 8px; }
.addform input { min-height: 38px; }
.blockrow { color: var(--muted); padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-s); margin-bottom: 10px; font-size: 14px; }

.side h2 { font-size: 15px; margin-bottom: 8px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.side li:last-child { border-bottom: 0; }
.side li a { text-decoration: none; }
.side li .d { color: var(--muted); font-size: 13px; }

/* ── calendar ── */
.calbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.seg a { padding: 0 12px; min-height: 38px; display: inline-flex; align-items: center; text-decoration: none; color: var(--muted); }
.seg a.on { background: var(--ink-3); color: var(--paper); }
.calbar select { width: auto; min-height: 38px; }
.week { display: grid; grid-template-columns: 48px repeat(var(--cols), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.week .dh { padding: 8px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); text-decoration: none; }
.week .dh b { display: block; font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--paper); }
.week .dh.today b { color: var(--gold); }
.week .corner { border-bottom: 1px solid var(--line); }
.hours { position: relative; }
.hours div { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.daycol { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line) 47px 48px); }
.daycol .cell { display: block; height: 48px; }
.daycol .cell:hover { background: var(--gold-soft); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: var(--r-s); padding: 4px 6px; font-size: 12px; line-height: 1.25;
  background: var(--ink-3); border-left: 3px solid var(--muted); overflow: hidden; text-decoration: none; z-index: 2; }
.ev:hover { z-index: 3; outline: 1px solid var(--muted); }
.ev b { display: block; font-weight: 600; }
.ev.k-group { border-left-color: var(--paper); }
.ev.k-personal, .ev.k-intro { border-left-color: var(--gold); }
.ev.k-duet { border-left-color: #a99d74; }
.ev.open { box-shadow: inset 0 0 0 1px var(--warn); }
.ev.cancelled { opacity: .45; text-decoration: line-through; }
.ev.blk { background: repeating-linear-gradient(135deg, var(--ink-2) 0 6px, var(--ink-3) 6px 12px); border-left-color: var(--line); color: var(--muted); z-index: 1; }
.nowbar { position: absolute; left: 0; right: 0; height: 2px; background: var(--gold); z-index: 4; pointer-events: none; }
.calist { display: none; }
@media (max-width: 760px) {
  .week { display: none; }
  .calist { display: block; }
}
.calist .day { margin-bottom: 18px; }
.calist .day h3 { margin-bottom: 8px; color: var(--muted); font-family: var(--body); font-weight: 600; font-size: 14px; }
.calist .day h3.today { color: var(--gold); }
.calist a.item { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--r-s);
  background: var(--ink-2); border: 1px solid var(--line); margin-bottom: 6px; text-decoration: none; }
.calist a.item .t { font-family: var(--display); font-size: 18px; }
.calist a.item.cancelled { opacity: .5; text-decoration: line-through; }
.calist .none { color: var(--muted); font-size: 14px; padding: 4px 0 8px; }

/* ── lists ── */
.clist { display: flex; flex-direction: column; }
.clist a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; align-items: center; }
.clist a:hover { background: var(--ink-2); }
.clist .n { font-weight: 500; }
.clist .d { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { max-width: 320px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.passcard { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-decoration: none; }
.passcard:hover { border-color: var(--muted); }
.passcard .big { font-family: var(--display); font-size: 26px; line-height: 1; text-align: right; }
.passcard .big small { display: block; font-family: var(--body); font-size: 12px; }
.passcard.dim { opacity: .6; }

details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 36px; display: flex; align-items: center; }
details.more summary:hover { color: var(--paper); }
details.more[open] summary { color: var(--paper); }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; }
.login .box img { width: 220px; height: auto; display: block; margin: 0 auto 32px; }
.login h1 { font-size: 20px; margin-bottom: 18px; text-align: center; }

/* ── client portal ── */
.portal { max-width: 720px; margin: 0 auto; padding: 18px 16px 60px; }
.portal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.portal header img { height: 44px; width: auto; }
.note { border-left: 3px solid var(--gold); padding: 10px 14px; background: var(--ink-2); border-radius: 0 var(--r-s) var(--r-s) 0; margin-bottom: 18px; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.offer .price { font-family: var(--display); font-size: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .person { transition: border-color .15s ease; }
}

/* ── sklep (etap 2) ── */
.shop h1 { margin-bottom: 14px; }
.eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 6px; }
.buybox { border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; margin-bottom: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: baseline; }
.buybox .price { font-family: var(--display); font-size: 34px; line-height: 1; }
.buybox .price small { font-family: var(--body); font-size: 14px; color: var(--muted); }
.buybox .facts { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; flex-basis: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check span { line-height: 1.45; }

/* ── cennik (Produkty i ceny) — układ jak sekcja „Cennik” na pmboxingstudio.pl ── */
.pricing .head { margin-top: 0; }
.startrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 6px 0 30px; }
.starttile { border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px 22px; position: relative; }
.starttile h2 { font-size: 19px; margin-bottom: 6px; }
.starttile p { color: var(--muted); font-size: 14px; max-width: 42ch; }
.starttile .amount { position: absolute; top: 18px; right: 22px; }
.starttile p { padding-right: 90px; }
.pricing .amount { font-family: var(--display); font-size: 34px; line-height: 1; letter-spacing: .01em; }
.pricing .amount small { font-family: var(--body); font-size: 13px; color: var(--muted); }
.pc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin-top: 12px; }
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ptabs a { padding: 12px 18px; text-decoration: none; color: var(--muted); font-family: var(--display); font-size: 16px;
  letter-spacing: .04em; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptabs a:hover { color: var(--paper); }
.ptabs a.on { color: var(--paper); border-bottom-color: var(--gold); }
.ppanel { margin-bottom: 26px; }
.ppanel-h { font-size: 15px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.js-tabs .ppanel-h { display: none; }
.js-tabs .ppanel { display: none; }
.js-tabs .ppanel.on { display: block; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pcard { border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px 20px 16px; display: flex; flex-direction: column; position: relative; }
.pcard h3 { font-size: 16px; font-weight: 500; color: var(--muted); margin-bottom: 14px; letter-spacing: .02em; }
.pcard .per { color: var(--muted); font-size: 14px; margin-top: 6px; min-height: 21px; }
.pcard.best { border-color: var(--gold); }
.pcard .badge { position: absolute; top: -11px; left: 18px; background: var(--gold); color: #1c1c1c; font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.pc-facts { list-style: none; padding: 14px 0 0; margin: 16px 0 12px; border-top: 1px solid var(--line); font-size: 14px; flex: 1; }
.pc-facts li { padding: 3px 0 3px 16px; position: relative; }
.pc-facts li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 1px; background: var(--gold); }
.pc-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-flags { font-size: 12px; color: var(--muted); margin-top: 10px; }
.pc-flags .on { color: var(--ok, #7fb58a); }
@media (max-width: 640px) {
  .ptabs { overflow-x: auto; }
  .ptabs a { padding: 12px 12px; font-size: 14px; }
  .starttile .amount { position: static; margin-top: 10px; }
  .starttile p { padding-right: 0; }
}

/* ── wyniki (etap 4) ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 4px 0 20px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .l { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.kpi b { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.main { border-color: var(--gold); }
.neg { color: var(--bad); }
.warnc { color: var(--warn); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ledger { width: 100%; }
.ledger td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger td:nth-child(2) { text-align: right; white-space: nowrap; padding-left: 12px; }
.ledger td:nth-child(3) { text-align: right; width: 1%; padding-left: 10px; }
.ledger tr.sum td { font-weight: 500; }
.ledger tr.total td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--muted); font-size: 16px; }
.trend td { white-space: nowrap; }
.trend tr.cur td { background: var(--ink-2); }
.bar { height: 4px; background: var(--ink-3); border-radius: 2px; margin-bottom: 4px; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 2px; }
.bar.alt i { background: var(--muted); }
.bar.cost i { background: var(--bad); opacity: .7; }
.segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 24px; }
.seg-tile { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.seg-tile b { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.1; }
.seg-tile span { font-weight: 500; }
.seg-tile small { color: var(--muted); font-size: 12px; line-height: 1.35; }
a.seg-tile:hover { border-color: var(--muted); }
.seg-tile.on { border-color: var(--gold); background: var(--ink-2); }
.seg-tile.hot b { color: var(--warn); }
.seg-tile.static { border-style: dashed; }
details.inline-edit summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit form { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
details.inline-edit input { width: 110px; min-height: 32px; }
details.inline-edit label { display: flex; gap: 6px; align-items: center; margin: 0; }
.addcost { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ── import (etap 3) ── */
.steps { padding-left: 20px; margin: 0 0 14px; font-size: 14px; }
.steps li { margin-bottom: 6px; }
.imp-sec { border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px 16px; margin-bottom: 14px; }
.imp-sec > summary { cursor: pointer; list-style: none; padding: 8px 0; }
.imp-sec > summary::-webkit-details-marker { display: none; }
.imp-sec > summary h2 { margin: 0; display: inline; }
.imp-sec > summary::before { content: "▸"; color: var(--muted); margin-right: 8px; }
.imp-sec[open] > summary::before { content: "▾"; }
.imp-rows { display: flex; flex-direction: column; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.imp-row.warnrow .imp-src b { color: var(--warn); }
.imp-src .muted { font-size: 13px; }
.imp-why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.imp-dec { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 6px; }
.imp-dec select, .imp-dec input { min-height: 38px; }
.okc { color: var(--ok); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.imp-bar { position: sticky; bottom: 0; background: rgba(28, 28, 28, .97); border-top: 1px solid var(--line); padding: 12px 0;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 5; }
.imp-bar .hint { flex: 1; min-width: 200px; margin: 0; }
@media (max-width: 860px) {
  .imp-row { grid-template-columns: 1fr; }
  .imp-dec { grid-template-columns: 1fr 1fr; }
  .imp-dec input { grid-column: 1 / -1; grid-row: 1; }
  .imp-bar { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .imp-bar .hint { display: none; }
}

/* ── klienci: operacje hurtowe ── */
.crow { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.clist .crow > a { flex: 1; border-bottom: 0; }
.crow .pick { display: flex; align-items: center; padding: 0 10px 0 2px; margin: 0; cursor: pointer; }
.pickall { margin: 0 0 6px 2px; min-height: 36px; font-size: 14px; color: var(--muted); }
.bulkbar { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 0; background: rgba(28, 28, 28, .97); border-top: 1px solid var(--line); }
.bulkbar span { flex: 1; }
.bulkbar[hidden] { display: none; }
@media (max-width: 860px) { .bulkbar { bottom: calc(58px + env(safe-area-inset-bottom)); } }
