/* Przy Stole – zaplecze (administrator i barman) */

:root {
  --bg: #F2F3F6;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --ink: #1C2030;
  --ink-2: #3A4052;
  --muted: #697084;
  --line: #E1E3EA;
  --line-2: #CBCFDA;
  --plum: #58285C;
  --plum-600: #6E3573;
  --plum-50: #F4EDF5;
  --champ: #B8873A;
  --champ-50: #FAF3E4;
  --st-new: #C2185B;
  --st-new-50: #FCEAF1;
  --st-prep: #9A5B00;
  --st-prep-50: #FFF2DC;
  --st-ready: #2B7A4B;
  --st-ready-50: #E4F3E9;
  --danger: #B42318;
  --danger-50: #FDECEA;
  --focus: #7C3B82;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --pop: 0 18px 40px -12px rgba(28, 32, 48, .32), 0 2px 6px rgba(28, 32, 48, .06);
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--plum); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; font: 600 28px var(--serif); color: var(--plum); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- przyciski i pola ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: #B8BCC9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--plum); border-color: var(--plum); color: #fff; }
.btn-primary:hover { background: var(--plum-600); border-color: var(--plum-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9A1D14; border-color: #9A1D14; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(28, 32, 48, .06); border-color: transparent; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-50); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: rgba(28, 32, 48, .07); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.icon-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.link { border: 0; background: none; padding: 0; color: var(--plum); font-weight: 600; cursor: pointer; text-decoration: underline; }

input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(88, 40, 92, .14); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697084' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input[type=checkbox], input[type=radio] { accent-color: var(--plum); width: 18px; height: 18px; }
input[type=range] { accent-color: var(--plum); width: 100%; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, .label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); padding: 0; }
.hint { font-size: 13px; color: var(--muted); }
.form-error { color: var(--danger); background: var(--danger-50); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-cols > div { display: grid; gap: 16px; align-content: start; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--plum); background: var(--plum-50); }
.radio span { display: grid; }
.radio small { color: var(--muted); }
.radio-list { display: grid; gap: 8px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; white-space: nowrap; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 12px; background: #C5C9D4; transition: background .15s; flex: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--st-ready); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-label { font-weight: 600; font-size: 14px; }

.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--plum); color: var(--plum); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); vertical-align: middle; margin-left: 6px; }
.pill-live { background: var(--st-ready-50); color: var(--st-ready); border-color: transparent; }
.pill-warn { background: var(--st-prep-50); color: var(--st-prep); border-color: transparent; }
.pill.st-delivered { background: var(--st-ready-50); color: var(--st-ready); border-color: transparent; margin: 0; }
.pill.st-cancelled { background: var(--danger-50); color: var(--danger); border-color: transparent; margin: 0; }
.pill.role-admin { background: var(--plum-50); color: var(--plum); border-color: transparent; margin: 0; }
.pill.role-barman { background: var(--champ-50); color: #7A5418; border-color: transparent; margin: 0; }

/* ---------- logowanie ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--plum); }
.login-form { width: min(380px, 100%); display: grid; gap: 16px; background: var(--surface); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--pop); }
.login-brand { text-align: center; margin-bottom: 6px; }
.login-brand p { color: var(--muted); }
.brand-mark { font: 600 26px/1.1 var(--serif); color: var(--plum); letter-spacing: -.01em; }

/* ---------- szkielet ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { padding: 0 10px; }
.event-chip { margin: 0 4px; padding: 12px 14px; border-radius: var(--r); background: var(--plum-50); }
.event-chip small { display: block; color: var(--muted); font-size: 12px; }
.event-chip strong { display: block; font-size: 14.5px; line-height: 1.3; margin: 1px 0 6px; }
.chip-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--st-ready); }
.chip-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-state[data-open="0"] { color: var(--st-prep); }
.nav { display: grid; gap: 2px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--plum); color: #fff; }
.nav-short { display: none; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--st-new); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-link.active .badge { background: #fff; color: var(--st-new); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; }
.user-btn:hover { background: var(--surface-2); }
.user-meta { display: grid; line-height: 1.25; }
.user-meta small { color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--champ-50); color: #7A5418; font-weight: 700; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 28px 6px; }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.topbar-sub { display: none; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.live[data-state="live"] { color: var(--st-ready); }
.live[data-state="live"] i { background: var(--st-ready); box-shadow: 0 0 0 4px rgba(43, 122, 75, .15); }
.live[data-state="connecting"] i { background: var(--st-prep); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.view { padding: 12px 28px 40px; flex: 1; min-width: 0; outline: none; }
.only-mobile { display: none; }
.tabbar { display: none; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.empty { max-width: 480px; margin: 48px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty h2 { font-size: 20px; }
.empty p { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar-spacer { flex: 1; }
.toolbar > select, .event-select { width: auto; min-width: 200px; max-width: 320px; }
.search { max-width: 280px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.panel h2 { font-size: 16px; margin-bottom: 14px; }

.segmented { display: inline-flex; padding: 3px; background: #E6E8EE; border-radius: 11px; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- okna i powiadomienia ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(22, 18, 30, .5); opacity: 0; transition: opacity .16s; }
.modal-back.in { opacity: 1; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--pop); transform: translateY(8px); transition: transform .18s; outline: none; }
.modal-back.in .modal { transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px 24px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 24px 20px; overflow: auto; }
.modal-text { color: var(--ink-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.menu-list { display: grid; gap: 4px; }
.menu-list > p { margin-bottom: 8px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); font-weight: 500; }
.menu-item:hover { background: var(--surface-2); }
.copy-field { font-family: ui-monospace, monospace; font-size: 13px; }

.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--pop); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; }
.toast-ok { background: #1F4D33; }
.toast-error { background: var(--danger); }

/* ---------- zamówienia ---------- */
.ordering-switch { padding: 6px 14px 6px 8px; border-radius: 12px; background: var(--st-ready-50); }
.ordering-switch[data-open="0"] { background: var(--st-prep-50); }
.ordering-switch[data-open="0"] .switch-label { color: var(--st-prep); }
.audio-hint { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 14px; padding: 12px 16px; border: 1px dashed var(--champ); border-radius: var(--r); background: var(--champ-50); color: #6B4A12; font-weight: 600; cursor: pointer; text-align: left; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: #E9EBF0; border-radius: var(--r-lg); padding: 10px; min-height: 240px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 12px; }
.col-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.col-head h2::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.col-new { --c: var(--st-new); --c50: var(--st-new-50); }
.col-preparing { --c: var(--st-prep); --c50: var(--st-prep-50); }
.col-ready { --c: var(--st-ready); --c50: var(--st-ready-50); }
.col-count { min-width: 28px; text-align: center; font-weight: 700; font-size: 14px; color: var(--c); background: var(--surface); border-radius: 8px; padding: 1px 8px; }
.col-list { display: grid; gap: 10px; }
.col-empty { padding: 18px 12px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }
.order { background: var(--surface); border-radius: 14px; padding: 14px 14px 12px; box-shadow: 0 1px 2px rgba(28, 32, 48, .06); border: 1px solid transparent; }
.order.fresh { animation: arrive 1.6s ease-out 1; border-color: var(--st-new); }
@keyframes arrive { 0% { background: var(--st-new-50); transform: scale(1.02); } 100% { background: var(--surface); transform: none; } }
.order-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.order-age { font-weight: 600; }
.order.late .order-age { color: var(--danger); }
.order.late .order-age::before { content: '● '; }
.order-drink { font-size: 19px; font-weight: 700; margin: 2px 0 10px; letter-spacing: -.01em; }
.order-where { display: flex; align-items: center; gap: 12px; }
.seat { display: grid; place-items: center; min-width: 62px; padding: 4px 8px 6px; border-radius: 12px; background: var(--c50); color: var(--c); line-height: 1; }
.seat small { font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.seat b { font: 600 30px/1 var(--serif); }
.where-text { display: grid; gap: 2px; min-width: 0; }
.table { font-weight: 600; }
.guest { color: var(--ink-2); }
.order-note { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: var(--champ-50); color: #5E4210; font-size: 14px; font-weight: 500; }
.order-actions { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.btn-next { flex: 1; min-height: 44px; }
.st-preparing .btn-next { background: var(--st-prep); border-color: var(--st-prep); }
.st-ready .btn-next { background: var(--st-ready); border-color: var(--st-ready); }
.st-preparing .btn-next:hover, .st-ready .btn-next:hover { filter: brightness(1.08); }
.history .table-wrap { margin-top: 4px; }

/* tryb baru – ciemny, czytelny z daleka */
body.bar-mode {
  --bg: #1C1220; --surface: #2B1D30; --surface-2: #35253B; --ink: #F5EEF6; --ink-2: #DCCFDF; --muted: #A795AD;
  --line: #3E2E44; --line-2: #54405B; --st-new-50: #4A1D33; --st-prep-50: #45321A; --st-ready-50: #1D3E2B; --champ-50: #43361F;
  color-scheme: dark;
}
body.bar-mode .sidebar, body.bar-mode .topbar, body.bar-mode .tabbar { display: none; }
body.bar-mode .shell { grid-template-columns: 1fr; }
body.bar-mode .view { padding: 18px; }
body.bar-mode .col { background: #24182A; }
body.bar-mode .order-note { color: #F3DDB0; }
body.bar-mode .seat { color: #fff; }
body.bar-mode .col-new .seat { background: var(--st-new); }
body.bar-mode .col-preparing .seat { background: #8A5306; }
body.bar-mode .col-ready .seat { background: var(--st-ready); }
body.bar-mode .order-drink { font-size: 22px; }
body.bar-mode .segmented { background: #2B1D30; }
body.bar-mode .segmented button[aria-selected="true"] { background: #45324C; color: #fff; }
body.bar-mode .ordering-switch { background: var(--st-ready-50); }
body.bar-mode .ordering-switch[data-open="0"] { background: var(--st-prep-50); }
body.bar-mode .ordering-switch[data-open="0"] .switch-label { color: #F2C47A; }
body.bar-mode .btn { background: var(--surface-2); border-color: var(--line-2); }
body.bar-mode .btn-ghost { background: transparent; border-color: transparent; }
body.bar-mode .btn-primary { background: var(--plum-600); border-color: var(--plum-600); color: #fff; }
body.bar-mode .icon-btn:hover { background: rgba(255,255,255,.08); }
body.bar-mode .st-preparing .btn-next { background: #A86400; border-color: #A86400; }
body.bar-mode .st-ready .btn-next { background: var(--st-ready); border-color: var(--st-ready); }
body.bar-mode .order { border-color: var(--line); }
body.bar-mode .order.fresh { border-color: var(--st-new); }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tr.is-off td { opacity: .6; }

/* ---------- menu ---------- */
.menu-sections { display: grid; gap: 22px; }
.menu-cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.cat-head h2 { font-size: 17px; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.drink-list { list-style: none; margin: 0; padding: 0; }
.drink-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.drink-row:last-child { border-bottom: 0; }
.drink-row.is-off .thumb, .drink-row.is-off .drink-info { opacity: .5; }
.thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--plum-50); color: var(--plum); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 40px; height: 40px; }
.drink-info strong { font-size: 15.5px; }
.drink-info p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.avail { min-width: 170px; }
.cat-empty { padding: 16px 20px; color: var(--muted); }
.drink-form { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.drink-form-fields { display: grid; gap: 16px; align-content: start; }
.photo-preview { border: 1.5px dashed var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.photo-preview.drag { border-color: var(--plum); background: var(--plum-50); }
.photo-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-empty { aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; color: var(--plum); }
.photo-empty svg { width: 96px; height: 96px; }
.photo-empty p { color: var(--muted); font-size: 13px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; background: var(--surface); border-top: 1px solid var(--line); }
.glass-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.glass-opt { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--plum); text-align: center; }
.glass-opt input { position: absolute; opacity: 0; }
.glass-opt svg { width: 34px; height: 34px; }
.glass-opt small { color: var(--muted); font-size: 11px; line-height: 1.2; }
.glass-opt:has(input:checked) { border-color: var(--plum); background: var(--plum-50); }
.glass-opt:has(input:focus-visible) { outline: 2px solid var(--focus); }

/* ---------- plan sali ---------- */
.plan-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; font-family: var(--font); }
.plan-svg .room { fill: #FCFCFD; stroke: var(--line-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan-svg .grid { stroke: #EDEFF3; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.plan-svg .table-top > * { fill: #fff; stroke: var(--ink-2); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.plan-svg .chair rect { fill: var(--champ-50); stroke: #C9A66B; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plan-svg .chair rect.back { fill: #E3CC9F; stroke: none; }
.plan-svg .chair text { font-size: 19px; font-weight: 700; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.plan-svg .table-label { font-size: 21px; font-weight: 600; text-anchor: middle; fill: var(--ink); pointer-events: none; }
.plan-svg .decor rect { stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.plan-svg .d-floor rect { fill: #F0E9F1; stroke: #CDB8D0; }
.plan-svg .d-floor .floor-pattern { fill: none; stroke: #DCCBDE; stroke-dasharray: 2 6; }
.plan-svg .d-bar rect { fill: #F6EBD3; stroke: #C9A66B; }
.plan-svg .d-stage rect { fill: #E8EBF2; stroke: #B5BBCB; }
.plan-svg .d-entrance rect { fill: #fff; stroke: var(--muted); stroke-dasharray: 6 5; }
.plan-svg .d-other rect { fill: #EEF2EE; stroke: #B6C3B6; }
.plan-svg .decor-label { font-size: 24px; font-weight: 600; text-anchor: middle; fill: var(--muted); pointer-events: none; }
.plan-svg .item.sel .table-top > *, .plan-svg .decor.sel rect:first-child { stroke: var(--plum); stroke-width: 3; }
.plan-svg .item.sel .chair rect:not(.back) { stroke: var(--plum); }
.plan-svg .chair.hl rect:not(.back) { fill: var(--st-new); stroke: var(--st-new); }
.plan-svg .chair.hl rect.back { fill: #8E1243; }
.plan-svg .chair.hl text { fill: #fff; }
.plan-svg .pulse { fill: var(--st-new); opacity: .25; animation: pulse 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(1.6); opacity: 0; } }
.editor-svg [data-k] { cursor: grab; }
.editor-svg.dragging, .editor-svg.dragging [data-k] { cursor: grabbing; }
.editor-svg.readonly [data-k] { cursor: pointer; }
.plan-preview { height: min(62vh, 560px); background: #FCFCFD; border-radius: var(--r); border: 1px solid var(--line); }

.editor { display: flex; flex-direction: column; height: calc(100vh - 108px); min-height: 520px; }
.editor-toolbar { margin-bottom: 12px; }
.add-menu { display: flex; gap: 8px; flex-wrap: wrap; }
.shape-ic { width: 16px; height: 16px; border: 1.8px solid currentColor; border-radius: 3px; }
.shape-ic.round { border-radius: 50%; }
.shape-ic.rect { width: 20px; height: 12px; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--pop); }
.dropdown.open .dropdown-menu { display: grid; }
.dropdown-menu button { border: 0; background: none; padding: 10px 12px; text-align: left; border-radius: 8px; cursor: pointer; }
.dropdown-menu button:hover { background: var(--surface-2); }
.save-state { font-size: 13px; color: var(--muted); }
.save-state[data-dirty="1"] { color: var(--st-prep); font-weight: 600; }
.lock-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r); background: var(--champ-50); color: #5E4210; font-size: 14px; }
.lock-banner p { flex: 1; }
.editor-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.canvas-col { position: relative; min-height: 0; }
.canvas-wrap { height: 100%; background: #E9EBF0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.zoom-ctrl { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border-radius: 12px; box-shadow: 0 2px 8px rgba(28,32,48,.12); }
.zoom-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.snap-btn[aria-pressed="true"] { background: var(--plum-50); color: var(--plum); }
.zoom-label { min-width: 48px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inspector { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.insp-section { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.insp-section:last-child { border-bottom: 0; }
.insp-section h2 { font-size: 15px; }
.insp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.insp-head h2 { font-size: 18px; }
.insp-summary { color: var(--ink-2); }
.num-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.num-wrap { position: relative; display: block; }
.num-wrap small { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; pointer-events: none; }
.num-wrap input { padding-right: 38px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.stepper-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper-ctrl button { width: 36px; height: 36px; border: 0; background: var(--surface); font-size: 18px; cursor: pointer; }
.stepper-ctrl button:hover:not(:disabled) { background: var(--surface-2); }
.stepper-ctrl button:disabled { color: var(--line-2); cursor: default; }
.stepper-ctrl output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.seats-sides { display: grid; gap: 8px; }
.sides-grid { display: grid; gap: 8px; }
.rot-field { display: grid; gap: 4px; }
.rot-row { display: flex; align-items: center; gap: 10px; }
.rot-row output { min-width: 42px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.insp-actions { display: flex; gap: 8px; }
.guest-list { display: grid; gap: 6px; }
.guest-row { display: flex; align-items: center; gap: 8px; }
.guest-row input { min-height: 36px; padding: 6px 10px; }
.seat-no { min-width: 34px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--champ-50); font-weight: 700; font-size: 13px; }
.order-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.order-list li { display: flex; align-items: center; gap: 4px; }
.order-pick { flex: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--surface-2); cursor: pointer; text-align: left; }
.order-pick:hover { background: var(--plum-50); }
.order-pick small { color: var(--muted); white-space: nowrap; }
.shortcuts summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 13px; }
.shortcuts dt { font-weight: 700; }
.shortcuts dd { margin: 0; color: var(--muted); }

/* ---------- kody QR ---------- */
.qr-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.info-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.info-card > div { flex: 1; display: grid; gap: 4px; }
.info-card .ic { margin-top: 2px; color: var(--muted); }
.info-card.warn { background: #FFF4E5; border-color: #F2CF95; }
.info-card.warn .ic { color: var(--st-prep); }
.info-card.ok .ic { color: var(--st-ready); }
.qr-groups { display: grid; gap: 26px; }
.qr-group h2 { font-size: 16px; margin-bottom: 12px; }
.qr-group h2 .muted { font-weight: 500; font-size: 14px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.qr-img svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.qr-meta { display: grid; line-height: 1.3; }
.qr-meta span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-actions { display: flex; justify-content: space-between; margin: 0 -6px -6px; }
.qr-actions .icon-btn { width: 34px; height: 34px; }

/* ---------- imprezy ---------- */
.events-view .toolbar p { max-width: 560px; }
.event-list { display: grid; gap: 12px; }
.event-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.event-row.is-active { border-color: var(--plum); box-shadow: inset 4px 0 0 var(--plum); }
.event-title { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.event-title h2 { font-size: 18px; }
.event-stats { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.event-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- podsumowanie ---------- */
.summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.summary > div { padding: 16px 18px; border-right: 1px solid var(--line); }
.summary > div:last-child { border-right: 0; }
.summary dt { font-size: 13px; color: var(--muted); }
.summary dd { margin: 4px 0 0; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary dd.small-dd { font-size: 17px; padding-top: 6px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats-grid .panel:nth-child(2) { grid-row: span 1; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 36px; gap: 10px; align-items: center; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--plum); border-radius: 6px; }
.hbar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline svg { width: 100%; height: auto; }
.timeline rect { fill: var(--champ); }
.timeline line { stroke: var(--line-2); }
.timeline text { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.timeline text.peak { text-anchor: end; }
.privacy { margin-top: 18px; }

/* ---------- zespół / ustawienia ---------- */
.role-help { display: grid; gap: 4px; max-width: 640px; font-size: 14px; color: var(--ink-2); }
.settings-view { display: grid; gap: 18px; max-width: 720px; }
.settings-panel { display: grid; gap: 14px; }
.settings-panel h2 { margin: 0; }
.suggest { display: grid; gap: 6px; }
.help summary { cursor: pointer; font-weight: 600; }
.help ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.form-actions { display: flex; justify-content: flex-end; }

/* ---------- responsywność ---------- */
@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr 1fr; }
  .col-ready { grid-column: span 2; }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .summary > div:nth-child(3) { border-right: 0; }
  .summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .stats-grid { grid-template-columns: 1fr; }
  .editor-body { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) auto; }
  .editor { height: auto; }
  .canvas-wrap { height: 60vh; }
  .inspector { max-height: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; padding-bottom: 68px; }
  .sidebar { display: none; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 12px 16px 4px; position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .topbar h1 { font-size: 20px; }
  .topbar-sub { display: block; }
  .live span { display: none; }
  .view { padding: 8px 14px 32px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar .nav-link { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11.5px; text-align: center; }
  .tabbar .nav-text { display: none; }
  .tabbar .nav-short { display: block; }
  .tabbar .nav-link.active { background: var(--plum-50); color: var(--plum); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .board { grid-template-columns: 1fr; }
  .col-ready { grid-column: auto; }
  .col { min-height: 0; }
  .toolbar > select, .event-select, .search { min-width: 0; max-width: none; flex: 1 1 100%; }
  .drink-row { grid-template-columns: 56px minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
  .thumb { width: 56px; height: 56px; }
  .avail { grid-column: 2; min-width: 0; }
  .drink-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: -6px; }
  .drink-form, .form-cols, .qr-info { grid-template-columns: 1fr; }
  .drink-form-photo { max-width: 240px; }
  .glass-pick { grid-template-columns: repeat(4, 1fr); }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .modal-back { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-body { padding: 8px 18px 18px; }
  .orders-view .toolbar { gap: 6px; }
  .orders-view .toolbar-spacer { display: none; }
  .orders-view .ordering-switch { flex: 1 1 100%; }
  .orders-view .segmented { flex: 1; }
  .orders-view .segmented button { flex: 1; padding: 7px 8px; }
  .orders-view .toolbar .btn-ghost { font-size: 0; gap: 0; padding: 8px 10px; min-width: 42px; }
  .orders-view .toolbar .btn-ghost .ic { width: 20px; height: 20px; }
  .hbars li { grid-template-columns: minmax(90px, 40%) 1fr 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
