/* Panel Townely – styl strony "Townely 3D" (bez makiet 3D): cieple tlo, szklane karty, narozniki, czerwony akcent. */
:root {
  --busy-veil: rgba(255, 255, 255, 0.7);
  --sky-top: #F5F0ED;
  --sky-mid: #EFE3E0;
  --sky-bottom: #E7D3D0;
  --ink: #1A1414;
  --muted: #5E5452;
  --glass: rgba(255, 252, 250, 0.62);
  --glass-strong: rgba(255, 252, 250, 0.9);
  --line: rgba(26, 20, 20, 0.12);
  --bracket: rgba(26, 20, 20, 0.5);
  --accent: #E02D20;
  --accent-text: #C42A20;
  --on-accent: #FFFFFF;
  --btn-dark: #1A1414;
  --btn-dark-ink: #FFFFFF;
  --ok: #1F9D55;
  --ok-bg: rgba(31, 122, 77, 0.12);
  --warn: #9A5B00;
  --warn-bg: rgba(231, 184, 33, 0.22);
  --bad-bg: rgba(224, 45, 32, 0.12);
  --shadow: 0 18px 50px rgba(70, 35, 30, 0.16);
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, -apple-system, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --busy-veil: rgba(0, 0, 0, 0.7);
    --sky-top: #141011; --sky-mid: #1C1617; --sky-bottom: #2A1E20;
    --ink: #F6EFEC; --muted: #B9ADA9;
    --glass: rgba(30, 24, 25, 0.62); --glass-strong: rgba(30, 24, 25, 0.9);
    --line: rgba(255, 255, 255, 0.14); --bracket: rgba(255, 255, 255, 0.55);
    --accent-text: #FF7468; --btn-dark: #F6EFEC; --btn-dark-ink: #1A1414;
    --ok: #5FD39A; --warn: #F2C14E;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --busy-veil: rgba(0, 0, 0, 0.7);
  --sky-top: #141011; --sky-mid: #1C1617; --sky-bottom: #2A1E20;
  --ink: #F6EFEC; --muted: #B9ADA9;
  --glass: rgba(30, 24, 25, 0.62); --glass-strong: rgba(30, 24, 25, 0.9);
  --line: rgba(255, 255, 255, 0.14); --bracket: rgba(255, 255, 255, 0.55);
  --accent-text: #FF7468; --btn-dark: #F6EFEC; --btn-dark-ink: #1A1414;
  --ok: #5FD39A; --warn: #F2C14E;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bottom) 100%) fixed;
  color: var(--ink); font-family: var(--font-body); font-size: 15.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
h1 { font-weight: 800; font-size: clamp(30px, 4vw, 44px); }
h2 { font-weight: 700; font-size: 24px; }
h3 { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* narozniki: znak rozpoznawczy strony */
.bracketed { position: relative; }
.bracketed::before, .bracketed::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.bracketed::before { top: -7px; left: -7px; border-top: 2px solid var(--bracket); border-left: 2px solid var(--bracket); border-top-left-radius: 5px; }
.bracketed::after { bottom: -7px; right: -7px; border-bottom: 2px solid var(--bracket); border-right: 2px solid var(--bracket); border-bottom-right-radius: 5px; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo svg { display: block; height: 28px; width: calc(28px * 4.348); }
.logo-tag { padding: 3px 8px; border-radius: 6px; background: var(--btn-dark); color: var(--btn-dark-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* uklad z bocznym menu */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; max-width: 1280px; margin: 0 auto; padding: 24px; min-height: 100vh; }
.side { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 18px; padding: 20px; border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: var(--shadow); }
.side-venue { padding: 12px; border-radius: 12px; background: var(--line); }
.side-venue strong { display: block; font-family: var(--font-display); font-size: 16px; letter-spacing: -0.02em; }
.side-venue span { font-size: 13px; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 9px; font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--ink); }
.side nav a:hover { background: var(--line); }
.side nav a[aria-current="page"] { background: var(--btn-dark); color: var(--btn-dark-ink); }
.side nav .nav-label { margin: 10px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.side-foot form { margin: 0; }
.link-btn { padding: 0; border: 0; background: none; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); }

.main { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding-bottom: 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 4px 0; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }

/* karty */
.card { padding: clamp(18px, 2.6vw, 28px); border-radius: 18px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); box-shadow: var(--shadow); }
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.checklist .tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 12px; }
.checklist .tick.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.stat { padding: 18px; border-radius: 14px; background: var(--glass-strong); box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }

/* formularze */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
label.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 700; line-height: 1.3; min-height: 1.3em; }
.field-label small { font-weight: 500; color: var(--muted); margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=time], select {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background-color: var(--glass-strong); font-size: 15px; font-weight: 500; line-height: 1;
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a7f7c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea {
  width: 100%; min-height: 110px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background-color: var(--glass-strong); font-size: 15px; font-weight: 500; line-height: 1.5; resize: vertical;
}
.form-row-address { grid-template-columns: minmax(0, 2fr) minmax(110px, 0.8fr) minmax(0, 1.4fr); }
@media (max-width: 700px) { .form-row-address { grid-template-columns: 1fr 1fr; } .form-row-address > :first-child { grid-column: 1 / -1; } }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--ok); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.form-actions .form-actions-start { margin-right: auto; }

/* przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1.5px solid transparent; border-radius: 10px; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-dark { background: var(--btn-dark); color: var(--btn-dark-ink); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-dark:hover, .btn-accent:hover { filter: brightness(1.08); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn-danger { border-color: rgba(224, 45, 32, 0.4); color: var(--accent-text); background: transparent; }

/* komunikaty i znaczki */
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14.5px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--bad-bg); color: var(--accent-text); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-bg); color: var(--accent-text); border-color: transparent; }

/* zakladki */
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--glass); box-shadow: var(--shadow); flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--btn-dark); color: var(--btn-dark-ink); }
.tabs .count { font-variant-numeric: tabular-nums; opacity: .75; font-size: 12.5px; }

/* tabele */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td a.row-link { font-weight: 700; text-decoration: none; }
td a.row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* godziny */
.hours { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 10px; align-items: center; }
.hours-row .check { min-height: 44px; }

/* WIEDZA */
.qa { display: grid; gap: 12px; }
.qa-item { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-strong); }
.qa-item summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item p { margin: 8px 0 0; color: var(--muted); white-space: pre-line; }
.qa-item form { margin-top: 12px; }

/* transkrypcja */
.transcript { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.msg small { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.msg-agent { align-self: flex-start; background: var(--line); border-bottom-left-radius: 5px; }
.msg-user { align-self: flex-end; background: var(--btn-dark); color: var(--btn-dark-ink); border-bottom-right-radius: 5px; }
.msg-tool { align-self: center; max-width: 100%; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 9px; font-size: 12.5px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }

/* strony logowania i rejestracji */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(520px, 100%); padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.auth-card .logo { margin-bottom: 26px; }
.auth-card h1 { font-size: clamp(30px, 5vw, 42px); }
.auth-card .lead { margin: 12px 0 22px; color: var(--muted); }
.auth-alt { margin: 18px 0 0; font-size: 14px; font-weight: 600; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .side { position: static; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side nav .nav-label { width: 100%; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-row .check { grid-column: 1 / -1; min-height: 32px; }
  .msg { max-width: 92%; }
}

/* zakladki na stronie godzin: przelaczanie bez przeladowania, oba zestawy pol zostaja w formularzu */
.hours-tabs { margin-bottom: 4px; }
.hours-tabs button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.hours-tabs button:hover { color: var(--ink); }
.hours-tabs button[aria-selected="true"] { background: var(--btn-dark); color: var(--btn-dark-ink); }
.hours-wrap { max-width: 760px; }
.hours-wrap .hours-tabs { display: flex; }
.hours-panel[hidden] { display: none; }

/* Ustawienia: wybor trybu dziennego / nocnego */
.theme-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; }
.theme-option:hover { border-color: var(--bracket); }
.theme-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 45, 32, 0.15); }
.theme-option input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; accent-color: var(--accent); }
.theme-swatch { display: flex; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.theme-swatch i { flex: 1; }
.theme-swatch-light i { background: linear-gradient(180deg, #F5F0ED, #E7D3D0); }
.theme-swatch-dark i { background: linear-gradient(180deg, #1C1617, #2A1E20); }
.theme-swatch-auto i:first-child { background: linear-gradient(180deg, #F5F0ED, #E7D3D0); }
.theme-swatch-auto i:last-child { background: linear-gradient(180deg, #1C1617, #2A1E20); }
.theme-text { display: grid; gap: 4px; padding-right: 24px; }
.theme-text small { font-size: 13.5px; color: var(--muted); line-height: 1.4; }

/* Historia rozmow: rozwijane szczegoly */
.calls-table .call-row { cursor: pointer; }
.calls-table .call-row:hover td { background: var(--line); }
.calls-table .call-row.is-open td { border-bottom-color: transparent; background: var(--line); }
.calls-table .call-group:last-child .call-detail td { border-bottom: 0; }
.call-toggle-cell { text-align: right; white-space: nowrap; }
.call-toggle .chev { display: inline-block; transition: transform .2s ease; }
.call-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.call-detail > td { padding: 0 12px 18px; background: var(--line); }
.call-detail-inner { padding: 18px; border-radius: 14px; background: var(--glass-strong); }
.call-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.call-summary { margin: 0; max-width: 72ch; line-height: 1.55; }

/* Zakladka Agent: wybor glosu */
.voice-option { gap: 8px; }
.voice-head { display: flex; align-items: center; gap: 12px; padding-right: 28px; }
.voice-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
.voice-play:hover { border-color: var(--accent); }
.greeting-preview { padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.greeting-preview .call-summary { margin: 4px 0 0; }

/* Pulpit: numer agenta obok nazwy lokalu */
.agent-number { display: grid; gap: 6px; justify-items: start; padding: 14px 18px; border-radius: 16px; background: var(--glass); box-shadow: var(--shadow); }
.agent-number .eyebrow { margin: 0; }
.agent-number-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Przelacznik TAK/NIE */
.segmented { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 4px; border: 0; border-radius: 12px; background: var(--glass); box-shadow: var(--shadow); justify-self: start; }
.segmented legend { float: left; margin: 0 12px 0 8px; padding: 0; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 18px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); }
.segmented input:checked + span { background: var(--btn-dark); color: var(--btn-dark-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Usuwanie rozmow (tylko Townely) */
.call-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.call-delete { margin: 0; }

/* Koszty */
.costs-table td:nth-child(2), .costs-table th:nth-child(2) { min-width: 190px; }
.costs-table td.num, .costs-table th.num { white-space: nowrap; }
.costs-table tfoot th { border-top: 1px solid var(--line); padding-top: 12px; }
/* Koszty: kwoty skladowe o 40% mniejsze niz "Razem" (34px -> 20px) */
.stat-minor b { font-size: 20.4px; line-height: 34px; } /* ta sama wysokosc wiersza co "Razem" - podpisy w jednej linii */

/* Menu modulow */
.nav-module.nav-soon { color: var(--muted); font-weight: 500; justify-content: space-between; }
.nav-soon-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.nav-module.is-open { color: var(--accent-text); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 14px; padding-left: 10px; border-left: 1px solid var(--line); }
.side nav .nav-sub a { min-height: 36px; font-size: 14px; }
.in-progress { display: grid; gap: 10px; justify-items: start; max-width: 640px; }
.in-progress h2, .qr-section h2 { margin: 0; }
.qr-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.qr-section { display: grid; gap: 8px; align-content: start; justify-items: start; }
.qr-section p { margin: 0; }

/* Menu i produkty */
.allergen-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 4px 14px; margin: 0; padding: 0; border: 0; }
.allergen-checks legend { margin-bottom: 8px; }
.allergen-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; }
.menu-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.menu-table td .badge { margin: 1px 0; }
.category-edit summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.category-edit summary::-webkit-details-marker { display: none; }
.category-edit summary h2 { margin: 0; }
.category-edit[open] .form { margin-top: 14px; }
.field-narrow { max-width: 180px; }
.variants { display: grid; gap: 14px; }
.variant { padding: 14px; border: 1px dashed var(--line); border-radius: 14px; display: grid; gap: 8px; }
.variant-delete { align-self: end; min-height: 46px; }
.recipe { display: grid; gap: 8px; justify-items: start; }
.recipe-rows { display: grid; gap: 8px; width: 100%; }
.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; }
.recipe-qty { display: flex; align-items: center; gap: 8px; }
.recipe-qty input { width: 100%; }
.recipe-unit { min-width: 30px; color: var(--muted); font-size: 13.5px; }
.group-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px 14px; }
@media (max-width: 640px) { .recipe-row { grid-template-columns: 1fr; } }
.import-source { display: grid; gap: 8px; margin-top: 14px; }
.import-source[hidden] { display: none; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.bulk-bar { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--glass-strong); box-shadow: var(--shadow); }
.bulk-bar[hidden] { display: none; }

/* Ladowanie: polprzezroczysta zaslona 70% na cale okno (biala w dzien, czarna w nocy) i duzy licznik procent
   w prawym dolnym rogu - jak przy starcie strony Townely 3D. */
.busy { position: fixed; inset: 0; z-index: 100; background: var(--busy-veil); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); cursor: progress; opacity: 0; transition: opacity .3s ease; }
.busy.is-on { opacity: 1; }
.busy[hidden] { display: none; }
.busy__msg { position: absolute; right: 48px; bottom: calc(env(safe-area-inset-bottom, 0px) + 48px + clamp(84px, 11.25vw, 216px) * .7 + 28px); max-width: min(380px, calc(100vw - 96px)); margin: 0; padding: 14px 18px; border-radius: 14px; background: var(--glass-strong); box-shadow: var(--shadow); font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--ink); }
.busy__msg small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 13.5px; font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--muted); }
.busy__msg small:empty { display: none; }
.busy__pct { position: absolute; right: 48px; bottom: calc(env(safe-area-inset-bottom, 0px) + 48px); font-family: var(--font-display); font-weight: 700; font-size: clamp(84px, 11.25vw, 216px); line-height: .7; letter-spacing: -0.04em; color: var(--ink); opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; user-select: none; }
@media (max-width: 760px) {
  .busy__msg { left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 30px + clamp(84px, 11.25vw, 216px) * .7 + 20px); max-width: none; }
  .busy__pct { right: 22px; bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); }
}
@media (prefers-reduced-motion: reduce) { .busy { transition: none; } }
/* Karty obok siebie (np. Nowa pozycja / Nowa kategoria): naglowki i pola rowno u gory, przyciski rowno na dole */
.menu-add-grid > .card { display: flex; flex-direction: column; gap: 16px; }
.menu-add-grid > .card .card-head { margin: 0; }
.menu-add-grid > .card .form-actions { margin-top: auto; }

/* Pracownicy */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.staff-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 18px; border-radius: 18px; background: var(--glass-strong); box-shadow: var(--shadow); }
.staff-card.is-inactive { opacity: .6; }
.staff-card h3 { margin: 0; font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; }
.staff-card p { margin: 2px 0 0; font-size: 13.5px; }
.staff-bio { color: var(--ink); margin-top: 8px !important; }
.staff-langs { margin-top: 8px !important; display: flex; flex-wrap: wrap; gap: 4px; }
.staff-photo { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--line); color: var(--muted); font-family: var(--font-display); font-weight: 700; font-size: 20px; text-decoration: none; text-transform: uppercase; }
.staff-photo img { width: 100%; height: 100%; object-fit: cover; }
.staff-photo-lg { width: 112px; height: 112px; flex: none; font-size: 34px; }
.staff-head-card { display: flex; gap: 20px; align-items: flex-start; }
.staff-tips { display: grid; justify-items: end; gap: 4px; margin: 0; }
.staff-tips .field-label { font-size: 11px; }
.tips-toggle { min-width: 58px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-weight: 800; font-size: 13px; cursor: pointer; }
.tips-toggle.is-on { background: var(--ok, #1F9D55); border-color: transparent; color: #fff; }
.tips-toggle:hover { border-color: var(--accent); }
.switch-row { display: flex; flex-wrap: wrap; gap: 14px 28px; }
@media (max-width: 640px) { .staff-head-card { flex-direction: column; } .staff-card { grid-template-columns: 56px minmax(0, 1fr); } .staff-tips { grid-column: 1 / -1; justify-items: start; } }

/* Stoliki */
.table-name { display: flex; align-items: center; gap: 10px; }
.table-name img { width: 44px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }
.table-photo { display: grid; place-items: center; width: 180px; height: 120px; flex: none; border-radius: 14px; overflow: hidden; background: var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; }
.table-photo img { width: 100%; height: 100%; object-fit: cover; }
.rules { display: grid; gap: 10px; margin-bottom: 12px; }
.rule-row { display: grid; grid-template-columns: 170px 170px 130px 130px minmax(140px, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }
.rule-row[data-scope="weekday"] .rule-date, .rule-row[data-scope="date"] .rule-weekday { display: none; }
.rule-row .rule-remove { min-height: 46px; }
@media (max-width: 1100px) { .rule-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rule-row .rule-remove { justify-self: end; } }
@media (max-width: 640px) { .staff-head-card .table-photo { width: 100%; height: 160px; } }
.durations { display: grid; gap: 8px; margin-bottom: 10px; }
.duration-row { display: grid; grid-template-columns: 160px 160px auto; gap: 8px; align-items: center; justify-content: start; }
.duration-row .duration-remove { min-height: 46px; }
a.badge { text-decoration: none; }

/* QR Payment: kody QR stolikow, zdjecie dania, przeglad modulu */
.flash-warn { background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.item-photo-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.item-photo-row > .form { flex: 1; min-width: 220px; }
.qr-code { width: 100%; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 6px; }
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr-web { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-web .qr-code { width: 150px; flex: none; }
.qr-web__side { flex: 1; min-width: 240px; display: grid; gap: 12px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; font-size: 13.5px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.qr-tile { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--line); scroll-margin-top: 24px; }
.qr-tile:target { box-shadow: 0 0 0 2px var(--accent); }
.qr-tile__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-align: center; letter-spacing: -0.01em; }
.qr-tile__actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.qr-tile__actions .btn { min-height: 30px; padding: 0 9px; font-size: 12.5px; }
.qr-print-only { display: none; }
.qr-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.qr-cover { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--line); display: grid; place-items: center; color: var(--muted); font-weight: 600; font-size: 13px; }
.qr-cover img { width: 100%; height: 100%; object-fit: cover; }
.qr-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14.5px; }
.qr-steps b { color: var(--ink); }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #000; }
  .side, .page-head, .tabs, .qr-noprint, .flash, #busy, .card-head { display: none !important; }
  .shell { display: block; padding: 0; max-width: none; }
  .card { background: none !important; box-shadow: none !important; padding: 0 !important; backdrop-filter: none !important; }
  .qr-zone + .qr-zone { margin-top: 0; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); gap: 8mm; }
  .qr-tile { background: none; border: 1px dashed #bbb; border-radius: 6mm; padding: 6mm 5mm; break-inside: avoid; gap: 3mm; color: #000; }
  .qr-print-only { display: block; text-align: center; }
  .qr-tile__venue { font-weight: 700; font-size: 11pt; }
  .qr-tile__hint { font-size: 8pt; color: #555; }
  .qr-tile__name { font-size: 18pt; color: #000; }
  .qr-code { padding: 0; }
}
