/* Vendetta CRM – arkusz stylów (bez zewnętrznych zależności) */
:root {
  --bg: #f4f6fa; --panel: #ffffff; --panel-2: #f8f9fc; --line: #e3e7ef; --line-2: #d3d9e5;
  --text: #1c2333; --muted: #6a7488; --primary: #2457d6; --primary-2: #1c47b3; --primary-soft: #e7eefc;
  --danger: #c62828; --danger-soft: #fdecec; --warn: #b26a00; --warn-soft: #fff4de; --ok: #1f7a3f; --ok-soft: #e6f5ec;
  --info-soft: #eaf2fe; --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 2px 8px rgba(20, 30, 60, .05);
  --radius: 10px; --sidebar: 228px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141d; --panel: #171e2a; --panel-2: #1c2433; --line: #283244; --line-2: #34405a; --text: #e6eaf2; --muted: #93a0b8;
    --primary: #6d93f0; --primary-2: #8aa9f5; --primary-soft: #1e2c4d; --danger: #ff6b6b; --danger-soft: #3a1f24; --warn: #f0b04a;
    --warn-soft: #3a2f18; --ok: #5fd08a; --ok-soft: #173326; --info-soft: #1b2840; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 16px 0 8px; font-weight: 650; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.danger { color: var(--danger); }
.ok-text { color: var(--ok); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.line { padding: 4px 0; }

/* ---------- układ ---------- */
.app { display: flex; min-height: calc(100vh / var(--ui-zoom, 1)); }
.sidebar { width: var(--sidebar); background: #142038; color: #c9d3e6; display: flex; flex-direction: column; position: sticky; top: 0; height: calc(100vh / var(--ui-zoom, 1)); flex-shrink: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand.big { color: var(--text); font-size: 20px; padding: 0 0 12px; justify-content: center; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3a74ff, #1fb6a6); color: #fff; display: grid; place-items: center; font-weight: 800; }
.nav { display: flex; flex-direction: column; padding: 4px 8px; gap: 1px; overflow-y: auto; flex: 1; }
.nav a { color: #c9d3e6; padding: 8px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
.nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: #2a3d63; color: #fff; }
.nav a.sub { padding-left: 38px; font-size: 13px; }
.nav a.sub i { display: none; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sidebar-foot a, .sidebar-foot .linklike { color: #aebbd4; }
.sidebar-foot .me { display: flex; flex-direction: column; margin-bottom: 6px; color: #fff; }
.sidebar-foot .me small { color: #93a3c2; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--primary); text-align: left; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 620px; }
.topbar .search input { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 4px 6px; color: var(--text); position: relative; }
.icon-btn:hover { text-decoration: none; }
.bell .count { position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 5px; line-height: 17px; }
.menu-toggle { display: none; }
/* treść jako wyśrodkowana kolumna: przy oddalonym widoku (albo bardzo szerokim oknie) wolne miejsce rozkłada się po obu stronach */
.content { padding: 20px; max-width: 1900px; width: 100%; margin-left: auto; margin-right: auto; }
.demo-banner { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 4px; font-size: 12.5px; }
.worker-banner { background: var(--warn-soft); color: var(--warn); padding: 6px 20px; font-size: 13px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; font-size: 13px; margin-bottom: 4px; }

/* ---------- karty ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card.attention { border-color: var(--warn); background: var(--warn-soft); }
.card h2 small { font-weight: 400; }
.stack > .card { margin-bottom: 16px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.error-code { font-size: 54px; font-weight: 800; color: var(--muted); }

/* ---------- wskaźniki ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); }
.kpi:hover { text-decoration: none; border-color: var(--line-2); }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font-size: 26px; font-weight: 700; }
.kpi b.small { font-size: 18px; padding-top: 6px; }
.kpi small { color: var(--muted); }
.kpi.bad b { color: var(--danger); }
.kpi.warn b { color: var(--warn); }
.kpi.ok b { color: var(--ok); }

/* ---------- przyciski ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-weight: 550; white-space: nowrap; line-height: 1.3; }
.btn:hover { text-decoration: none; background: var(--panel-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 3px 8px; font-size: 12.5px; border-radius: 6px; }
.btn.wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg a, .seg button { padding: 6px 12px; color: var(--text); background: var(--panel); border: 0; font: inherit; cursor: pointer; }
.seg a.on, .seg button.on { background: var(--primary); color: #fff; }
.seg a:hover { text-decoration: none; }

/* ---------- formularze ---------- */
.form .grid-form, .grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-form .span2, .grid-form .full { grid-column: 1 / -1; }
.grid-form.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card.form { max-width: 900px; }
.card.form.wide { max-width: 1200px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=password], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; min-height: 36px;
}
input[type=color] { width: 60px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); }
textarea { resize: vertical; min-height: 70px; }
select[multiple] { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: 12.5px; }
.help { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--text) !important; font-size: 14px !important; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.form-section { grid-column: 1 / -1; font-weight: 650; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.rows-editor .row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; margin-bottom: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters .field { min-width: 140px; }
.filters input, .filters select { min-height: 32px; padding: 5px 8px; }

/* ---------- komunikaty ---------- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-info { background: var(--info-soft); border-color: #cfe0fb; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #c4e7d1; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: #f3dcae; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f5c7c7; }
@media (prefers-color-scheme: dark) { .alert-info, .alert-ok, .alert-warn, .alert-error { border-color: var(--line-2); } }
.flashes { margin-bottom: 8px; }
.conflict table { margin: 8px 0; }

/* ---------- znaczniki ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c, #64748b) 16%, transparent); color: color-mix(in srgb, var(--c, #64748b) 80%, var(--text)); border: 1px solid color-mix(in srgb, var(--c, #64748b) 35%, transparent); white-space: nowrap; }
.stage { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; border-left: 4px solid var(--c, #64748b); background: var(--panel-2); white-space: nowrap; }
.flag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .02em; margin-left: 4px; vertical-align: 1px; }
.flag-no_next { background: var(--warn-soft); color: var(--warn); }
.flag-overdue { background: var(--danger-soft); color: var(--danger); }
.flag-stale { background: #efe9fb; color: #6b46c1; }
.flag-stage_stale { background: #e6f4f1; color: #0f766e; }
.flag-limitation { background: #fde8f1; color: #b0306a; }
.flag-scn { background: var(--info-soft); color: var(--primary); }
.status-open { color: var(--primary); } .status-won { color: var(--ok); } .status-lost { color: var(--danger); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--c, #999); }
.swatch { width: 18px; height: 18px; border-radius: 5px; display: inline-block; background: var(--c); vertical-align: middle; border: 1px solid var(--line); }

/* ---------- tabele ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table th a { color: var(--muted); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: var(--panel-2); }
.table tr.is-archived td, .table tr.inactive td { opacity: .6; }
.table-wrap { overflow-x: auto; }
table.mini { border-collapse: collapse; font-size: 13px; }
table.mini th, table.mini td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
dl.props { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
dl.props dt { color: var(--muted); font-size: 13px; }
dl.props dd { margin: 0; word-break: break-word; }

/* ---------- listy działań ---------- */
.act-list { list-style: none; margin: 0; padding: 0; }
.act-row { display: grid; grid-template-columns: 28px 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.act-list.compact .act-row { grid-template-columns: 28px 120px minmax(0, 1fr) auto; }
.act-row:last-child { border-bottom: 0; }
.act-row.overdue .act-when { color: var(--danger); font-weight: 600; }
.act-row.is-done .act-title, .act-row.is-cancelled .act-title { color: var(--muted); }
.act-row.is-cancelled .act-title { text-decoration: line-through; }
.act-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, #64748b) 16%, transparent); font-size: 13px; }
.act-when { font-size: 12.5px; white-space: nowrap; }
.act-main { min-width: 0; display: flex; flex-direction: column; }
.act-main > .flag, .act-main > .badge { align-self: flex-start; margin-left: 0; margin-top: 2px; }
.act-main small a { color: var(--muted); }
.act-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.act-actions { display: flex; gap: 4px; }

/* ---------- oś czasu ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 4px 0 12px 40px; }
.tl-icon { position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--line-2); font-size: 13px; }
.tl-item.k-payment .tl-icon { border-color: var(--ok); }
.tl-item.k-message .tl-icon { border-color: #0891b2; }
.tl-item.k-change .tl-icon { border-color: var(--line-2); }
.tl-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tl-head .when { color: var(--muted); font-size: 12.5px; }
.tl-body { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tl-changes { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; padding-left: 16px; }
.tl-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- nagłówek rekordu ---------- */
.record-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.record-head h1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.pipeline { display: flex; gap: 2px; margin: 12px 0 4px; overflow-x: auto; }
.pipeline form { flex: 1; min-width: 90px; }
.pipeline button { width: 100%; border: 0; padding: 7px 8px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--panel-2); color: var(--muted); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.pipeline form:first-child button { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
.pipeline .done button { background: color-mix(in srgb, var(--c) 25%, var(--panel)); color: var(--text); }
.pipeline .current button { background: var(--c); color: #fff; }
.money-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.money-box div { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.money-box span { display: block; font-size: 12px; color: var(--muted); }
.money-box b { font-size: 16px; }
.money-box .balance b { color: var(--danger); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.phone-list li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.phone-list .invalid { text-decoration: line-through; color: var(--muted); }

/* ---------- kalendarz ---------- */
.cal-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.cal-toolbar h2 { margin: 0 8px; min-width: 220px; }
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-grid { display: grid; }
.cal-head { display: grid; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal-head div { padding: 6px; font-size: 12.5px; font-weight: 600; text-align: center; border-left: 1px solid var(--line); }
.cal-head div.today { color: var(--primary); }
.cal-allday { display: grid; border-bottom: 1px solid var(--line); min-height: 30px; }
.cal-allday .cell { border-left: 1px solid var(--line); padding: 2px; display: flex; flex-direction: column; gap: 2px; }
.cal-body { display: grid; position: relative; overflow-y: auto; max-height: calc(calc(100vh / var(--ui-zoom, 1)) - 260px); }
.cal-times { display: flex; flex-direction: column; }
.cal-times div { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding: 0 6px; border-top: 1px solid var(--line); }
.cal-day { position: relative; border-left: 1px solid var(--line); }
.cal-day .slot { height: 24px; border-top: 1px solid var(--line); }
.cal-day .slot.half { border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.cal-day .slot.offhours { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.cal-day .slot.drop-ok, .cal-month .mday.drop-ok { background: var(--primary-soft); }
.cal-day.today { background: color-mix(in srgb, var(--primary-soft) 35%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.ev { position: absolute; left: 2px; right: 2px; border-radius: 6px; padding: 2px 5px; font-size: 12px; overflow: hidden; background: color-mix(in srgb, var(--c) 22%, var(--panel)); border-left: 3px solid var(--c); cursor: pointer; z-index: 2; line-height: 1.25; }
.ev.chip { position: static; white-space: nowrap; text-overflow: ellipsis; }
.ev.done { opacity: .55; text-decoration: line-through; }
.ev.overdue { box-shadow: inset 0 0 0 1px var(--danger); }
.ev .evt { font-weight: 600; }
.ev[draggable=true] { cursor: grab; }
.ev.more { --c: var(--muted); background: var(--panel-2); color: var(--primary); font-weight: 700; text-decoration: none; border: 1px dashed var(--line-2); border-left: 3px solid var(--muted); z-index: 3; white-space: nowrap; }
.ev.more:hover { background: var(--primary-soft); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month .mday { min-height: 110px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.cal-month .mday.other { background: var(--panel-2); color: var(--muted); }
.cal-month .mday.today .dnum { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 6px; }
.cal-month .mday.holiday .dnum { color: var(--danger); }
.cal-month .dnum { font-size: 12px; align-self: flex-end; }
.agenda .aday { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.agenda .aday h3 { margin: 4px 0; }
.popover { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: 12px; width: 300px; }
.popover h4 { margin: 0 0 6px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }

/* ---------- rozmowa / wiadomości ---------- */
.call-status { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--panel-2); margin-bottom: 12px; }
.call-status .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.call-status.live .pulse { background: var(--ok); animation: pulse 1.2s infinite; }
.call-status.err .pulse { background: var(--danger); }
.rec-ind { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; }
.rec-ind::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1 } 50% { opacity: .3 } 100% { opacity: 1 } }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.outcomes label { cursor: pointer; }
.outcomes input { position: absolute; opacity: 0; pointer-events: none; }
.outcomes span { display: inline-block; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); border-left: 4px solid var(--c); background: var(--panel); font-weight: 550; }
.outcomes input:checked + span { background: color-mix(in srgb, var(--c) 22%, var(--panel)); border-color: var(--c); }
.outcomes input:focus-visible + span { outline: 2px solid var(--primary); }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.bubble { max-width: 72%; padding: 8px 12px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--primary-soft); }
.bubble .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.bubble .meta.err { color: var(--danger); }
.bubble img { max-width: 240px; border-radius: 8px; display: block; margin-top: 6px; }
.composer textarea { min-height: 90px; }
.counter { font-size: 12px; color: var(--muted); }
audio { width: 100%; }

/* ---------- okno modalne, powiadomienia ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 18, 35, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal-box { background: var(--panel); border-radius: 12px; width: 100%; max-width: 640px; padding: 20px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: #1c2333; color: #fff; padding: 10px 14px; border-radius: 10px; max-width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast a { color: #9fc0ff; }
.toast.err { background: var(--danger); }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; z-index: 40; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--panel-2); text-decoration: none; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 45; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.ac-list div { padding: 6px 10px; cursor: pointer; }
.ac-list div:hover, .ac-list div.on { background: var(--primary-soft); }
.ac-list small { color: var(--muted); margin-left: 6px; }

/* ---------- logowanie ---------- */
.auth-wrap { min-height: calc(100vh / var(--ui-zoom, 1)); display: grid; place-items: center; padding: 20px; }
.card.auth { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.card.auth h1 { text-align: center; }

/* ---------- ustawienia ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.settings-grid a.card { color: var(--text); margin: 0; }
.settings-grid a.card:hover { text-decoration: none; border-color: var(--primary); }
.settings-grid a.card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 6px; }
tr.dragging td { opacity: .4; }
.cap-table td:first-child { width: 40%; }
.yes { color: var(--ok); font-weight: 700; } .no { color: var(--muted); }

@media (max-width: 1100px) {
  .dash-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-block; }
  .content { padding: 12px; }
  .grid-form, .form .grid-form { grid-template-columns: minmax(0, 1fr); }
  .act-row, .act-list.compact .act-row { grid-template-columns: 26px minmax(0, 1fr); }
  .act-when { grid-column: 2; }
  .act-main { grid-column: 2; }
  .act-actions { grid-column: 2; }
  .topbar { padding: 8px 12px; }
  .bubble { max-width: 90%; }
}
@media print { .sidebar, .topbar, .btn, .form-actions { display: none !important; } .content { padding: 0; } .card { box-shadow: none; } }

/* sprzedaż: szanse i zadania */
span.overdue { color: var(--danger); font-weight: 600; }
.party-match { border-width: 2px; padding: 16px 18px; font-size: 15px; }
.party-match h3 { margin: 0 0 10px; font-size: 18px; }
.party-match .party-option { align-items: flex-start; margin-top: 8px; }
.party-match .party-involvement { margin: 4px 0 10px 26px; font-size: 13px; }
.party-match .party-different { margin-top: 14px; opacity: .85; }

/* karty rozmów do uzupełnienia – pasek na każdej stronie */
.call-cards { background: var(--danger); color: #fff; padding: 8px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; animation: cards-blink 1.2s ease-in-out infinite; }
.call-cards > b { white-space: nowrap; }
#call-cards-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1; max-height: 92px; overflow-y: auto; }
.call-cards a { color: #fff; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 2px 12px; text-decoration: none; white-space: nowrap; }
.call-cards a.here { background: #fff; color: var(--danger); font-weight: 600; }
@keyframes cards-blink { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }
@media (prefers-reduced-motion: reduce) { .call-cards { animation: none; } }

/* okno połączenia przychodzącego */
.incoming { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.incoming.hidden { display: none; }
.inc-box { width: min(480px, 100%); max-height: calc(94vh / var(--ui-zoom, 1)); overflow: auto; background: var(--panel); color: var(--text); border: 3px solid var(--ok); border-radius: 14px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.inc-top { color: var(--ok); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.inc-who { font-size: 26px; font-weight: 700; line-height: 1.2; }
.inc-sub { color: var(--muted); margin-bottom: 12px; }
.inc-ctx { background: var(--panel-2); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.inc-ctx.warn { background: var(--warn-soft); color: var(--warn); }
.inc-ctx ul { margin: 4px 0 0; padding-left: 18px; } .inc-ctx small { color: var(--muted); }
.inc-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 10px; }
.inc-main .btn { padding: 14px 10px; font-size: 17px; font-weight: 600; justify-content: center; }
.inc-sms { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .inc-sms .btn { justify-content: flex-start; }
.inc-own { display: flex; gap: 6px; } .inc-own input { flex: 1; min-width: 0; }
.inc-foot { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }

/* karta rozmowy jako okno nałożone na bieżącą stronę (maksymalizacja / minimalizacja) */
.card-window { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px 16px; }
.card-window.hidden { display: none; }
.cw-box { width: min(1100px, 100%); max-height: calc(calc(100vh / var(--ui-zoom, 1)) - 72px); display: flex; flex-direction: column; background: var(--bg); border: 2px solid var(--danger); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.cw-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--danger); color: #fff; border-radius: 9px 9px 0 0; }
.cw-actions { display: flex; gap: 6px; }
.cw-body { overflow: auto; padding: 16px; }
.card-window.forced [data-cw="min"] { display: none; }
.call-cards a.live { background: var(--ok); border-color: var(--ok); }


/* dopasowanie do monitora: wielkość całości (tekst, przyciski, odstępy) ustawia static/js/zoom.js – płynnie, z rozmiaru okna
   przeglądarki; przybliżanie i oddalanie w przeglądarce działa na tym normalnie. Bez skryptu obowiązuje wielkość 1. */
:root { --ui-zoom: 1; }
body { zoom: var(--ui-zoom); }
