:root {
  color-scheme: light;
  --bg: #f4f5f3;
  --surface: #ffffff;
  --surface-2: #f8f9f7;
  --surface-3: #eef0ec;
  --border: rgba(11, 11, 11, 0.09);
  --border-strong: rgba(11, 11, 11, 0.16);
  --text: #111b21;
  --text-2: #4f5a60;
  --muted: #8a9196;
  --accent: #128c5e;
  --accent-strong: #0b6b47;
  --accent-soft: #e2f4ec;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-note: #fff6d6;
  --chat-bg: #efeae2;
  --danger: #d03b3b;
  --danger-soft: #fdeaea;
  --warning: #b77900;
  --warning-soft: #fff4dc;
  --info: #2a78d6;
  --read: #2a9cf0;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e1e0d9;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --nav-w: 250px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0d1418;
    --surface: #111b21;
    --surface-2: #17222a;
    --surface-3: #202c33;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e9edef;
    --text-2: #aebac1;
    --muted: #7d8a91;
    --accent: #21c07a;
    --accent-strong: #3fd894;
    --accent-soft: #123a2c;
    --bubble-in: #202c33;
    --bubble-out: #005c4b;
    --bubble-note: #3b3418;
    --chat-bg: #0b141a;
    --danger: #e66767;
    --danger-soft: #3a1c1c;
    --warning: #e6a23c;
    --warning-soft: #3a2f16;
    --read: #53bdeb;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #2c2c2a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d1418;
  --surface: #111b21;
  --surface-2: #17222a;
  --surface-3: #202c33;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9edef;
  --text-2: #aebac1;
  --muted: #7d8a91;
  --accent: #21c07a;
  --accent-strong: #3fd894;
  --accent-soft: #123a2c;
  --bubble-in: #202c33;
  --bubble-out: #005c4b;
  --bubble-note: #3b3418;
  --chat-bg: #0b141a;
  --danger: #e66767;
  --danger-soft: #3a1c1c;
  --warning: #e6a23c;
  --warning-soft: #3a2f16;
  --read: #53bdeb;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #2c2c2a;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Formularze i przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px;
  padding: 8px 10px; outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.input { resize: vertical; min-height: 70px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.segmented { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 550; font-size: 13px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--accent-soft); color: var(--accent-strong); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.yellow { background: var(--warning-soft); color: var(--warning); }
.badge.count { background: var(--accent); color: #fff; min-width: 20px; justify-content: center; padding: 1px 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.online { background: #0ca30c; }
.dot.offline { background: var(--muted); opacity: 0.5; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--surface)); color: var(--c, var(--accent));
  font-weight: 700; font-size: 15px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 46px; height: 46px; opacity: 0.4; margin-bottom: 8px; }

/* ---------- Szkielet aplikacji ---------- */
.shell { display: flex; height: 100vh; height: 100dvh; }
.nav {
  width: var(--nav-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand-logo svg { width: 19px; height: 19px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 550; margin-bottom: 2px;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav a .badge { margin-left: auto; }
/* Przyciski „Zrób kamerkę” i „Zrealizuj kod” – wyróżnione i wyśrodkowane, bo VA otwiera je na początku pracy */
#nav-rdp:empty { display: none; }
.nav a.nav-rdp {
  position: relative; justify-content: center; gap: 9px; padding: 12px 10px; margin-bottom: 8px; border-radius: 10px;
  background: linear-gradient(135deg, #25c784, #17a368); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.01em;
  box-shadow: 0 3px 10px color-mix(in srgb, #17a368 35%, transparent); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.nav a.nav-rdp svg { width: 21px; height: 21px; }
.nav a.nav-rdp:hover { color: #fff; background: linear-gradient(135deg, #25c784, #17a368); filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 14px color-mix(in srgb, #17a368 45%, transparent); }
.nav a.nav-rdp.active { color: #fff; background: linear-gradient(135deg, #1fb576, #128a57); box-shadow: 0 0 0 3px color-mix(in srgb, #25c784 35%, transparent); }
.nav a.nav-rdp svg + span + svg { position: absolute; right: 10px; width: 14px; height: 14px; opacity: 0.7; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 10px 6px; font-weight: 650; white-space: nowrap; }
.nav-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.nav-user .meta { min-width: 0; flex: 1; }
.nav-user .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view { flex: 1; min-width: 0; overflow: auto; }
.view-root { height: 100%; }

.page { padding: 24px 28px; max-width: 2200px; } /* zakładki wypełniają szeroki ekran (limit tylko na bardzo dużych monitorach) */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin-right: auto; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 380px 1fr; height: 100%; }
.inbox.show-details { grid-template-columns: 380px 1fr 330px; }
.conv-pane { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.conv-pane-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.conv-pane-head .title { display: flex; align-items: center; gap: 8px; }
.conv-pane-head .title h2 { flex: 1; }
.conv-filters { display: flex; gap: 6px; }
.conv-filters select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.conv-list { flex: 1; overflow-y: auto; }
.conv-item { display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: inherit; cursor: pointer; position: relative; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--surface-3); }
.conv-item .ci-main { flex: 1; min-width: 0; }
.ci-top { display: flex; align-items: baseline; gap: 8px; }
.ci-name { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-time { font-size: 12px; color: var(--muted); flex: none; }
.conv-item.unread .ci-time { color: var(--accent); font-weight: 600; }
.ci-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.ci-preview { flex: 1; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.conv-item.unread .ci-preview { color: var(--text); font-weight: 550; }
.ci-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.acc-tag { display: inline-flex; align-items: center; gap: 5px; }
.waiting { color: var(--warning); font-weight: 600; }
.load-more { display: block; width: calc(100% - 28px); margin: 12px 14px; }

.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--chat-bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-head .who { flex: 1; min-width: 160px; }
.chat-head .who .name { font-weight: 650; font-size: 15px; }
.chat-head .who .sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chat-head select { width: auto; padding: 6px 8px; font-size: 13px; max-width: 180px; }
.typing { color: var(--accent); font-style: italic; }
.back-btn { display: none; }

.window-banner { padding: 7px 16px; font-size: 12.5px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.window-banner.open { background: var(--accent-soft); color: var(--accent-strong); }
.window-banner.closed { background: var(--warning-soft); color: var(--warning); }
.window-banner svg { width: 15px; height: 15px; }

.messages { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: center; background: var(--surface); color: var(--text-2); font-size: 12px; padding: 4px 12px; border-radius: 8px; margin: 12px 0 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); }
.msg { display: flex; flex-direction: column; max-width: 100%; }
.msg.in { align-items: flex-start; }
.msg.out { align-items: flex-end; }
.msg.note, .msg.system { align-items: center; }
/* Pod dymkiem: godzina (czas polski), znaczniki i kto wysłał – jak w Infloww */
.msg-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin: 2px 4px 0; line-height: 16px; }
.msg-meta .ticks svg { width: 15px; height: 15px; }
.msg-sender { color: var(--accent-strong); font-weight: 600; margin-left: 2px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.grouped .msg-meta { margin-top: 1px; }
.bubble {
  max-width: min(560px, 78%); padding: 6px 9px 4px; border-radius: 9px; background: var(--bubble-in);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); position: relative; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.out .bubble { background: var(--bubble-out); }
.msg.note .bubble { background: var(--bubble-note); max-width: min(620px, 86%); border: 1px dashed color-mix(in srgb, var(--warning) 45%, transparent); }
.msg.system .bubble { background: var(--surface); color: var(--text-2); font-size: 12px; padding: 4px 12px; box-shadow: none; border: 1px solid var(--border); }
.msg.grouped { margin-top: -1px; }
.msg:not(.grouped) { margin-top: 6px; }
.bubble .text { white-space: pre-wrap; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bubble .author { font-size: 12px; font-weight: 650; color: var(--accent-strong); margin-bottom: 2px; }
.msg.note .author { color: var(--warning); }
.ticks { display: inline-flex; }
.ticks svg { width: 16px; height: 16px; }
.ticks.read { color: var(--read); }
.ticks.failed { color: var(--danger); }
.msg-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.bubble img.media, .bubble video.media { display: block; max-width: 100%; max-height: 340px; border-radius: 6px; margin-bottom: 4px; cursor: zoom-in; background: var(--surface-3); }
.bubble audio { display: block; max-width: 280px; margin-bottom: 4px; }
.file-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 6px; margin-bottom: 4px; color: var(--text); }
.file-link svg { width: 22px; height: 22px; color: var(--muted); }
.quote { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--text) 6%, transparent); padding: 4px 8px; border-radius: 4px; margin-bottom: 4px; font-size: 12.5px; color: var(--text-2); max-height: 56px; overflow: hidden; }
.reaction-msg { font-size: 12.5px; color: var(--text-2); }
.msg-actions { position: absolute; top: 2px; right: -30px; opacity: 0; transition: opacity 0.1s; }
.msg.out .msg-actions { right: auto; left: -30px; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button { border: 0; background: var(--surface); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); color: var(--text-2); }
.msg-actions svg { width: 14px; height: 14px; }

.composer { background: var(--surface); border-top: 1px solid var(--border); padding: 8px 12px 10px; position: relative; }
.composer.note-mode { background: var(--bubble-note); }
.composer-tabs { display: flex; gap: 4px; margin-bottom: 6px; align-items: center; }
.composer-tabs button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 12.5px; white-space: nowrap; flex: none; }
.composer-tabs button.active { background: var(--surface-3); color: var(--text); }
.composer.note-mode .composer-tabs button.active { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
#composer-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface); max-height: 160px; min-height: 40px; outline: none; }
.composer textarea:focus { border-color: var(--accent); }
.composer textarea:disabled { background: var(--surface-3); }
.reply-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.reply-preview .quote { flex: 1; margin: 0; }
.attach-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 10px; background: var(--surface-3); border-radius: 8px; font-size: 13px; }
.qr-popup { position: absolute; bottom: calc(100% + 4px); left: 12px; right: 12px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); z-index: 20; }
.qr-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.qr-item:last-child { border-bottom: 0; }
.qr-item.active, .qr-item:hover { background: var(--accent-soft); }
.qr-item .sc { font-weight: 650; color: var(--accent-strong); }
.qr-item .body { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.details-pane { background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.details-pane { position: relative; }
.inbox:not(.show-details) .details-pane { display: none; }
.details-close { display: none; position: absolute; top: 10px; right: 10px; }
.details-pane .contact-top { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.details-pane .avatar { width: 72px; height: 72px; font-size: 26px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-strong); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12px; font-weight: 600; }
.tag-chip button { border: 0; background: transparent; cursor: pointer; color: inherit; padding: 0 4px; font-size: 14px; line-height: 1; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.chat-empty svg { width: 64px; height: 64px; opacity: 0.35; }

/* ---------- Statystyki ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 16px; }
.chart-card { padding: 16px; min-width: 0; }
.chart-card h3 { margin-bottom: 4px; }
.chart-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-box { position: relative; height: 260px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .bar { height: 6px; border-radius: 3px; background: var(--series-1); }
.section-title { margin: 22px 0 10px; }

/* ---------- Konta ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.acc-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--c); }
.acc-card .head { display: flex; align-items: center; gap: 10px; }
.acc-card .head .grow .name { font-weight: 650; font-size: 15px; }
.acc-card .stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.acc-card .stats b { color: var(--text); font-size: 15px; display: block; }
.acc-card .actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.webhook-box { padding: 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row code { flex: 1; background: var(--surface-3); padding: 7px 10px; border-radius: 6px; font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
.steps { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Modal, toasty, logowanie ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade 0.12s; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 120; display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; }
.tpl-preview { background: var(--chat-bg); padding: 14px; border-radius: 10px; }
.tpl-preview .bubble { max-width: 100%; }
.tpl-preview .tpl-header { font-weight: 700; margin-bottom: 4px; }
.tpl-preview .tpl-footer { font-size: 12px; color: var(--muted); margin-top: 4px; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); max-width: 380px; animation: slide 0.18s; font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--accent); color: #fff; }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--accent-soft), var(--bg) 55%); }
.auth-card { width: min(400px, 100%); padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .brand { justify-content: center; padding: 0 0 4px; font-size: 19px; }
.auth-card p { margin: 0; color: var(--text-2); text-align: center; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--accent-soft); color: var(--accent-strong); }
.alert.warn { background: var(--warning-soft); color: var(--warning); }

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
  .inbox.show-details { grid-template-columns: 300px 1fr; }
  .inbox.show-details .details-pane { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 100%); z-index: 50; box-shadow: var(--shadow); }
  .inbox { grid-template-columns: 300px 1fr; }
  .details-close { display: inline-flex; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { flex-direction: column-reverse; }
  .nav { width: 100%; flex-direction: row; padding: 4px; border-right: 0; border-top: 1px solid var(--border); overflow-x: auto; }
  .brand, .nav-sep, .nav-user .meta { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; margin: 0; flex: 1; min-width: 62px; position: relative; }
  .nav a .badge { position: absolute; top: 0; right: 6px; margin: 0; font-size: 10px; }
  .nav-user { margin: 0; border: 0; padding: 0 6px; }
  #view { min-height: 0; }
  .page { padding: 16px; }
  .inbox, .inbox.show-details { grid-template-columns: 1fr; }
  .inbox .chat-pane { display: none; }
  .inbox.has-active .conv-pane { display: none; }
  .inbox.has-active .chat-pane { display: flex; }
  .back-btn { display: inline-flex; }
  .messages { padding: 12px 10px; }
  .bubble { max-width: 88%; }
  .msg-actions { display: none; }
  #composer-hint { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  #toasts { left: 16px; right: 16px; bottom: 76px; }
}

/* ---------- Lista rozmów w stylu Infloww ---------- */
.top-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }
.top-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 8px; padding: 8px 6px; font-weight: 650; font-size: 12.5px; color: #fff; cursor: pointer; white-space: nowrap; min-width: 0; }
.top-btn > span:not(.top-count) { overflow: hidden; text-overflow: ellipsis; }
.top-btn.bell { padding: 8px 12px; }
.top-btn.bell svg { width: 18px; height: 18px; }
.top-btn svg { width: 16px; height: 16px; }
.top-btn.blue { background: #3d6ef5; }
.top-btn.green { background: #22b585; }
.top-btn.blue.active { box-shadow: 0 0 0 3px color-mix(in srgb, #3d6ef5 35%, transparent); }
.top-count { background: rgba(255, 255, 255, 0.25); border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
.top-count:empty { display: none; }
.top-count.red { position: absolute; top: -8px; right: -6px; background: #1d9a70; border: 2px solid var(--surface); }
.conv-toolbar { display: flex; gap: 6px; align-items: center; }
.conv-toolbar select { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px 6px; padding: 8px 2px 4px; user-select: none; }
.cat-chips::-webkit-scrollbar { height: 6px; }
.cat-chips::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
.cat-chips .chip { flex: none; }
.chip { position: relative; flex: none; border: 0; background: var(--surface-3); color: var(--text); border-radius: 99px; padding: 6px 13px; font-weight: 550; font-size: 13px; cursor: pointer; }
.chip:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface-3)); }
.chip.active { background: #3d6ef5; color: #fff; }
.chip-badge { position: absolute; top: -7px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #f0584a; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }

.ci-side { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 54px; }
.avatar-wrap { position: relative; }
.new-badge { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); background: #22b585; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 99px; border: 2px solid var(--surface); }
.active-dot { position: absolute; right: 0; top: 0; width: 11px; height: 11px; border-radius: 50%; background: #0ca30c; border: 2px solid var(--surface); }
.spend { font-size: 11px; font-weight: 700; color: #d9692b; background: color-mix(in srgb, #f08a4b 14%, transparent); padding: 0 6px; border-radius: 5px; white-space: nowrap; margin-top: 3px; max-width: 54px; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.2px; }
.spend.has { color: var(--accent-strong); background: var(--accent-soft); }
.ci-top { align-items: center; }
.ci-name { flex: 0 1 auto; }
.ci-handle { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-flag { display: inline-flex; flex: none; }
.ci-flag svg { width: 13px; height: 13px; }
.ci-flag.pin { color: var(--info); }
.ci-flag.prio { color: #eda100; }
.ci-flag.prio svg { fill: currentColor; }

/* ---------- Etykiety klientów ---------- */
.inline-icon svg { width: 14px; height: 14px; vertical-align: -2px; }
.chip .dot { margin-right: 6px; vertical-align: 1px; }
.label-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.label-chip {
  display: inline-block; max-width: 110px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; line-height: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none;
  color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent);
}
.ci-top .label-chip { max-width: 80px; }
.chat-head .who .name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.label-menu { position: fixed; z-index: 60; width: 240px; max-height: 340px; overflow-y: auto; padding: 6px 0; box-shadow: var(--shadow); }
.label-menu-head { padding: 4px 12px 6px; }
.label-opt { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13.5px; }
.label-opt:hover { background: var(--surface-3); }
.label-opt input { accent-color: var(--accent); width: 15px; height: 15px; }
.label-menu-link { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--border); color: var(--text-2); text-decoration: none; }
.label-menu-link svg { width: 14px; height: 14px; }
.label-rows { display: flex; flex-direction: column; gap: 8px; }
.label-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.label-row .input { flex: 1 1 160px; width: auto; }
.label-color { width: 36px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; flex: none; }
.ci-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: inline-flex; flex: none; opacity: 0.6; }
.ci-close:hover { background: var(--surface-3); color: var(--text); opacity: 1; }
.ci-close svg { width: 14px; height: 14px; }
.ci-meta { margin-top: 2px; }
.ci-bottom { margin-top: 3px; }
.ci-preview.typing { color: var(--text); font-weight: 650; }
.ci-time { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; flex: none; }
.ci-time.alert, .conv-item.unread .ci-time { color: #f0584a; font-weight: 600; }
.ci-dot { width: 7px; height: 7px; border-radius: 50%; background: #f0584a; }

.btn.icon.on { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
#prio-btn.on { color: #eda100; background: color-mix(in srgb, #eda100 14%, transparent); }
#prio-btn.on svg { fill: currentColor; }
.badge.blue { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.badge.bot { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.link-btn { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0 0 0 4px; }

.scheduled-bar { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.sched-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: color-mix(in srgb, var(--info) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); border-radius: 8px; padding: 3px 4px 3px 10px; }
.sched-item.failed { background: var(--danger-soft); border-color: transparent; }
.sched-item svg { width: 15px; height: 15px; color: var(--info); flex: none; }
.sched-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.icon.sm { padding: 3px; }
.btn.icon.sm svg { width: 14px; height: 14px; }

.value-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.value-card .value { font-size: 22px; font-weight: 750; color: var(--accent-strong); letter-spacing: -0.02em; }
.sales-list { display: flex; flex-direction: column; gap: 2px; margin-top: -8px; }
.sale-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 2px; border-bottom: 1px solid var(--border); }
.sale-row .neg { color: var(--danger); }
.attr-row { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 6px; align-items: center; }
.attr-row .input { padding: 6px 8px; font-size: 13px; }

/* ---------- Nawigacja: powiadomienia i zmiana ---------- */
.nav-notif { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 550; margin-top: auto; border: 0; background: transparent; cursor: pointer; text-align: left; }
.nav-notif:hover { background: var(--surface-3); color: var(--text); }
.nav-notif svg { width: 19px; height: 19px; flex: none; }
.nav-notif .badge { margin-left: auto; }
.nav-notif ~ .nav-user { margin-top: 0; }
.shift-box { padding: 6px 0 10px; }
.shift-status { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: default; }
.shift-status.on { border-color: color-mix(in srgb, #0ca30c 40%, transparent); background: color-mix(in srgb, #0ca30c 10%, transparent); color: var(--text); }
.shift-btn { width: 100%; display: flex; align-items: center; gap: 8px; border: 1px dashed var(--border-strong); background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; text-align: left; }
.shift-btn svg { width: 15px; height: 15px; flex: none; }
.shift-btn:hover { background: var(--surface-3); }
.shift-btn.on { border-style: solid; border-color: color-mix(in srgb, #0ca30c 40%, transparent); background: color-mix(in srgb, #0ca30c 10%, transparent); color: var(--text); }
.shift-btn.on svg { color: var(--danger); }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 110; animation: fade 0.12s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein 0.18s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-icon.mention, .notif-icon.assigned { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.notif-icon.send_failed { background: var(--danger-soft); color: var(--danger); }
.notif-icon.code { background: var(--warning-soft); color: var(--warning); }
.notif-code { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.notif-code .btn svg { width: 14px; height: 14px; }
.code-status { width: auto; padding: 4px 8px; font-weight: 600; }
.code-status.new { color: var(--danger); background: var(--danger-soft); }
.code-status.done { color: var(--accent-strong); background: var(--accent-soft); }
.notif-icon.new_conversation { background: var(--accent-soft); color: var(--accent-strong); }
.notif-title { font-weight: 600; font-size: 13.5px; }
.notif.unread .notif-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f0584a; margin-right: 6px; vertical-align: 1px; }
.notif-body { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { border: 0; background: rgba(255, 255, 255, 0.2); color: inherit; font-weight: 700; padding: 3px 10px; border-radius: 6px; cursor: pointer; margin-left: auto; }

/* ---------- Kampanie / automatyzacje / integracje ---------- */
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.rule-card { padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.rule-card + .rule-card { margin-top: 10px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; cursor: pointer; transition: background 0.15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.hours-grid { display: grid; grid-template-columns: 130px 1fr 1fr; gap: 6px 10px; align-items: center; max-width: 460px; }
.node-card { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.node-card .node-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.node-btn-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.code-block { background: var(--surface-3); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qr-img { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 8px; }

/* ---------- Kamerka ---------- */
div.field { font-weight: 550; font-size: 13px; }
div.field > :not(.hint) { margin-top: 5px; }
div.field > .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cam-lengths { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 400; }
.cam-lengths .btn { min-width: 86px; justify-content: center; }
.cam-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 8px; font-weight: 400; }
.cam-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cam-item:last-child { border-bottom: 0; }
.cam-item:hover { background: var(--surface-3); }
.cam-item.sel { background: var(--accent-soft); color: var(--accent-strong); }
.cam-item input { accent-color: var(--accent); flex: none; }
.cam-empty { padding: 18px; text-align: center; }
.cam-label { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); }
.cam-label svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.cam-bar-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 8px 12px 0; }
.cam-bar-row > svg { width: 18px; height: 18px; flex: none; }
.cam-bar-row progress { flex: 1 1 140px; max-width: 260px; height: 8px; accent-color: var(--accent); }
@media (max-width: 800px) {
  .nav-notif span:not(.badge) { display: none; }
  .nav-notif { flex-direction: column; margin: 0; padding: 6px 8px; position: relative; }
  .shift-box { display: none; }
  .hours-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- Vault ---------- */
.vault-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 480px; overflow: hidden; padding: 0; }
.vault-sidebar { border-right: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; background: var(--surface-2); }
.vault-folder { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.vault-folder svg { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.vault-folder:hover { background: var(--surface-3); }
.vault-folder.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.vault-folder.active svg { color: var(--accent-strong); }
.vault-main { position: relative; display: flex; flex-direction: column; min-width: 0; }
.vault-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.vault-head:empty { display: none; }
.vault-head h2 svg { width: 18px; height: 18px; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; align-content: start; overflow-y: auto; }
.vault-grid > .empty { grid-column: 1 / -1; }
.vault-tile { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.vault-tile:hover { border-color: var(--border-strong); }
.vault-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.vault-tile.disabled { opacity: 0.5; }
.vault-thumb { position: relative; aspect-ratio: 1; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; }
.vault-thumb img, .vault-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.vault-play { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: grid; place-items: center; }
.vault-play svg { width: 16px; height: 16px; margin-left: 2px; }
.vault-fileicon { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.vault-fileicon svg { width: 36px; height: 36px; }
.vault-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, 0.3); color: transparent; display: grid; place-items: center; }
.vault-check svg { width: 14px; height: 14px; }
.vault-tile.selected .vault-check { background: var(--accent); color: #fff; }
.vault-sent { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 99px; background: #22b585; color: #fff; font-size: 11px; font-weight: 600; }
.vault-meta { padding: 7px 9px; }
.vault-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-actions { display: flex; gap: 2px; padding: 0 5px 5px; }
.vault-drop { position: absolute; inset: 8px; z-index: 5; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent-strong); font-weight: 600; pointer-events: none; }
.vault-drop svg { width: 40px; height: 40px; }
.vault-progress { margin: 12px 16px 0; height: 26px; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; font-size: 12.5px; }
.vault-progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); transition: width 0.2s; }
.vault-progress span { position: relative; display: block; padding: 4px 10px; }
.vault-preview { display: grid; place-items: center; background: #000; border-radius: 10px; overflow: hidden; }
.vault-preview img, .vault-preview video { max-width: 100%; max-height: 65vh; display: block; }
.vault-preview .empty { color: #ccc; }
.vault-modal { width: min(980px, 100%) !important; }
.vault-modal .modal-head h2 { display: flex; align-items: center; gap: 8px; }
.vault-modal .modal-head h2 svg { width: 20px; height: 20px; }
.vault-picker { display: grid; grid-template-columns: 200px 1fr; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; height: min(52vh, 520px); }
.vault-grid.compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 12px; }
@media (max-width: 800px) {
  .vault-layout, .vault-picker { grid-template-columns: 1fr; }
  .vault-sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .vault-folder { flex: none; }
  .vault-picker { height: auto; max-height: 60vh; }
}

/* ---------- Obsługa czatów (kto ma otwarty czat) ---------- */
.top-btn.orange { background: #e8892b; }
.top-btn.orange.active { box-shadow: 0 0 0 3px color-mix(in srgb, #e8892b 35%, transparent); }
.viewing-pill { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 99px; background: color-mix(in srgb, #e8892b 16%, transparent); color: #c86f17; font-weight: 600; white-space: nowrap; }
.viewing-pill svg { width: 12px; height: 12px; }
.viewers-bar { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-size: 13px; background: color-mix(in srgb, #e8892b 14%, var(--surface)); color: var(--text); border-bottom: 1px solid var(--border); }
.viewers-bar svg { width: 16px; height: 16px; color: #c86f17; flex: none; }
.head-notes .badge { margin-left: 2px; }
.head-notes.has-notes { border-color: var(--accent); color: var(--accent-strong); }

/* ---------- Panel klienta ---------- */
.details-pane:has(.cp-tabs) { padding: 14px 12px 0; gap: 12px; background: var(--surface-2); }
.cp-top { flex-direction: row !important; text-align: left !important; align-items: center !important; gap: 12px !important; padding-bottom: 12px !important; }
.cp-top .avatar { width: 46px !important; height: 46px !important; font-size: 17px !important; flex: none; }
.cp-top h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cp-cards { display: flex; flex-direction: column; gap: 10px; }
.cp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.cp-card.dragging { opacity: 0.5; }
.cp-card-head { display: flex; align-items: center; gap: 6px; }
.cp-card-head h3 { flex: 1; margin: 0; font-size: 15px; font-weight: 700; cursor: pointer; user-select: none; }
.cp-grip { display: grid; place-items: center; color: var(--muted); cursor: grab; }
.cp-grip svg { width: 16px; height: 16px; }
.cp-chevron svg { transition: transform 0.15s; }
.cp-card.collapsed .cp-chevron svg { transform: rotate(180deg); }
.cp-card.collapsed .cp-card-body { display: none; }
.cp-card-body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 13px; }
.cp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.cp-label { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.cp-value { text-align: right; }
.cp-info { display: inline-grid; place-items: center; color: var(--muted); cursor: help; }
.cp-info svg { width: 14px; height: 14px; }
.cp-sep { height: 1px; background: var(--border); margin: 2px 0; }
.cp-spend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cp-spend > div + div { border-left: 1px solid var(--border); padding-left: 10px; }
.cp-big { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.cp-mid { font-size: 15px; font-weight: 700; margin-top: 6px; }
.cp-input { border: 1px solid transparent; background: var(--surface-3); color: var(--text); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; min-width: 0; }
.cp-input:hover { border-color: var(--border-strong); }
.cp-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.cp-status.green { color: var(--accent-strong); font-weight: 700; }
.cp-status.red { color: var(--danger); font-weight: 700; }
.cp-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.cp-switch input { width: 16px; height: 16px; accent-color: var(--accent); }
.cp-nick { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.cp-salary { display: flex; gap: 4px; flex: 1; min-width: 0; justify-content: flex-end; }
.cp-salary select:first-child { width: 54px; flex: none; }
.cp-salary select:last-child { flex: 1; min-width: 0; max-width: 120px; }
.cp-salary input { width: 64px; flex: none; }
.cp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.cp-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.cp-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.cp-notes { width: 100%; resize: vertical; border: 1px solid transparent; border-radius: 10px; background: var(--surface-3); color: var(--text); padding: 10px; font: inherit; font-size: 14px; line-height: 1.45; }
.cp-notes:focus { outline: none; border-color: var(--accent); }
.cp-tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 4px; margin: 0 -12px; background: var(--surface); border-top: 1px solid var(--border); }
.cp-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); padding: 7px 4px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.cp-tabs button svg { width: 22px; height: 22px; }
.cp-tabs button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); }
.cp-tab-badge { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
.cp-note-new { display: flex; flex-direction: column; gap: 6px; }
.cp-note-new .btn { align-self: flex-end; }
.cp-notes-list { display: flex; flex-direction: column; gap: 8px; }
.cp-note { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.cp-note.pinned { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cp-note-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cp-note-head .avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.cp-note-body { margin-top: 6px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.btn.icon.sm.on { color: var(--accent-strong); }
/* Wąska lista rozmów (okno < 1100 px): mniejsze przyciski na górze, bez ikon – napisy mieszczą się w całości */
@media (max-width: 1100px) {
  .top-btn:not(.bell) { font-size: 11.5px; gap: 4px; padding: 8px 4px; }
  .top-btn:not(.bell) > svg { display: none; }
}

/* Etykiety w panelu klienta – klikalne przyciski (przypnij / zdejmij) */
.cp-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-label-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1.5px dashed color-mix(in srgb, var(--lc, var(--muted)) 55%, transparent); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.cp-label-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.cp-label-chip svg { width: 13px; height: 13px; }
.cp-label-chip:hover { background: color-mix(in srgb, var(--lc, var(--muted)) 12%, transparent); }
.cp-label-chip.on { border-style: solid; border-color: var(--lc); background: var(--lc); color: #fff; }
.cp-label-chip.add { --lc: var(--accent); color: var(--accent-strong); }
.cp-label-chip:disabled { opacity: 0.6; cursor: wait; }

/* Szybkie „Dodaj sprzedaż” w nagłówku czatu i w okienku */
.btn.sale-btn { background: linear-gradient(135deg, #25c784, #17a368); border-color: transparent; color: #fff; font-weight: 750; box-shadow: 0 2px 8px color-mix(in srgb, #17a368 30%, transparent); }
.btn.sale-btn:hover { filter: brightness(1.08); color: #fff; }
.btn.sale-btn svg { width: 16px; height: 16px; }
.sale-amount { font-size: 22px; font-weight: 700; padding: 10px 12px; }
.sale-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.sale-kinds label { cursor: pointer; }
.sale-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.sale-kinds span { display: inline-block; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border-strong); font-weight: 650; font-size: 13px; }
.sale-kinds input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.sale-kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Sprzedaż (administrator) ---------- */
.sales-page { display: flex; flex-direction: column; gap: 16px; }
.sales-page .kpis { margin-bottom: 0; }
.sales-filters { display: flex; flex-direction: column; gap: 12px; }
.sales-filter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-3); align-self: flex-start; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.sm button { padding: 4px 10px; font-size: 12.5px; }
.sales-two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1250px) { .sales-two { grid-template-columns: 1fr; } }
.sales-page .card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex-wrap: wrap; }
.sales-page .card-head h2 { flex: 1; margin: 0; font-size: 16px; }
.table tbody tr.selected { background: var(--accent-soft); }
.sum-bar { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--surface-3); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.sum-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.sales-page, .sales-two > *, .sales-page > .card { min-width: 0; }
.sales-page .table-wrap { overflow-x: auto; }

/* Sprzedaż – wybór osoby i jej karta */
.member-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.member-chip:first-of-type { padding-left: 10px; }
.member-chip svg { width: 15px; height: 15px; }
.member-chip:hover { border-color: var(--accent); }
.member-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; flex: none; }
.member-card { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.member-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.member-head h2 { margin: 0; font-size: 20px; }
.member-badges { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.member-range { text-align: right; max-width: 260px; }
.m-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.m-kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.m-kpi .label { color: var(--text-2); font-size: 12px; font-weight: 600; }
.m-kpi .value { font-size: 21px; font-weight: 750; margin-top: 3px; letter-spacing: -0.02em; }
.m-kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 16px; }
.trend { font-weight: 700; color: var(--muted); }
.trend.up { color: var(--accent-strong); }
.trend.down { color: var(--danger); }
.member-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .member-grid { grid-template-columns: 1fr; } }
.member-grid > * { min-width: 0; }
.m-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.m-kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.m-clients { display: flex; flex-direction: column; gap: 6px; }
.m-client { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.m-pos { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.m-client:first-child .m-pos { background: #f2c94c; color: #4a3800; }
.sales-two.single { grid-template-columns: 1fr; }

/* Sprzedaż – podium top 3 */
.podium-card { padding: 16px 18px 0; overflow: hidden; }
.podium-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.podium-head h2 { margin: 0; font-size: 17px; flex: 1; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin-top: 14px; }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; padding: 0; min-width: 0; }
.podium-place .avatar { margin: 2px 0 4px; }
.podium-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #f2c94c, #d9a91c); color: #4a3800; box-shadow: 0 2px 8px color-mix(in srgb, #d9a91c 35%, transparent); flex: none; align-self: center; }
.podium-icon svg { width: 19px; height: 19px; }
.podium-head h2 { align-self: center; }
.podium-medal { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.podium-medal svg { width: 17px; height: 17px; }
.podium-medal.m1 { width: 38px; height: 38px; background: linear-gradient(135deg, #f7d76a, #d9a91c); color: #4a3800; box-shadow: 0 3px 10px color-mix(in srgb, #d9a91c 40%, transparent); }
.podium-medal.m1 svg { width: 21px; height: 21px; }
.podium-medal.m2 { background: linear-gradient(135deg, #dfe4ea, #9aa4ae); color: #2f363d; }
.podium-medal.m3 { background: linear-gradient(135deg, #eab385, #b8763d); color: #3d2410; }
.rank-badge, .top-mark, .best-period { display: inline-flex; align-items: center; gap: 4px; }
.rank-badge svg, .best-period svg { width: 13px; height: 13px; }
.top-mark { color: #d9a91c; margin-right: 4px; vertical-align: -2px; }
.top-mark svg { width: 14px; height: 14px; }
.best-period svg { color: #d9a91c; }
.podium-name { font-weight: 750; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-amount { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.podium-place.p1 .podium-amount { font-size: 26px; color: var(--accent-strong); }
.podium-step { width: 100%; margin-top: 10px; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: rgba(255, 255, 255, 0.9); }
.podium-place.p1 .podium-step { height: 64px; background: linear-gradient(180deg, #f2c94c, #d9a91c); }
.podium-place.p2 .podium-step { height: 44px; background: linear-gradient(180deg, #c7ced6, #9aa4ae); }
.podium-place.p3 .podium-step { height: 30px; background: linear-gradient(180deg, #e0a36b, #b8763d); }
.podium-place:not(.empty-place):hover .podium-step { filter: brightness(1.08); }
.podium-place.active .podium-name { color: var(--accent-strong); }
.podium-place.active .podium-step { box-shadow: inset 0 0 0 3px var(--accent); }
.podium-place.empty-place { cursor: default; opacity: 0.35; }
@media (max-width: 700px) { .podium { gap: 6px; } .podium-amount { font-size: 16px; } .podium-place.p1 .podium-amount { font-size: 19px; } }

/* Trwająca kamerka – komunikat dla zespołu */
#nav-cam-live:empty { display: none; }
#nav-cam-live { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 8px; }
.nav a.cam-live { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; margin: 0; border-radius: 10px; background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); color: var(--text); font-size: 12.5px; line-height: 1.35; }
.nav a.cam-live:hover { background: color-mix(in srgb, var(--danger) 20%, var(--surface)); color: var(--text); }
.nav a.cam-live b { color: var(--danger); font-size: 13px; }
.cam-live-who { display: block; color: var(--text-2); margin-top: 1px; }
.cam-live-srv { color: var(--muted); font-weight: 600; }
.cam-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-top: 4px; flex: none; animation: cam-pulse 1.4s ease-in-out infinite; }
@keyframes cam-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.nav a.nav-rdp.cam-busy::after { content: ''; position: absolute; top: 8px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a4e; border: 2px solid #fff; animation: cam-pulse 1.4s ease-in-out infinite; }
.btn.cam-taken { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.cam-busy-alert { display: flex; gap: 8px; align-items: flex-start; }
.cam-busy-alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ---------- WhatsApp + Telegram: dwa okna skrzynki obok siebie ---------- */
.dual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 100%; min-height: 0; }
.dual-pane { --ch: var(--accent); display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 3px solid var(--border-strong); }
.dual-pane:last-child { border-right: 0; }
.dual-pane[data-channel="whatsapp"] { --ch: #1fa855; }
.dual-pane[data-channel="telegram"] { --ch: #2aabee; }
.dual-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border-top: 3px solid var(--ch); border-bottom: 1px solid var(--border); }
.dual-ic { display: inline-flex; color: var(--ch); }
.dual-ic svg { width: 18px; height: 18px; }
.dual-head select { width: auto; padding: 4px 8px; font-size: 13px; font-weight: 650; }
.dual-unread { background: var(--ch); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; }
.dual-body { flex: 1; min-height: 0; position: relative; container-type: inline-size; }
.dual-pane.flash .dual-head { animation: dual-flash 0.9s; }
@keyframes dual-flash { 30% { background: color-mix(in srgb, var(--ch) 28%, var(--surface)); } }

.inbox.embedded, .inbox.embedded.show-details { position: relative; grid-template-columns: minmax(330px, 40%) 1fr; }
/* Okno widoku WhatsApp + Telegram: dzwonek jest w menu (dwa takie same w obu oknach są zbędne) – przyciski mają całą szerokość */
.inbox.embedded .top-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.inbox.embedded #open-notifs { display: none; }
.inbox.embedded .top-btn:not(.bell) { font-size: 12.5px; gap: 6px; padding: 8px 8px; }
.inbox.embedded .top-btn:not(.bell) > svg { display: block; }
.inbox.embedded.show-details .details-pane { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 92%); z-index: 30; box-shadow: var(--shadow); }
.inbox.embedded .details-close { display: inline-flex; }
.inbox.embedded .chat-head { gap: 6px; padding: 8px 10px; }
.inbox.embedded .messages { padding: 12px 3%; }
.inbox.embedded .conv-pane-head { padding: 10px 10px 8px; gap: 8px; }
/* Wąskie okno: lista albo czat (jak na telefonie) */
@container (max-width: 680px) {
  .inbox.embedded, .inbox.embedded.show-details { grid-template-columns: 1fr; }
  .inbox.embedded .chat-pane { display: none; }
  .inbox.embedded.has-active .conv-pane { display: none; }
  .inbox.embedded.has-active .chat-pane { display: flex; }
  .inbox.embedded .back-btn { display: inline-flex; }
}
.chan-ic { display: inline-flex; }
.chan-ic svg { width: 12px; height: 12px; }
.chan-ic.tg { color: #2aabee; }
.acc-card .badge.tg { background: color-mix(in srgb, #2aabee 16%, transparent); color: #1f8fcc; }
@media (max-width: 800px) {
  .dual { grid-template-columns: 1fr; grid-auto-rows: 100%; overflow-y: auto; }
  .dual-pane { border-right: 0; border-bottom: 3px solid var(--border-strong); }
}
.btn.tg-btn { background: #2aabee; border-color: #2aabee; color: #fff; }
.btn.tg-btn:hover { background: #1f97d4; }
.diag-list { max-height: 260px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; white-space: pre-wrap; }

/* ---------- Nagrania do kamerek (podgląd, tytuł, opis) ---------- */
#nav-recordings { display: contents; }
.cam-list { max-height: 340px; }
.cam-item.rec { padding: 6px 10px; }
.cam-thumb { position: relative; flex: none; width: 92px; height: 58px; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.cam-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cam-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0.25); opacity: 0.85; }
.cam-play svg { width: 20px; height: 20px; fill: #fff; }
.cam-thumb:hover .cam-play { opacity: 1; background: rgba(0, 0, 0, 0.4); }
.cam-rec-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cam-rec-title { font-weight: 600; }
.cam-rec-desc { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cam-item.sel .cam-rec-desc { color: inherit; }
.cam-preview { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin: 8px 0; padding: 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); font-weight: 400; }
.cam-preview video { width: 100%; max-height: 300px; border-radius: 8px; background: #000; }
.cam-preview-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (max-width: 700px) { .cam-preview { grid-template-columns: 1fr; } }
#cam-search { margin-bottom: 6px; font-weight: 400; }

.rec-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.rec-toolbar input { flex: 1 1 260px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.rec-grid > .empty { grid-column: 1 / -1; }
.rec-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.rec-video { background: #000; aspect-ratio: 16 / 10; }
.rec-video video { width: 100%; height: 100%; object-fit: contain; display: block; }
.rec-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rec-body .field { margin: 0; }

/* ---------- Widok listy rozmów: przycisk „Widok: Wszystkie ▾” z menu kategorii i etykiet ---------- */
.cat-view { position: relative; }
.cat-toggle { width: 100%; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.cat-toggle:hover, .cat-toggle.open { border-color: color-mix(in srgb, #3d6ef5 60%, var(--border-strong)); }
.cat-toggle b { font-weight: 650; min-width: 0; }
.cat-toggle-label { color: var(--muted); font-size: 12px; }
.cat-toggle svg { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform 0.15s; }
.cat-toggle.open svg { transform: rotate(180deg); }
.cat-total { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-unread { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: #f0584a; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0584a; flex: none; }
.cat-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; padding: 6px; max-height: min(420px, 60vh); overflow-y: auto; box-shadow: var(--shadow); }
.cat-menu-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 8px 4px; }
.cat-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.cat-item:hover { background: var(--surface-3); }
.cat-item.active { background: color-mix(in srgb, #3d6ef5 16%, transparent); color: var(--text); font-weight: 600; }
.cat-item .dot, .cat-toggle .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cat-menu-link { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 8px; border-top: 1px solid var(--border); font-size: 12.5px; }
.cat-menu-link svg { width: 14px; height: 14px; }

/* ---------- Sprzedaż: tabela „Wyniki chatterów” (dziś / wczoraj / tydzień / miesiąc / rok) ---------- */
.periods-table td, .periods-table th { vertical-align: middle; }
.periods-table td .avatar.xs { display: inline-grid; vertical-align: middle; margin-right: 4px; }
.periods-table td.num .small { margin-top: 1px; }
.periods-table td.period-best b { color: var(--accent-strong); }
.periods-table tfoot td { border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.sale-by { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px 2px 2px; border-radius: 99px; background: var(--surface-3); white-space: nowrap; }
.sale-by .avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.sale-payer { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; }
.sale-payer svg { width: 16px; height: 16px; flex: none; }
.sale-payer .muted { font-weight: 400; }

/* ---------- Zwykłe konto WhatsApp: kod QR ---------- */
.qr-box { min-height: 220px; display: flex; flex-direction: column; gap: 10px; }
.qr-wait { margin: auto; color: var(--muted); }
.qr-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: center; }
.qr-img { width: 260px; height: 260px; border-radius: 10px; background: #fff; padding: 8px; }
.qr-ok { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px; background: var(--accent-soft); }
.qr-ok svg { width: 28px; height: 28px; color: var(--accent-strong); flex: none; }
@media (max-width: 700px) { .qr-grid { grid-template-columns: 1fr; justify-items: center; } }
.pair-code { font-size: 34px; font-weight: 800; letter-spacing: 0.18em; text-align: center; padding: 18px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }

/* ---------- Telefon: dolne menu i widok dwóch okien ---------- */
@media (max-width: 800px) {
  #nav-rdp, #nav-cam-live { display: contents; }
  .nav a.nav-rdp { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; margin: 0; min-width: 62px; flex: 1; box-shadow: none; transform: none; }
  .nav a.nav-rdp svg { width: 19px; height: 19px; }
  .nav a.nav-rdp svg + span + svg { display: none; }
  .nav a.cam-live { display: none; }
  .dual { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) { .layout-btn { display: none; } }
@media (max-width: 800px) {
  .inbox, .inbox.show-details { grid-template-columns: minmax(0, 1fr); }
  .conv-pane, .chat-pane { min-width: 0; }
  .conv-toolbar select, .conv-filters select { min-width: 0; }
}
.code-mode { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.code-mode .segmented button svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }

/* ---------- Statystyki chattera: „Moje zarobki” ---------- */
.earn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.earn-kpi .value { color: var(--accent-strong); }
.earn-kpi.main { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.periods-table .period-earn { color: var(--accent-strong); font-weight: 600; }
.commission-table .commission-input { width: 150px; margin-left: auto; text-align: right; }
.commission-table td { vertical-align: middle; }
.commission-table td .avatar.xs { display: inline-grid; vertical-align: middle; margin-right: 4px; }

/* ---------- Materiały: paczki przypisane do modelek ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.vault-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.vault-tools #vault-search { width: 220px; }
.vault-model-wrap { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--muted); }
.vault-model-wrap svg { width: 16px; height: 16px; flex: none; }
.vault-model-wrap .vault-model { border: 0; background: transparent; padding-left: 0; min-width: 190px; font-weight: 600; }
.vault-layout { grid-template-columns: 260px 1fr; min-height: calc(100vh - 150px); }
.vault-sidebar { gap: 10px; padding: 10px; }
.vault-group { display: flex; flex-direction: column; gap: 2px; }
.vault-group-head { display: flex; align-items: center; gap: 7px; padding: 6px 8px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.vault-group-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.vault-ch { display: inline-flex; color: var(--muted); }
.vault-ch svg { width: 13px; height: 13px; }
.vault-count { font-size: 11.5px; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 0 7px; min-width: 22px; text-align: center; }
.vault-folder.active .vault-count { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong); }
.vault-quick { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; margin-top: 2px; }
.vault-quick:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.vault-quick svg { width: 14px; height: 14px; }
.vault-side-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.vault-side-empty svg { width: 28px; height: 28px; opacity: 0.5; }
.vault-title { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.vault-title svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.vault-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vault-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.vault-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.vault-chip.lock { background: var(--warning-soft); color: var(--warning); }
.vault-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; padding: 0; opacity: 0; transition: opacity 0.12s; }
.vault-tile:hover .vault-actions, .vault-tile:focus-within .vault-actions { opacity: 1; }
.vault-act { width: 28px; height: 28px; border: 0; border-radius: 7px; background: rgba(0, 0, 0, 0.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vault-act:hover { background: rgba(0, 0, 0, 0.8); }
.vault-act.danger:hover { background: var(--danger); }
.vault-act svg { width: 14px; height: 14px; }
.vault-warn { color: var(--danger); }
.vault-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; text-align: center; }
.vault-empty > svg { width: 44px; height: 44px; opacity: 0.4; }
.vault-pick-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 4px; }
.vault-acc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 500; }
.vault-acc:hover { border-color: var(--accent); }
.vault-acc.on { border-color: var(--accent); background: var(--accent-soft); }
.vault-acc input { accent-color: var(--accent); }
.vault-acc .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.vault-access { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.vault-radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-weight: 400; }
.vault-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.vault-radio input { margin-top: 3px; accent-color: var(--accent); }
.vault-radio > span { display: flex; flex-direction: column; gap: 2px; }
.vault-members { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.vault-picker-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vault-picker-tools input[type=search] { flex: 1 1 200px; }
@media (max-width: 800px) {
  .vault-layout { grid-template-columns: 1fr; min-height: 0; }
  .vault-sidebar { border-right: 0; border-bottom: 1px solid var(--border); max-height: 260px; }
  .vault-access { grid-template-columns: 1fr; }
  .vault-tools #vault-search { width: 100%; }
}
/* Ikony w etykietach pól wyboru zawsze w rozmiarze tekstu (bez rozciągania na całe okno) */
.checkbox svg { width: 15px; height: 15px; flex: none; vertical-align: -2px; }
.vault-empty .btn svg, .empty .btn svg { width: 16px; height: 16px; opacity: 1; }
/* Ikona w przycisku w pustym widoku – bez odstępu dużej ikony (inaczej „+” jest przesunięty do góry) */
.empty .btn svg { margin: 0; }

/* ---------- Modelki ---------- */
.model-card { border-top: 3px solid var(--c); }
.model-accounts { display: flex; flex-wrap: wrap; gap: 6px; }
.model-acc { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2, var(--surface)); font-size: 13px; }
.model-acc .vault-ch svg { width: 14px; height: 14px; }
.model-colors { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.model-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--border); padding: 0; }
.model-color.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.vault-ch { display: inline-flex; gap: 3px; }

/* ---------- Zdjęcia profilowe modelek ---------- */
.model-avatar { overflow: hidden; }
.model-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.model-avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.model-avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.model-avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.model-avatar-btn { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; flex: none; }
.model-avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: 2px solid var(--surface); opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.model-avatar-cam svg { width: 12px; height: 12px; }
.model-avatar-btn:hover .model-avatar-cam, .model-avatar-btn:focus-visible .model-avatar-cam { opacity: 1; transform: none; }
.model-avatar-btn:hover .model-avatar { filter: brightness(.85); }
.model-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.model-photo .btn svg { width: 15px; height: 15px; }
.vault-group-head .model-avatar, .vault-acc .model-avatar { flex: none; }

/* ---------- Paski przewijania w stylu CRM ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 60%, transparent); }
::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
/* Menu boczne: pasek widoczny dopiero po najechaniu */
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background-color: transparent; border-width: 2px; }
.nav:hover::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--muted) 35%, transparent); }
.nav:hover::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 60%, transparent); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
}
#composer-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Cennik ---------- */
.price-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.price-toolbar #price-search { flex: 1; min-width: 200px; max-width: 360px; }
.price-model-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.price-model-head .name { font-weight: 700; font-size: 16px; }
.price-table td { vertical-align: middle; }
.price-name { font-weight: 600; }
.price-val { color: var(--accent-strong); font-size: 15px; }
.price-actions { text-align: right; width: 1%; }
.price-actions .btn svg { width: 15px; height: 15px; }
.price-card .empty svg { margin-bottom: 8px; }
.model-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.price-pop { position: fixed; right: 18px; top: 74px; width: 340px; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); z-index: 60; overflow: hidden; }
.price-pop-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); }
.price-pop-head > svg { width: 18px; height: 18px; color: var(--accent); }
.price-pop-head .btn svg { width: 15px; height: 15px; }
.price-pop .price-pop-model, .price-pop .price-pop-search { margin: 10px 12px 0; width: calc(100% - 24px); flex: none; }
.price-pop-list { overflow-y: auto; padding: 8px; flex: 1; }
.price-pop-list .pad { padding: 10px 6px; }
.price-pop-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.price-pop-item + .price-pop-item { border-top: 1px solid var(--border); border-radius: 0; }
.price-pop-item .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 700px) { .price-pop { right: 16px; left: 16px; width: auto; top: auto; bottom: 84px; max-height: 60vh; } }
/* Atrybut hidden ma pierwszeństwo przed display z klas (np. pusta lista modelek w Cenniku) */
[hidden] { display: none !important; }
/* Ustawienia: karty obok siebie na szerokim ekranie */
.settings-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.settings-grid .kv { grid-template-columns: 110px 1fr; }
.settings-grid .kv dd { text-align: left; font-weight: 600; }
.settings-grid .checkbox .hint { display: block; margin-top: 2px; }
.settings-grid .checkbox { align-items: flex-start; }
.settings-grid .checkbox input { margin-top: 2px; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
/* Statystyki: 12 kafelków w dwóch równych rzędach po 6 na szerokim ekranie */
@media (min-width: 1500px) { .kpis.six { grid-template-columns: repeat(6, 1fr); } }
.acc-card .actions > .danger:last-child { margin-left: auto; }
.perm-blocked { opacity: .45; cursor: not-allowed; }
.perm-blocked::after { content: 'niedostępne dla Chattera'; margin-left: 6px; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- Wiadomości masowe, automatyczne i smart ---------- */
.out-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.out-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.out-card.off { opacity: .6; }
.out-card-head { display: flex; align-items: flex-start; gap: 10px; }
.out-card-head .name { font-weight: 700; font-size: 15px; }
.out-card .actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.out-text { white-space: pre-wrap; background: var(--surface-2, var(--surface-3)); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; max-height: 120px; overflow: hidden; }
.out-progress { display: flex; align-items: center; gap: 10px; }
.out-progress progress { flex: 1; height: 8px; accent-color: var(--accent); }
.out-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.danger-text { color: var(--danger); }
.out-h { margin: 8px 0 0; font-size: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .form-grid.three { grid-template-columns: 1fr; } }
.out-filter { display: flex; flex-direction: column; gap: 10px; }
.out-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.out-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-strong); cursor: pointer; font-size: 13px; font-weight: 600; }
.out-label input { display: none; }
.out-label.on { background: color-mix(in srgb, var(--lc) 22%, transparent); border-color: var(--lc); }
.out-count { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); font-size: 13.5px; }
.out-count > svg { width: 17px; height: 17px; color: var(--accent-strong); }
.out-preview { flex-basis: 100%; background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.out-warn { flex-basis: 100%; color: var(--warning); display: flex; gap: 6px; align-items: flex-start; }
.out-warn svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.out-variant { display: flex; gap: 6px; align-items: flex-start; }
.out-variant textarea { flex: 1; }
.out-media { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.out-media .vault-chip svg { width: 13px; height: 13px; }
.out-pick { display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 320px; }
.out-pick-folders { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); padding-right: 10px; }
.vault-folder-btn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.vault-folder-btn:hover { background: var(--surface-3); }
.vault-folder-btn.active { background: var(--accent-soft); color: var(--accent-strong); }
.vault-folder-btn svg { width: 16px; height: 16px; flex: none; }
.out-pick-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-content: start; max-height: 55vh; overflow-y: auto; }
.out-pick-item { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 2px solid var(--border); border-radius: 9px; cursor: pointer; }
.out-pick-item.on { border-color: var(--accent); background: var(--accent-soft); }
.out-pick-item input { position: absolute; top: 8px; left: 8px; }
.out-pick-item img, .out-pick-ic { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; }
.out-pick-ic svg { width: 30px; height: 30px; opacity: .6; }
@media (max-width: 700px) { .out-pick { grid-template-columns: 1fr; } .out-pick-folders { border-right: 0; padding-right: 0; } }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 15px; height: 15px; flex: none; }
.out-note { display: flex; gap: 6px; align-items: flex-start; color: var(--warning); }
.out-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.alert.warn svg { width: 16px; height: 16px; vertical-align: -3px; }
/* Nazwy w menu w jednej linii (np. „Wiadomości automatyczne”) */
.nav a { gap: 9px; }
.nav a > span:not(.badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- Wyrównanie pól obok siebie ----------
   Etykiety zawsze u góry, a pola tekstowe na tej samej wysokości – podpowiedź pod jedną etykietą nie przesuwa pola. */
.form-grid { align-items: stretch; }
/* tylko pola z jedną kontrolką – pole z kilkoma (np. 3 przyciski szablonu) zaczyna się zaraz pod etykietą */
.form-grid > .field:not(:has(> :is(input, select, textarea) ~ :is(input, select, textarea))) > :is(input, select, textarea, .input, .row, .model-colors, .vault-pick-accounts, .seg):last-child { margin-top: auto; }
/* Podpowiedź pod polem (ostatnia w polu) – bez wcięcia */
div.field > .hint:last-child { margin-left: 0; display: block; margin-top: 4px; }
/* Komunikat „brak …” w siatkach wyboru zajmuje całą szerokość */
.vault-pick-accounts > :only-child:not(label) { grid-column: 1 / -1; }
/* Jedna wysokość wszystkich pól (data, godzina, liczba, lista) – inaczej stoją krzywo obok siebie */
input.input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select.input { height: 38px; padding-top: 0; padding-bottom: 0; }
/* Pole z kilkoma kontrolkami (div) układa się jak zwykłe pole: etykieta, podpowiedź, pola – te same odstępy */
div.field { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
div.field > .hint { margin-left: 0; }
/* Ikona w kółku awatara – nie na całe kółko */
.avatar > svg { width: 55%; height: 55%; }
div.field > :not(.hint) { margin-top: 0; }
div.field > .hint:last-child { margin-top: 0; }
