/* ---------- panel administratora (i później panel lokalu): wspólny układ aplikacji ---------- */
.app-body { background: var(--night); }
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100svh; }
.scrim { display: none; }

/* boczne menu */
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; background: #15121b; border-right: 1px solid var(--line-d); }
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; }
.side-role { font-size: 0.72rem; font-weight: 800; color: var(--gold); padding: 3px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(255, 181, 71, 0.6); }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  text-decoration: none; color: var(--on-d-soft); font-weight: 700; font-size: 0.97rem; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.side-nav a[aria-current="page"] { background: rgba(139, 92, 255, 0.16); color: #fff; box-shadow: inset 3px 0 0 var(--violet); }
.side-nav svg { width: 20px; height: 20px; }
.side-nav .soon { font-size: 0.72rem; font-weight: 700; color: #7f7891; }
.side-nav .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #1a1420; font-size: 0.75rem; font-weight: 800; text-align: center; }
.side-user { margin-top: auto; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-btn); font-weight: 800; font-size: 0.9rem; }
.side-user b { display: block; font-size: 0.92rem; }
.side-user small { display: block; color: var(--on-d-soft); font-size: 0.8rem; }
.side-user a { grid-column: 1 / -1; font-size: 0.86rem; font-weight: 700; color: var(--on-d-soft); }

/* górny pasek */
.app-main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 48px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.topbar h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 850; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.1; margin-right: auto; }
.search { position: relative; width: min(340px, 40vw); }
.search .input { min-height: 44px; padding-left: 42px; border-radius: 999px; font-size: 0.94rem; }
.search svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #7f7891; pointer-events: none; }
.demo-chip { margin-left: auto; font-size: 0.8rem; font-weight: 750; color: #ffd9a0; padding: 6px 12px; border-radius: 999px; background: rgba(255, 181, 71, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.35); white-space: nowrap; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; place-items: center; }
.menu-btn svg { width: 22px; height: 22px; }

/* kafelki z liczbami */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { padding: 18px 20px; border-radius: 20px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--line-d); display: grid; gap: 6px; min-width: 0; }
.tile span { font-size: 0.9rem; font-weight: 700; color: var(--on-d-soft); }
.tile b { font-family: var(--display); font-weight: 850; font-stretch: 110%; font-size: 2rem; line-height: 1.05; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile small { font-size: 0.86rem; color: var(--on-d-soft); font-weight: 600; }
.tile small .up { color: #7ee08f; font-weight: 800; }

/* pudełka */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.box { padding: 20px; border-radius: 22px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--line-d); min-width: 0; }
.box + .box { margin-top: 18px; }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.box-head h2 { font-size: 1.15rem; font-weight: 800; font-stretch: 108%; }
.box-head p, .box-head a { font-size: 0.88rem; color: var(--on-d-soft); font-weight: 650; }
.box-head a { color: #fff; }

/* kolejka „wymaga uwagi” */
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); }
.q-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.q-ic svg { width: 20px; height: 20px; }
.q b { display: block; font-size: 0.98rem; }
.q span { display: block; color: var(--on-d-soft); font-size: 0.88rem; line-height: 1.45; }
.q .btn { min-height: 40px; padding: 8px 16px; font-size: 0.88rem; }
.ic-gold { background: rgba(255, 181, 71, 0.14); color: var(--gold); }
.ic-red { background: rgba(255, 122, 122, 0.14); color: #ff9a9a; }
.ic-violet { background: rgba(139, 92, 255, 0.18); color: #c4adff; }

/* wykres */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.chart .ax text { fill: #8d87a0; font-size: 12.5px; font-family: var(--body); font-weight: 600; }
.chart .bar rect.v { fill: var(--violet); }
.chart .bar rect.hit { fill: transparent; }
.chart .bar:hover rect.v, .chart .bar.on rect.v { fill: #b39bff; }
.chart .peak { fill: var(--on-d); font-size: 13px; font-weight: 800; font-family: var(--body); }
.tip { position: absolute; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); padding: 7px 11px; border-radius: 10px; background: #2b2636; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  font-size: 0.84rem; font-weight: 700; white-space: nowrap; }
.tip small { display: block; color: var(--on-d-soft); font-weight: 600; font-size: 0.78rem; }
.tip[hidden] { display: none; }
.chart-sum { margin-top: 10px; color: var(--on-d-soft); font-size: 0.9rem; }
.chart-sum b { color: #fff; }

/* historia zdarzeń */
.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-d); font-size: 0.92rem; }
.log li:first-child { border-top: 0; }
.log time { color: #8d87a0; font-weight: 700; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.log span { color: #e6e3ee; }
.log em { font-style: normal; color: var(--on-d-soft); }

/* status lokalu: kropka + napis, nigdy sam kolor */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 750; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-aktywny { color: #7ee08f; }
.st-zalegla { color: var(--gold); }
.st-wstrzymana { color: #ff9a9a; }
.st-uruchomienie { color: #c4adff; }
.st-off { color: var(--gold); }
.plan-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; background: rgba(255, 255, 255, 0.07); }
.plan-tag.max { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.45); background: transparent; }
.plan-tag.plus { color: #d4bfff; box-shadow: inset 0 0 0 1px rgba(196, 173, 255, 0.4); background: transparent; }

/* tabela lokali */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-f { min-height: 38px; padding: 6px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--on-d-soft); font: inherit; font-size: 0.88rem; font-weight: 750; cursor: pointer; }
.chip-f[aria-pressed="true"] { background: #fff; color: #18151f; }
.chip-f span { opacity: 0.7; margin-left: 4px; }
.tbl-wrap { overflow-x: auto; margin-inline: -20px; padding-inline: 20px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 0.93rem; }
.tbl th { text-align: left; font-size: 0.8rem; font-weight: 750; color: #8d87a0; padding: 0 12px 10px; white-space: nowrap; }
.tbl td { padding: 13px 12px; border-top: 1px solid var(--line-d); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td:nth-child(2) .sub, .tbl-pay td:first-child { white-space: nowrap; }
.tbl a.name { color: #fff; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.tbl a.name:hover { text-decoration: underline; }
.tbl .sub { display: block; color: #8d87a0; font-size: 0.82rem; font-weight: 600; }
.tbl .sub.soon { color: var(--gold); font-weight: 750; }
.sw { width: 26px; height: 26px; flex: none; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.meter { display: grid; gap: 5px; min-width: 120px; }
.meter i { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.meter i b { display: block; height: 100%; border-radius: 99px; background: var(--violet); }
.meter i b.hi { background: var(--gold); }
.meter small { font-size: 0.8rem; color: var(--on-d-soft); font-variant-numeric: tabular-nums; }
.empty-row td { text-align: center; color: var(--on-d-soft); padding: 28px; }

/* szczegóły lokalu */
.crumbs { font-size: 0.88rem; color: var(--on-d-soft); margin-bottom: 6px; }
.crumbs a { color: var(--on-d-soft); }
.biz-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 22px; }
.biz-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 850; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.1; margin-right: auto; }
.biz-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--on-d-soft); font-size: 0.92rem; font-weight: 650; width: 100%; }
.biz-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.biz-actions .btn { min-height: 44px; padding: 10px 18px; font-size: 0.92rem; }
.btn-danger { background: rgba(255, 122, 122, 0.1); color: #ffb0b0; box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.4); }
.btn-danger:hover { background: rgba(255, 122, 122, 0.18); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; font-size: 0.94rem; }
.kv dt { color: var(--on-d-soft); font-weight: 650; }
.kv dd { margin: 0; text-align: right; font-weight: 750; }
.usage { display: grid; gap: 16px; }
.usage .meter { min-width: 0; }
.usage .meter > div { display: flex; justify-content: space-between; font-size: 0.92rem; font-weight: 700; }
.usage .meter > div span { color: var(--on-d-soft); font-weight: 650; }
.note-area { width: 100%; min-height: 110px; resize: vertical; }
.audit-hint { margin-top: 10px; font-size: 0.84rem; color: var(--on-d-soft); }
.box .mp { transform: none; margin-inline: auto; font-size: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-row .btn { min-height: 44px; padding: 10px 18px; font-size: 0.92rem; }

/* funkcje i dodatki lokalu: przełączniki, próby, darmowe SMS-y */
.feats { list-style: none; margin: 0; padding: 0; display: grid; }
.feats > li { padding: 12px 0; border-top: 1px solid var(--line-d); }
.feats > li:first-child { border-top: 0; padding-top: 0; }
.feat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.feat-row b { display: block; font-size: 0.97rem; }
.feat-row small { display: block; color: var(--on-d-soft); font-size: 0.84rem; font-weight: 650; }
.feat-row small.trial { color: var(--gold); }
.feat-row small.off { color: #ff9a9a; }
.switch { position: relative; flex: none; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); cursor: pointer; transition: background-color 160ms ease; }
.switch::before { content: ""; position: absolute; inset: -8px; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 160ms ease; }
.switch[aria-checked="true"] { background: var(--grad-btn); }
.switch[aria-checked="true"] i { transform: translateX(20px); }
.feat-panel { margin-top: 12px; padding: 14px; border-radius: 14px; display: grid; gap: 12px; font-size: 0.92rem; color: #e6e3ee;
  background: rgba(139, 92, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(139, 92, 255, 0.32); }
.feat-panel .btn-row { margin-top: 0; }
.warn-panel { background: rgba(255, 122, 122, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.32); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; justify-self: start; padding: 4px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.seg label { position: relative; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 0.86rem; color: var(--on-d-soft); cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--grad-btn); color: #fff; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.sub-h { margin: 22px 0 14px; padding-top: 18px; border-top: 1px solid var(--line-d); font-size: 1rem; font-weight: 800; font-stretch: 106%; }
.addon-form { display: grid; gap: 14px; }
.addon-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px; }
.addon-form .input { min-height: 46px; padding: 10px 14px; }
.addon-form .btn { min-height: 44px; padding: 10px 18px; font-size: 0.92rem; }
.addons { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.addons:empty { display: none; }
.addons li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 181, 71, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.3); font-size: 0.92rem; }
.addons b { color: #ffe2a8; }
.addons small { grid-column: 1; color: var(--on-d-soft); font-size: 0.84rem; overflow-wrap: anywhere; }
.addons .link-btn { grid-column: 2; grid-row: 1 / span 2; font-size: 0.88rem; }
@media (max-width: 620px) { .addon-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .addon-grid .field:last-child { grid-column: 1 / -1; }
  .seg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); justify-self: stretch; border-radius: 16px; } .seg label { text-align: center; } }

/* telefon: menu chowa się z boku */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(290px, 84vw); transform: translateX(-102%); transition: transform 240ms ease; box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5); }
  .nav-open .side { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.5); }
  .menu-btn { display: grid; }
  .topbar { flex-wrap: wrap; }
  .topbar h1 { order: 2; width: 100%; }
  .search { order: 3; width: 100%; }
  .demo-chip { margin-left: auto; }
  .q { grid-template-columns: 40px minmax(0, 1fr); }
  .q .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } .tile { padding: 14px; } .tile b { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { .side, .switch, .switch i { transition: none; } }
