/* OISEN Cloud: panel administracyjny. Jasny motyw, pasek boczny, karty, tabele, formularze. */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e3e7ed;
  --line-strong: #cfd6df;
  --text: #141821;
  --text-2: #3a4351;
  --muted: #687385;
  --accent: #2759d6;
  --accent-hover: #1f4ab5;
  --accent-soft: #eaf0fd;
  --accent-soft-2: #b9cbf5;
  --ok: #0f8a4a; --ok-soft: #e4f5ec;
  --bad: #c4321f; --bad-soft: #fcebe8;
  --warn: #a15c07; --warn-soft: #fdf2e1;
  --info: #2759d6; --info-soft: #eaf0fd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18);
  --top-h: 60px;
  --side-w: 236px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, video, svg { max-width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; line-height: 1.35; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
pre { margin: 0; }
details summary { cursor: pointer; }

/* ---------- pomocnicze ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.error-text { color: var(--bad); font-size: 13px; }
.clickable { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.loading { color: var(--muted); padding: 24px 0; }
.loading-full { min-height: 100vh; display: grid; place-items: center; padding: 0; }

/* ---------- układ: pasek górny, boczny, treść ---------- */
.shell { min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), transparent var(--side-w));
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--top-h) 1fr; grid-template-areas: "top top" "side main"; }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; height: var(--top-h);
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 18px; line-height: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #111827; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .08); }
.topbar-tenant { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.topbar-tenant .input { width: auto; max-width: 320px; padding-top: 6px; padding-bottom: 6px; font-weight: 600; }
.tenant-name { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); flex: none; }
.lang-switch button { border: 0; background: transparent; padding: 5px 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button.active { background: var(--accent-soft); color: var(--accent); }
.user-link { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; color: var(--text); font-weight: 600; font-size: 13px; max-width: 220px; }
.user-link:hover { text-decoration: none; color: var(--accent); }
.user-link, .user-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-link small { color: var(--muted); font-weight: 500; font-size: 11.5px; max-width: 100%; }

.sidebar { grid-area: side; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 16px 12px 24px;
  background: var(--surface); border-right: 1px solid var(--line); align-self: start; }
.nav-group { margin-bottom: 14px; }
.nav-group-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon { width: 20px; text-align: center; font-size: 15px; opacity: .75; flex: none; }
.nav-item.active .nav-icon { opacity: 1; }

.content { grid-area: main; min-width: 0; padding: 28px 32px 56px; }

/* ---------- nagłówek strony ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head > div:first-child { min-width: 0; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions:empty { display: none; }

/* ---------- przyciski ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad-soft); border-color: #f4c7c0; color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad); border-color: var(--bad); color: #fff; }
.modal-foot .btn-danger:last-child { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.btn-row > .field { margin: 0; }
td.nowrap > .btn + .btn, td.nowrap > .btn + span + .btn { margin-left: 6px; }
.table td.nowrap:last-child { text-align: right; }
.link { background: none; border: 0; padding: 0 2px; color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link.active { color: var(--text); font-weight: 700; }

/* ---------- formularze ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; min-width: 0; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.field-inline .input { width: 84px; }
.input { display: block; width: 100%; min-height: 36px; padding: 7px 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  color: var(--text); line-height: 1.35; transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: #9aa3b1; }
.input:hover { border-color: #b8c1cc; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39, 89, 214, .15); }
.input[readonly] { background: var(--surface-2); }
select.input { padding-right: 30px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--surface) 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='%23687385' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea.input { resize: vertical; min-height: 72px; }
.input.search { width: 260px; max-width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-start; }
.row > .field, .row > .grow { flex: 1 1 190px; }
.row > .toggle { flex: 1 1 190px; align-self: center; }
.row-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; min-height: 36px; align-items: center; }
.check, .radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.copy-field { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.copy-field .input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.toggle { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 14px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; flex: none; width: 36px; height: 20px; margin-top: 1px; border-radius: 10px; background: #cdd3dc; transition: background .15s; }
.toggle-dot { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-dot { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-text { font-size: 14px; font-weight: 500; color: var(--text); }
.toggle-text small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.color-input { display: flex; align-items: center; gap: 8px; }
.color-input input[type="color"] { flex: none; width: 38px; height: 36px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-input .input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.i18n-field { margin-bottom: 14px; }
.i18n-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.i18n-col { position: relative; min-width: 0; }
.lang-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.lang-badge em { font-style: normal; font-weight: 600; letter-spacing: 0; color: var(--warn); }
.i18n-col.missing .input { border-color: #f0c98d; background: #fffcf6; }

/* ---------- karty ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.card > h2:first-child { margin-top: 0; }
a.card { color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.card:hover { text-decoration: none; border-color: var(--accent-soft-2); box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cards > .card { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.grid-2 > .card { margin: 0; }
.stat-card { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12.5px; color: var(--muted); }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sub-head h2, .sub-head h3 { margin: 0; }
.sub-head .btn-row { margin: 0; }
.sub-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
details.more { border-top: 1px solid var(--line); padding: 12px 0 2px; margin-top: 8px; }
details.more > summary { font-weight: 650; font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }

.bar { display: block; height: 6px; border-radius: 3px; background: #e9edf2; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.bar > span.bar-warn { background: #e2861a; }
.bar-small { width: 140px; flex: none; }
.stat-card .bar { margin-top: 6px; }

/* ---------- odznaki, alerty, puste stany ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6;
  background: #eef1f5; color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.badge + .badge { margin-left: 4px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-ok::before, .badge-bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok::before { box-shadow: 0 0 0 3px rgba(15, 138, 74, .15); }
.alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border-radius: 10px; background: var(--info-soft); color: #1d3f94; border: 1px solid #d3def9; }
.alert-error { background: var(--bad-soft); color: #8f2414; border-color: #f4c7c0; }
.empty { padding: 32px 20px; margin-bottom: 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.card .empty, .modal .empty, .pl-items .empty { background: var(--surface-2); }

/* ---------- tabele i listy ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.table-wrap:has(> .table > tbody:empty) { display: none; }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table td .badge { margin-left: 6px; }
.table td .badge:first-child { margin-left: 0; }
.table-compact td { padding: 7px 10px; }
.table-compact th { padding: 8px 10px; }
.card > .table, .card > section > .table { margin: 0 0 8px; }
.card .table th { background: transparent; }
tr.clickable { cursor: pointer; }
tr.row-off td { color: var(--muted); }
tr.row-off td > * { opacity: .75; }
.barcell { width: 45%; }
.table.matrix th, .table.matrix td { text-align: center; }
.table.matrix th:first-child, .table.matrix tbody th { text-align: left; color: var(--text-2); background: var(--surface-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list li > :nth-child(2) { flex: 1 1 auto; min-width: 0; }
.list li > a:first-child { font-weight: 600; }
.list li > b:last-child { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.list li .btn-row { margin: 0; }
.list.small li { padding: 7px 0; }
ol.list-num { counter-reset: pos; }
.list-num li::before { counter-increment: pos; content: counter(pos); flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 6px 0; padding-left: 4px; }
.dl { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 9px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre.contact { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; margin-bottom: 12px; }
.role-help { display: grid; gap: 4px; }
.role-help p { margin: 0; font-size: 13px; color: var(--text-2); }

/* ---------- pasek narzędzi, zakładki ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: #e8ecf1; }
.tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs-spaced { margin-bottom: 16px; }
.filters .btn-row { margin-top: 2px; }
.filters > .btn { margin-top: 2px; }

/* ---------- okna dialogowe i powiadomienia ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 20px; background: rgba(16, 24, 40, .48);
  overflow-y: auto; animation: fade .12s ease; }
.modal { width: min(580px, 100%); max-height: calc(100vh - 8vh - 20px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: pop .14s ease; }
.modal-wide { width: min(940px, 100%); }
.modal-full { width: 96vw; max-height: 94vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.modal-foot .grow { flex: 1 1 auto; }
.confirm-text { margin: 0; font-size: 15px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { max-width: min(380px, calc(100vw - 40px)); padding: 11px 16px; border-radius: 10px; background: #141821; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .16s ease; }
.toast-ok::before { content: "✓"; margin-right: 8px; color: #6ee7a6; font-weight: 700; }
.toast-error { background: #a8291a; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---------- logowanie ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #dfe7fb 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e4ecf8 0%, transparent 55%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 30px 24px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 6px 0 4px; }
.login-card > .muted { margin-bottom: 22px; }
.login-card > .btn { width: 100%; min-height: 42px; margin-top: 6px; }
.brand-login { font-size: 18px; margin-bottom: 22px; }
.login-lang { display: flex; justify-content: center; gap: 14px; margin-top: 18px; font-size: 13px; }
/* stopka: operator usługi (OISEN Cloud to usługa LEDSEE Multimedia) */
.app-foot { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.login-card .app-foot { margin-top: 18px; padding-top: 12px; text-align: center; }

/* ---------- urządzenia ---------- */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.device-grid:empty { display: none; }
.device-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.device-card .small { color: var(--text-2); }
.device-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 15px; line-height: 1.35; }
.device-top b { min-width: 0; overflow-wrap: anywhere; }
.device-top .badge { flex: none; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 4px; }
.cmd-grid .btn { justify-content: flex-start; white-space: normal; text-align: left; }
.screenshot { margin-top: 16px; }
.screenshot img { display: block; margin-top: 6px; max-width: 100%; max-height: 520px; width: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #000; }
.kiosk-preview { margin-top: 14px; overflow: hidden; border-radius: 10px; background: #000; box-shadow: 0 0 0 6px #1d2129, var(--shadow); max-width: 100%; }
.kiosk-preview iframe { border: 0; display: block; transform-origin: 0 0; }

/* ---------- multimedia ---------- */
.storage-card { padding: 14px 18px; }
.storage-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13.5px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 20px; margin-bottom: 16px; text-align: center; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius); transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone b::before { content: "⇪"; display: block; font-size: 22px; color: var(--accent); margin-bottom: 4px; }
.upload-queue { padding: 10px 16px; }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.media-grid-pick { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.media-cell { display: flex; flex-direction: column; gap: 3px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-width: 0;
  transition: border-color .12s, box-shadow .12s; }
.media-cell:hover { border-color: var(--accent-soft-2); box-shadow: var(--shadow); }
.media-cell.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.media-cell .thumb { width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; margin-bottom: 5px; }
.media-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-preview { display: grid; place-items: center; margin-bottom: 16px; background: #eef1f5; border-radius: 10px; overflow: hidden; }
.media-preview img, .media-preview video { display: block; max-height: 360px; width: auto; max-width: 100%; }
.media-preview a { padding: 30px; }
.thumb { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: var(--radius-sm); background: #e9edf2; vertical-align: middle; }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.selected { box-shadow: 0 0 0 2px var(--accent); }
.thumb-missing { color: var(--muted); font-weight: 700; }
.thumb-doc { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #b42318; background: #fff; padding: 4px 8px; border-radius: 6px; box-shadow: var(--shadow-sm); }
.thumb-tag { position: absolute; left: 5px; top: 5px; padding: 1px 6px; border-radius: 6px; background: rgba(17, 24, 39, .78); color: #fff; font-size: 10.5px; font-weight: 700; }
.thumb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 28px; height: 28px; padding-left: 2px; border-radius: 50%;
  background: rgba(17, 24, 39, .65); color: #fff; font-size: 11px; }
.picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.picker-item { position: relative; display: inline-flex; }
.picker-remove { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); font-size: 13px; line-height: 1; box-shadow: var(--shadow-sm); }
.picker-remove:hover { color: var(--bad); border-color: var(--bad); }
.picker-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

/* ---------- kafelki (drzewo i edytor) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.split-side { position: sticky; top: calc(var(--top-h) + 16px); min-width: 0; }
.split-side > .card { margin: 0; }
.tree-card { padding: 12px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 8px; padding-top: 6px; padding-bottom: 6px; padding-right: 8px; border-radius: var(--radius-sm); border: 1px solid transparent; min-width: 0; }
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.tree-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.tree-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.tree-row.drop-inside { border: 1px dashed var(--accent); background: var(--accent-soft); }
.tree-row.hidden-tile .tree-title { opacity: .55; }
.drag-handle { cursor: grab; color: #a5aebb; font-size: 14px; user-select: none; flex: none; }
.tree-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 0; text-align: left; font-weight: 550; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kind-chip { flex: none; display: inline-block; padding: 1px 7px; border-radius: 6px; background: #eef1f5; color: var(--muted); font-size: 11px; font-weight: 650; }
.tree-badges { display: flex; gap: 4px; flex: none; }
.tree-tools { display: flex; gap: 2px; flex: none; opacity: .45; transition: opacity .12s; }
.tree-row:hover .tree-tools, .tree-row.active .tree-tools { opacity: 1; }
.tree-tools button, .pl-tools button { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 13px; line-height: 1; }
.tree-tools button:hover:not(:disabled), .pl-tools button:hover { border-color: var(--accent); color: var(--accent); }
.tree-tools button:disabled { opacity: .35; }
.editor { padding-top: 14px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.editor-head h2 { margin: 0; }
.editor-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kind-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.kind-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.kind-card b { font-size: 14px; }
.kind-card span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.answer-row { display: flex; align-items: flex-start; gap: 10px; }
.answer-row > .i18n-field { flex: 1 1 auto; min-width: 0; margin-bottom: 8px; }
.answer-row > .radio { margin-top: 26px; flex: none; }
.answer-row > .link { margin-top: 28px; font-size: 18px; color: var(--muted); }
.qr { display: inline-block; flex: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.map-edit { margin-bottom: 12px; }
.map-canvas { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.map-canvas img { display: block; max-width: 100%; }
.map-pin { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.map-pin.active { background: #141821; }

/* ---------- plansze i kreator ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.board-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.board-card > a { display: flex; justify-content: center; padding: 14px; background: #eef1f5; border-radius: 10px; }
.board-preview { overflow: hidden; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .06); background: #fff; flex: none; }
.board-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.board-meta b { font-size: 15px; }
.board-meta .btn-row { margin-top: 8px; }
.layout-card { display: flex; gap: 16px; align-items: flex-start; }
.el-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #8a94a3; font: 700 40px/1 var(--font); letter-spacing: .1em;
  background: repeating-linear-gradient(45deg, #eceff3 0 18px, #e2e6ec 18px 36px); }
.qr-fill svg { display: block; width: 100%; height: 100%; }
.creator { display: flex; flex-direction: column; gap: 12px; }
.creator-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.creator-bar .toggle { margin: 0 4px; align-items: center; }
.creator-title { font-size: 15px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirty { color: #e2861a; }
.creator-add { display: flex; flex-wrap: wrap; gap: 4px; }
.creator-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.creator-canvas-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 20px; background: #e6eaf0; border-radius: var(--radius); overflow: auto; }
.creator-canvas-wrap .hint { margin: 0; text-align: center; }
.creator-canvas-outer { position: relative; flex: none; box-shadow: 0 6px 24px rgba(16, 24, 40, .18); }
.creator-canvas { position: relative; transform-origin: 0 0; overflow: hidden; user-select: none; }
.creator-canvas.grid::after { content: ""; position: absolute; inset: 0; z-index: 9000; pointer-events: none;
  background-image: linear-gradient(rgba(39, 89, 214, .10) 2px, transparent 2px), linear-gradient(90deg, rgba(39, 89, 214, .10) 2px, transparent 2px); background-size: 60px 60px; }
.el { cursor: move; touch-action: none; }
.el:hover { outline: 3px dashed rgba(39, 89, 214, .45); outline-offset: -3px; }
.sel-frame { position: absolute; z-index: 9500; pointer-events: none; border: calc(3px * var(--inv, 1)) solid var(--accent); }
.handle { position: absolute; pointer-events: auto; width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1)); background: #fff; border: calc(2px * var(--inv, 1)) solid var(--accent);
  border-radius: calc(3px * var(--inv, 1)); transform: translate(-50%, -50%); touch-action: none; }
.h-nw { left: 0; top: 0; cursor: nwse-resize; } .h-n { left: 50%; top: 0; cursor: ns-resize; } .h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.h-e { left: 100%; top: 50%; cursor: ew-resize; } .h-se { left: 100%; top: 100%; cursor: nwse-resize; } .h-s { left: 50%; top: 100%; cursor: ns-resize; }
.h-sw { left: 0; top: 100%; cursor: nesw-resize; } .h-w { left: 0; top: 50%; cursor: ew-resize; }
.creator-side { margin: 0; max-height: calc(100vh - var(--top-h) - 120px); overflow-y: auto; position: sticky; top: calc(var(--top-h) + 16px); }
.creator-side h3 { margin-top: 0; }
.layers { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.layers .field-label { margin-bottom: 6px; }
.layer-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13px; min-width: 0; }
.layer-row:hover { background: var(--surface-2); }
.layer-row.active { background: var(--accent-soft); }

/* ---------- układy ekranu ---------- */
.tpl-thumb { display: block; flex: none; }
.tpl-zone { fill: #e3e8ef; stroke: #c3cbd6; stroke-width: .8; }
.tpl-main, .tpl-a { fill: #d3dbe7; }
.tpl-thumb.active .tpl-zone { fill: var(--accent-soft); stroke: var(--accent); }
.tpl-thumb text { display: none; } /* angielskie klucze stref; nazwy stref są w edytorze */
.tpl-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 16px; }
.tpl-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 132px; padding: 12px 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tpl-btn span { font-size: 12px; line-height: 1.3; text-align: center; color: var(--text-2); }
.tpl-btn:hover { border-color: var(--accent-soft-2); }
.tpl-btn.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- playlisty ---------- */
.pl-items { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.pl-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.pl-item.dragging { opacity: .45; }
.pl-item > .input { width: 200px; flex: none; }
.pl-item .field { margin: 0; }
.pl-item .grow .toggle { margin: 6px 0 0; }
.pl-num { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: #eef1f5; font-size: 12px; font-weight: 700; color: var(--muted); }
.pl-tools { display: flex; gap: 3px; flex: none; }

/* ---------- harmonogramy ---------- */
.week { display: grid; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-hours { position: relative; height: 336px; margin-top: 30px; }
.week-hours span { position: absolute; right: 4px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-day { min-width: 0; }
.week-head { height: 24px; margin-bottom: 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.week-col { position: relative; height: 336px; border-radius: var(--radius-sm); background-color: var(--surface-2); border: 1px solid var(--line);
  background-image: linear-gradient(to bottom, transparent calc(25% - 1px), var(--line) 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), var(--line) 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), var(--line) 75%, transparent calc(75% + 1px)); }
.week-block { position: absolute; left: 3px; right: 3px; padding: 3px 6px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.25; overflow: hidden;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); white-space: nowrap; text-overflow: ellipsis; }
.week-block:hover { filter: brightness(1.08); }
.week + .hint { margin-top: 16px; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 16px; }
.day-picker button { min-width: 48px; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; color: var(--text-2); }
.day-picker button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- statystyki ---------- */
.chart-wrap { overflow-x: auto; padding: 0 16px; }
/* wykres ma preserveAspectRatio=none: szerokość z proporcji viewBox, żeby podpisy dni się nie rozciągały; szerszy zakres przewija się w poziomie */
.chart { display: block; width: auto; max-width: none; height: 230px; overflow: visible; }
/* do 16 dni kod podpisuje każdy słupek i podpisy nachodzą na siebie: zostaw co drugi */
.chart:not(:has(g:nth-of-type(17))) g:nth-of-type(even) .chart-label { display: none; }
.chart-grid { stroke: #e6e9ee; stroke-width: 1; }
.chart-bar { fill: var(--accent-soft-2); }
.chart-bar2 { fill: var(--accent); }
.chart-label { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg1 { background: var(--accent-soft-2); }
.lg2 { background: var(--accent); margin-left: 10px; }

/* ---------- ustawienia: podgląd wyglądu ---------- */
.theme-preview { width: 100%; max-width: 280px; margin-top: 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; min-height: 42px; }
.tp-head img { max-height: 24px; width: auto; }
.tp-lang { font-size: 11px; color: rgba(255, 255, 255, .8); }
.tp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.tp-tile { aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; }
.tp-photo { background: linear-gradient(160deg, #c8ced8, #8c96a5); border-color: transparent !important; }
.tp-outline { background: transparent; }
.tp-partner { margin: 0 12px 12px; padding: 10px; border-radius: 8px; color: #fff; text-align: center; font-size: 13px; font-weight: 600; }

/* ---------- ekran średni ---------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: 1fr; }
  .split-side { position: static; }
  .creator-main { grid-template-columns: 1fr; }
  .creator-side { position: static; max-height: none; }
}
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- telefon i tablet: menu wysuwane ---------- */
@media (max-width: 900px) {
  :root { --top-h: 104px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; background: none; }
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 56px 48px; grid-template-areas: "toggle brand right" "tenant tenant tenant";
    gap: 0 12px; padding: 0 14px; }
  .nav-toggle { grid-area: toggle; display: inline-grid; place-items: center; }
  .brand { grid-area: brand; min-width: 0; }
  .topbar-right { grid-area: right; gap: 8px; }
  .topbar-tenant { grid-area: tenant; align-self: stretch; border-left: 0; padding: 0; margin: 0; border-top: 1px solid var(--line); }
  .topbar-tenant .input { width: 100%; max-width: none; }
  .sidebar { position: fixed; z-index: 35; top: var(--top-h); left: 0; bottom: 0; height: auto; width: min(280px, 84vw); transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 20px 16px 48px; }
  .page-head { align-items: flex-start; margin-bottom: 18px; }
  .user-link { display: block; max-width: 120px; text-align: right; }
  .user-link small { display: none; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal-wide, .modal-full { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-foot { border-radius: 0; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .brand > span:not(.brand-mark) { display: none; }
  .topbar-right .btn { padding: 4px 8px; }
  h1 { font-size: 20px; }
  .card { padding: 16px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cards > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .user-link { max-width: 84px; }
  .stat-value { font-size: 22px; }
  .stat-card { padding: 14px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .input.search { width: 100%; }
  .page-actions { width: 100%; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .device-grid { grid-template-columns: 1fr; }
  .pl-item > .input { width: 100%; }
  .week { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 3px; }
  .week-block { padding: 6px 0; font-size: 10.5px; writing-mode: vertical-rl; display: flex; align-items: center; }
  .tree-tools { opacity: 1; }
}

/* ---------- OISEN Cloud: parowanie, sterowanie Android, harmonogram zasilania ---------- */
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 28px; letter-spacing: .18em; text-transform: uppercase; text-align: center; padding: 10px 12px; }
.level-controls { display: grid; gap: 10px; margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.level-row { display: grid; grid-template-columns: 90px 1fr 48px auto; align-items: center; gap: 12px; }
.level-row .field-label { margin: 0; }
.level-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.level-value { text-align: right; font-variant-numeric: tabular-nums; }
.power-schedule { display: grid; gap: 12px; margin-bottom: 12px; }
.power-rule { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.power-rule .row { align-items: flex-end; }
@media (max-width: 640px) {
  .level-row { grid-template-columns: 1fr auto; }
  .level-row input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
}

/* ======================================================================
   Wyświetl (szybka emisja) i panel na telefonie. Projektowane od 390 px w górę:
   kroki jeden pod drugim, pola dotyku min. 44 px, przycisk wysyłki przyklejony nad dolnym paskiem.
   ====================================================================== */
.show { max-width: 760px; margin: 0 auto; padding-bottom: 96px; }
.show-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.01em; margin: 4px 0 6px; }
.show-head p { margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.show-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.show-step h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 14px; }
.step-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: #fff; font-size: 13px; font-weight: 700; flex: none; }

.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-big { display: grid; justify-items: start; gap: 2px; text-align: left; padding: 16px; min-height: 108px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.pick-big:hover, .pick-big:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.pick-big:active { transform: scale(.99); }
.pick-big svg { width: 28px; height: 28px; margin-bottom: 8px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.pick-big b { font-size: 15px; }
.pick-big span { color: var(--muted); font-size: 13px; }

.show-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.show-items li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.show-items li.has-error { border-color: var(--bad); background: var(--bad-soft); }
.item-thumb, .item-thumb .thumb, .item-thumb img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); }
.item-video { font-size: 11px; color: var(--muted); }
.item-body { display: grid; gap: 4px; min-width: 0; }
.item-body b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-progress { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.item-progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.item-warn { color: var(--warn); font-size: 13px; line-height: 1.35; }
.item-error { color: var(--bad); font-size: 13px; }
.item-actions { display: flex; gap: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.chip-row:first-child { margin-top: 0; }
.chip-label { color: var(--muted); font-size: 13px; margin-right: 2px; }
.chip { min-height: 40px; padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--text-2); }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.input-time { width: auto; min-height: 40px; }

.screen-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 14px; }
.screen-pick { display: grid; gap: 8px; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.screen-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.screen-shot { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #0b1220; }
.screen-shot.portrait { aspect-ratio: 9 / 16; max-height: 180px; }
.screen-shot.landscape { aspect-ratio: 16 / 9; }
.screen-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-tick { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .9); border: 1.5px solid var(--line-strong); }
.pick-tick svg { width: 14px; height: 14px; fill: none; stroke: transparent; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.screen-pick.on .pick-tick { background: var(--accent); border-color: var(--accent); }
.screen-pick.on .pick-tick svg { stroke: #fff; }
.screen-name { display: flex; align-items: center; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-name .dot, .device-card .dot { width: 8px; height: 8px; margin-right: 6px; flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--line-strong); }

.show-bar { position: sticky; bottom: 0; z-index: 20; margin: 0 -2px; padding: 12px 2px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(244, 246, 249, 0)); }
.show-send { width: 100%; min-height: 54px; font-size: 16px; font-weight: 600; border-radius: 14px; }

.show-live { margin-bottom: 18px; }
.show-live h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.show-live ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.show-live li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.live-body { display: grid; gap: 3px; min-width: 0; }
.live-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.show-done { text-align: center; padding: 36px 20px; margin-bottom: 18px; }
.show-done h1 { font-size: 22px; margin: 14px 0 6px; }
.show-done p { color: var(--muted); margin: 0 auto 20px; max-width: 420px; }
.done-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); }
.done-mark svg { width: 32px; height: 32px; fill: none; stroke: var(--ok); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-row.center { justify-content: center; }

.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.library-item { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.library-item .thumb { width: 100% !important; height: auto !important; aspect-ratio: 1; border-radius: 8px; }
.library-item.on { border-color: var(--accent); }
.library-n { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

/* ściana ekranów: miniatura na karcie urządzenia */
.device-card .device-shot { display: block; margin: -4px -4px 10px; border-radius: 8px; overflow: hidden; background: #0b1220; aspect-ratio: 16 / 9; }
.device-card .device-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* dolny pasek zakładek i menu „Więcej” (tylko telefon) */
.tabbar, .nav-mobile-only, .nav-scrim { display: none; }
@media (max-width: 900px) {
  .single-tenant { --top-h: 56px; }
  .single-tenant .topbar { grid-template-rows: 56px; grid-template-areas: "brand tenant right"; grid-template-columns: auto minmax(0, 1fr) auto; }
  .single-tenant .topbar-tenant { border-top: 0; align-self: center; text-align: right; overflow: hidden; }
  .single-tenant .tenant-name { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .single-tenant .topbar-right { display: none; }
  .nav-toggle { display: none !important; }
  .topbar .lang-switch { display: none; }
  .nav-mobile-only { display: block; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
  .nav-mobile-only button.nav-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 34; background: rgba(11, 18, 32, .35); }
  .content { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; min-height: 52px; border: 0; background: none; border-radius: 10px;
    color: var(--muted); font: 600 11px/1.2 var(--font); text-decoration: none; cursor: pointer; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active svg { stroke-width: 2.2; }
  .show-bar { bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 12px; }
  .show { padding-bottom: 24px; }
}
@media (max-width: 520px) {
  .show-head h1 { font-size: 23px; }
  .show-step { padding: 16px 14px; border-radius: 14px; }
  .pick-big { min-height: 120px; padding: 14px; }
  .screen-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .show-items li { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .item-thumb, .item-thumb .thumb, .item-thumb img { width: 48px; height: 48px; }
  .icon-btn { width: 34px; height: 40px; }
}
.shot-none { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; color: #8b95a7; font-size: 11px; line-height: 1.3; }
.screen-shot.portrait { width: 100%; }

/* raport emisji */
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kpi b { font-size: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 13px; }
.plays-list { list-style: none; margin: 0; padding: 0; }
.plays-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plays-list li:last-child { border-bottom: 0; }
.plays-name, .plays-num { display: grid; gap: 2px; min-width: 0; }
.plays-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plays-num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb-doc-sm { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--surface-2); font-size: 10px; color: var(--muted); }
.plays .chip-row .input { width: auto; min-height: 40px; }
.print-only { display: none; }
@media (max-width: 520px) { .kpi-row { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 20px; } }
@media print {
  .topbar, .sidebar, .tabbar, .no-print, .nav-scrim, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .print-head { font-weight: 600; margin: 0 0 8px; }
}

/* szablony plansz */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.tpl-pick { display: grid; justify-items: center; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.tpl-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-pick .board-preview { border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.tpl-grid.landscape { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); }

/* Wyświetl: plansze, gotowa playlista/układ, dni tygodnia (02.11.2026) */
.show-items .item-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.show-items .item-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.show-items .item-thumb .board-preview { margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
.board-pick-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.library-item.board-pick { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 10px; height: auto; aspect-ratio: auto; }
.board-pick .board-preview { box-shadow: 0 0 0 1px var(--line); }
.board-pick-name { font-size: 13px; color: var(--text); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pick-head { font-size: 14px; margin: 16px 0 6px; }
.whole-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.whole-list button { width: 100%; display: grid; gap: 2px; text-align: left; padding: 12px 14px; min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.whole-list button:hover, .whole-list button:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 440px; }
.chip.chip-day { min-width: 0; padding: 8px 0; text-align: center; }
.live-board { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg, #f3f4f6); }

/* ---------- bezpieczeństwo kont (etap C): logowanie, 2FA ---------- */
.login-links { display: flex; justify-content: center; margin-top: 14px; font-size: 14px; }
.login-card-wide { width: min(560px, 100%); }
.login-card-wide .card { border: 0; box-shadow: none; padding: 0; margin: 12px 0 0; }
.twofa-qr { display: flex; justify-content: center; margin: 12px 0; }
.twofa-qr .qr { background: #fff; padding: 8px; border-radius: 8px; box-sizing: content-box; }
.backup-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; list-style: none; padding: 0; margin: 12px 0; }
.backup-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .04em; }

/* Etap G (03.11.2026): co gra teraz, oś czasu doby, wpływ zapisu, opcje pozycji playlisty, pilny komunikat, dźwięk */
.now-card .now-line { margin: 0 0 8px; line-height: 1.5; }
.now-card.now-takeover { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.now-others summary { cursor: pointer; color: var(--accent); font-size: 13.5px; margin: 4px 0; }
.now-others .list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.webview-warn { margin-top: 4px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.audio-controls .toggle { margin-bottom: 10px; }
.audio-controls .level-row { margin-top: 6px; }
.input-date { width: auto; min-width: 150px; }
.tl { position: relative; margin: 8px 0 4px; }
.tl-bar { position: relative; display: flex; height: 46px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.tl-run { position: relative; flex: none; min-width: 0; height: 100%; margin: 0; padding: 0 4px; border: 0; border-right: 1px solid rgba(255, 255, 255, .55); color: #fff; font: inherit; font-size: 11.5px; font-weight: 600; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.tl-run span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tl-run.tl-auto { background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 6px, #e4e8ee 6px, #e4e8ee 12px); color: var(--muted); cursor: default; }
.tl-run.tl-conflict { box-shadow: inset 0 -6px 0 var(--bad); }
.tl-run:hover:not(:disabled) { filter: brightness(1.08); }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; }
.tl-hours { position: relative; height: 18px; margin-top: 4px; }
.tl-hours span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-hours span:first-child { transform: none; }
.tl-hours span:last-child { transform: translateX(-100%); }
.tl-conflicts { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.impact { margin: 12px 0 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.impact p { margin: 4px 0 0; }
.impact-over { color: var(--text); }
.impact-lose { color: var(--warn); }
.pl-options { flex: 1 1 100%; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pl-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pl-tools button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pl-defaults { margin-top: 10px; }
.pl-defaults .input { width: 90px; }
.url-preview { width: 320px; height: 180px; margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.url-preview iframe { width: 1280px; height: 720px; border: 0; transform: scale(.25); transform-origin: 0 0; }
.show-head .urgent-btn { margin: -8px 0 18px; }
.live-takeover { border-color: var(--bad) !important; background: var(--bad-soft) !important; }
.chip.chip-color { width: 40px; min-width: 40px; padding: 0; border: 2px solid transparent; }
.chip.chip-color.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.urgent-preview { display: flex; align-items: center; justify-content: center; min-height: 140px; margin-top: 16px; padding: 18px; border-radius: var(--radius); font-size: 22px; font-weight: 700; line-height: 1.2; text-align: center; white-space: pre-wrap; word-break: break-word; }
