/* ===================================================================
   Jerry — system wizualny v3 ("petrol + sygnał")
   Ciemny petrol zamiast czerni, bursztynowy akcent jak lampka linii
   telefonicznej. Nagłówki i liczby: Bricolage Grotesque, treść: IBM Plex Sans.
   Motyw sterowany atrybutem data-theme na <html> (dark domyślnie).
   =================================================================== */

:root {
  --bg: #0c171c;
  --bg-elev: #0f1d23;
  --surface: #122229;
  --surface-2: #182e36;
  --surface-3: #1f3943;
  --border: #213d47;
  --border-strong: #2f5561;

  --text: #e6efee;
  --text-muted: #93abae;
  --text-dim: #62797d;

  --primary: #f2b23a;
  --primary-hover: #f7c35e;
  --primary-ink: #13212a;
  --primary-soft: rgba(242, 178, 58, .14);
  --primary-grad: linear-gradient(#f2b23a, #f2b23a);
  --primary-2: #f2b23a;
  --link: #f2c46b;

  --success: #45d09e;
  --warning: #f2b23a;
  --danger: #f0685a;
  --info: #62b4ee;

  --chart-1: #62b4ee;
  --chart-2: #45d09e;
  --chart-3: #f2b23a;

  --success-soft: rgba(69, 208, 158, .14); --success-text: #6fe0b6;
  --warning-soft: rgba(242, 178, 58, .15); --warning-text: #f5c563;
  --danger-soft:  rgba(240, 104, 90, .15); --danger-text:  #f78d82;
  --info-soft:    rgba(98, 180, 238, .15); --info-text:    #8ccaf5;
  --purple-soft:  rgba(160, 138, 240, .16);--purple-text:  #bfb0f7;
  --pink-soft:    rgba(236, 120, 170, .15);--pink-text:    #f3a3c6;

  --input-bg: #0e1b21;

  --sidebar-bg: #0a1519;
  --sidebar-text: #8ea5a9;
  --sidebar-text-strong: #eef5f4;
  --sidebar-hover: #132329;
  --sidebar-active: rgba(242, 178, 58, .1);
  --sidebar-border: #17292f;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --bottom-nav-h: 0px;

  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #edf2f1;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f7f6;
  --surface-3: #e8efee;
  --border: #d7e2e1;
  --border-strong: #b9cacb;

  --text: #10232b;
  --text-muted: #4d666d;
  --text-dim: #849a9f;

  --primary: #e7a02a;
  --primary-hover: #d9921c;
  --primary-ink: #13212a;
  --primary-soft: rgba(231, 160, 42, .14);
  --primary-grad: linear-gradient(#e7a02a, #e7a02a);
  --primary-2: #e7a02a;
  --link: #0c6f79;

  --success: #16936a;
  --warning: #b87408;
  --danger: #c8443a;
  --info: #1f78b4;

  --chart-1: #2a7fc0;
  --chart-2: #16936a;
  --chart-3: #d38c14;

  --success-soft: #dff5ec; --success-text: #0f6e4f;
  --warning-soft: #fcefd4; --warning-text: #8a5406;
  --danger-soft:  #fbe3e0; --danger-text:  #a3342b;
  --info-soft:    #e0eefa; --info-text:    #175c8c;
  --purple-soft:  #ece7fb; --purple-text:  #563ca6;
  --pink-soft:    #fbe6ef; --pink-text:    #97305e;

  --input-bg: #ffffff;

  --sidebar-bg: #10232b;
  --sidebar-text: #9bb3b7;
  --sidebar-text-strong: #f4f8f7;
  --sidebar-hover: #183039;
  --sidebar-active: rgba(242, 178, 58, .14);
  --sidebar-border: #183039;

  --shadow: 0 1px 3px rgba(16, 35, 43, .07), 0 10px 28px rgba(16, 35, 43, .07);
  --shadow-sm: 0 1px 2px rgba(16, 35, 43, .06);
}

/* === Reset i typografia === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--text); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em;
  background: var(--surface-2); color: var(--text); padding: .1em .4em; border-radius: 5px;
}
::placeholder { color: var(--text-dim); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.i { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
.i-lg { width: 1.4em; height: 1.4em; }
.display { font-family: var(--font-display); }
.num-tab { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* === Layout === */
.layout { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; height: 100vh; z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform .25s ease;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.1rem .8rem; }
.logo {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--sidebar-text-strong); display: inline-flex; align-items: center; gap: .55rem;
}
.logo:hover { text-decoration: none; }
.logo__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: var(--primary-ink);
  font-size: 1rem; font-weight: 800;
}
.logo__sub { font-family: var(--font-body); font-size: .72rem; font-weight: 500; color: var(--sidebar-text); display: block; letter-spacing: 0; margin-top: -.15rem; }
.sidebar-close { display: none; background: none; border: none; color: var(--sidebar-text); cursor: pointer; padding: .4rem; }
.nav-links { list-style: none; padding: .1rem .6rem 1rem; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.nav-section { font-size: .74rem; font-weight: 600; color: var(--text-dim); padding: 1rem .65rem .3rem; }
.nav-links li a {
  display: flex; align-items: center; gap: .65rem; position: relative;
  margin: 1px 0; padding: .45rem .65rem; color: var(--sidebar-text);
  border-radius: 9px; font-size: .88rem; font-weight: 500; transition: background .12s, color .12s;
}
.nav-links li a .i { width: 18px; height: 18px; opacity: .85; }
.nav-links li a:hover { color: var(--sidebar-text-strong); background: var(--sidebar-hover); text-decoration: none; }
.nav-links li a.active { color: var(--sidebar-text-strong); background: var(--sidebar-active); font-weight: 600; }
.nav-links li a.active .i { color: var(--primary); opacity: 1; }
.nav-links li a.active::before {
  content: ''; position: absolute; left: -.6rem; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-icon { font-size: 1rem; width: 1.35rem; text-align: center; flex-shrink: 0; }
.badge-count {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700; padding: .05em .5em; line-height: 1.5;
  border-radius: 99px; min-width: 1.5em; text-align: center; font-variant-numeric: tabular-nums;
}
.badge-count--blue { background: var(--info); color: #06243a; }
.badge-count--warn { background: var(--primary); color: var(--primary-ink); }
.sidebar-footer {
  padding: .8rem 1.1rem; border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.logout-btn { color: var(--sidebar-text); font-size: .85rem; font-weight: 500; display: inline-flex; gap: .45rem; align-items: center; }
.logout-btn:hover { color: var(--sidebar-text-strong); text-decoration: none; }

/* === Main === */
.main-content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.5rem; position: sticky; top: 0; z-index: 50;
}
.hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: .3rem; }
.page-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.search-trigger {
  display: inline-flex; align-items: center; gap: .55rem; width: 260px; max-width: 34vw;
  padding: .42rem .75rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); font-size: .85rem; cursor: pointer; font-family: inherit;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-muted); }
.search-trigger kbd { margin-left: auto; font-family: inherit; font-size: .72rem; border: 1px solid var(--border); border-radius: 5px; padding: 0 .35rem; color: var(--text-dim); }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .12s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.content { padding: 1.5rem; flex: 1; max-width: 1480px; width: 100%; margin: 0 auto; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(4, 10, 12, .6); z-index: 90; }

/* dolny pasek zakładek — tylko telefon */
.bottom-nav { display: none; }

/* === Page header (nowe ekrany) === */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h2 { font-size: 1.6rem; font-weight: 800; }
.page-head p { color: var(--text-muted); margin-top: .2rem; max-width: 70ch; }
.page-head__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* === Cards === */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden;
}
.card-header {
  padding: .85rem 1.15rem; font-weight: 600; font-size: .92rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}
.card-header h3 { font-size: 1rem; }
.card-body { padding: 1.15rem; }
.card--flush .card-body { padding: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.grid-2 > .card, .grid-3 > .card, .grid-main-side > * > .card { min-width: 0; }

/* === Stats === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .95rem 1.05rem; display: flex; flex-direction: column; gap: .1rem; position: relative; overflow: hidden;
}
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.stat-sub { font-size: .75rem; color: var(--text-dim); }
.stat-card--blue .stat-value, .stat-card--info .stat-value { color: var(--info); }
.stat-card--green .stat-value { color: var(--success); }
.stat-card--yellow .stat-value { color: var(--primary); }
.stat-card--cyan .stat-value { color: var(--info-text); }
.stat-card--purple .stat-value { color: var(--purple-text); }
.stat-card--danger .stat-value { color: var(--danger); }
.stats-grid--7 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stats-grid--6 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stats-grid--4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Panel statusu wysyłki (dashboard email) */
.send-status { border: 1px solid var(--border); }
.send-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--border); }
.kpi { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-right: 1px solid var(--border); }
.kpi:last-child { border-right: none; }
.kpi__icon { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--surface-2); }
.kpi__icon--green { background: var(--success-soft); }
.kpi__icon--blue { background: var(--info-soft); }
.kpi__icon--red { background: var(--danger-soft); }
.kpi__icon--purple { background: var(--purple-soft); }
.kpi__value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: .76rem; color: var(--text-muted); font-weight: 500; }
.acct-list { display: flex; flex-direction: column; }
.acct-row { display: grid; grid-template-columns: minmax(140px, 1.4fr) 2.2fr auto; gap: .5rem 1rem; align-items: center; padding: .6rem 1.2rem; border-bottom: 1px solid var(--border); }
.acct-row:last-child { border-bottom: none; }
.acct-row__who { min-width: 0; }
.acct-row__label { font-weight: 600; font-size: .86rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.acct-row__email { font-size: .76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row__meta { font-size: .8rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.acct-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.acct-bar__fill { height: 100%; border-radius: 99px; background: var(--primary); min-width: 2px; transition: width .4s ease; }
.acct-bar__fill--full { background: var(--success); }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.acct-dot--ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.acct-dot--warning { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.acct-dot--paused { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.charts-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; }
.charts-grid > .card { margin-bottom: 1.25rem; min-width: 0; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem .95rem; border-radius: var(--radius-sm); font-size: .875rem;
  font-weight: 600; cursor: pointer; border: 1px solid transparent; font-family: inherit;
  transition: background .12s, border-color .12s, color .12s, filter .12s; text-decoration: none; line-height: 1.35;
  white-space: nowrap; color: var(--text); background: var(--surface-2);
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-warning { background: var(--warning-soft); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.btn-warning:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.btn-success { background: var(--success); color: #062b1f; border-color: var(--success); }
.btn-success:hover { filter: brightness(.95); }
.btn-link { background: none; border-color: transparent; color: var(--link); padding-left: .25rem; padding-right: .25rem; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.25rem; font-size: 1rem; border-radius: 12px; }
.btn-icon { padding: .42rem .5rem; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label, .label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .85rem; }
.form-control {
  width: 100%; padding: .55rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem; color: var(--text);
  background: var(--input-bg); transition: border-color .12s, box-shadow .12s; font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.form-control { resize: vertical; line-height: 1.55; }
select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' stroke='%2393abae' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}
input[type=date].form-control, input[type=datetime-local].form-control { color-scheme: dark; }
[data-theme="light"] input[type=date].form-control, [data-theme="light"] input[type=datetime-local].form-control { color-scheme: light; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid--3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
.font-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .85rem; }
.input-inline { display: flex; gap: .5rem; }
.input-inline .form-control { flex: 1; min-width: 0; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--primary-soft); }

/* segmentowy wybór (radio jako przyciski) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: .3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .25rem; }
.segmented label { cursor: pointer; margin: 0; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); }

/* chipy wyboru (branże, miasta) */
.chip-select { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-select label { cursor: pointer; margin: 0; font-weight: 500; }
.chip-select input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-select span { display: inline-block; padding: .3rem .7rem; border-radius: 99px; border: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); background: var(--surface); }
.chip-select span:hover { border-color: var(--border-strong); color: var(--text); }
.chip-select input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
.chip-select input:focus-visible + span { outline: 2px solid var(--primary); }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; gap: .3em;
  font-size: .72rem; font-weight: 600; padding: .18em .6em; border-radius: 99px;
  white-space: nowrap; background: var(--surface-2); color: var(--text-muted);
}
.badge--success { background: var(--success-soft); color: var(--success-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger-text); }
.badge--info    { background: var(--info-soft);    color: var(--info-text); }
.badge--purple  { background: var(--purple-soft);  color: var(--purple-text); }
.badge--outline { background: transparent; border: 1px solid var(--border-strong); }

/* Status leada: kolor przez --c (inline), miękkie tło */
.status-badge {
  display: inline-flex; align-items: center; gap: .35em; padding: .2em .65em; border-radius: 99px;
  font-size: .74rem; font-weight: 600; color: #fff; white-space: nowrap;
}
.status-pill {
  display: inline-flex; align-items: center; gap: .4em; padding: .18em .6em; border-radius: 99px;
  font-size: .74rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c, #5b6f75) 20%, transparent);
  color: color-mix(in srgb, var(--c, #5b6f75) 55%, var(--text));
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #5b6f75); }
.followup-badge { display: inline-block; font-size: .7rem; color: var(--warning); margin-left: .4rem; }
.badge-status { display:inline-block; font-size:.72rem; font-weight:600; padding:.16em .6em; border-radius:99px; white-space: nowrap; }
.badge-queued   { background: var(--info-soft);    color: var(--info-text); }
.badge-failed   { background: var(--danger-soft);  color: var(--danger-text); }
.badge-draft    { background: var(--warning-soft); color: var(--warning-text); }
.badge-first    { background: var(--success-soft); color: var(--success-text); }
.badge-followup { background: var(--purple-soft);  color: var(--purple-text); }

/* Klasa leada — pieczątka A/B/C/D (główny element rozpoznawczy) */
.tier {
  --t-bg: var(--surface-2); --t-fg: var(--text-muted); --t-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 8px;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; line-height: 1;
  background: var(--t-bg); color: var(--t-fg); border: 1.5px solid var(--t-bd);
  transform: rotate(-4deg);
}
.tier--A { --t-bg: var(--primary); --t-fg: var(--primary-ink); --t-bd: var(--primary); }
.tier--B { --t-bg: var(--success-soft); --t-fg: var(--success-text); --t-bd: color-mix(in srgb, var(--success) 55%, transparent); }
.tier--C { --t-bg: var(--surface-2); --t-fg: var(--text-muted); --t-bd: var(--border-strong); }
.tier--D { --t-bg: transparent; --t-fg: var(--text-dim); --t-bd: var(--border); border-style: dashed; }
.tier--none { --t-bg: transparent; --t-fg: var(--text-dim); --t-bd: var(--border); border-style: dotted; font-size: .7rem; }
.tier--lg { width: 44px; height: 44px; border-radius: 12px; font-size: 1.4rem; }
.tier--xl { width: 76px; height: 76px; border-radius: 18px; font-size: 2.5rem; border-width: 2px; }
.tier-block { display: flex; align-items: center; gap: .9rem; }
.tier-block__score { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tier-block__label { font-size: .85rem; color: var(--text-muted); }

.stars { display: inline-flex; align-items: center; gap: .25rem; font-size: .82rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stars .i { color: var(--primary); width: .95em; height: .95em; vertical-align: -.1em; }
.stars small { color: var(--text-muted); font-weight: 500; font-size: .78rem; }

.reason-list { display: flex; flex-direction: column; gap: .3rem; }
.reason { display: flex; gap: .55rem; font-size: .84rem; align-items: baseline; }
.reason b { font-family: var(--font-display); font-variant-numeric: tabular-nums; min-width: 2.6rem; text-align: right; }
.reason--plus b { color: var(--success); }
.reason--minus b { color: var(--danger); }
.reason--zero b { color: var(--text-dim); }

.tag-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .15em .55em; border-radius: 6px; background: color-mix(in srgb, var(--c, #5b6f75) 22%, transparent); color: color-mix(in srgb, var(--c, #5b6f75) 50%, var(--text)); border: 1px solid color-mix(in srgb, var(--c, #5b6f75) 35%, transparent); }
.tag-chip form { display: inline; }
.tag-chip button { background: none; border: none; color: inherit; cursor: pointer; padding: 0; line-height: 1; opacity: .7; }
.tag-chip button:hover { opacity: 1; }

/* === Flash (toast) === */
.flash-container { position: fixed; top: 66px; right: 20px; z-index: 300; width: min(380px, calc(100vw - 40px)); }
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: .6rem; font-size: .875rem;
  box-shadow: var(--shadow); animation: flashIn .22s ease; border: 1px solid; background: var(--surface);
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash-success { color: var(--success-text); border-color: color-mix(in srgb, var(--success) 50%, transparent); background: color-mix(in srgb, var(--success-soft) 100%, var(--surface)); }
.flash-error   { color: var(--danger-text);  border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.flash-warning { color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
.flash-info    { color: var(--info-text);    border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.flash-close { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .7; color: inherit; }
.flash-close:hover { opacity: 1; }

.alert { padding: .85rem 1.15rem; border-radius: var(--radius); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; line-height: 1.5; }
.alert > .i { flex-shrink: 0; }
@media (max-width: 640px) { .alert { flex-wrap: wrap; } }
.alert-info { background: var(--info-soft); color: var(--info-text); border: 1px solid var(--border); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--danger-text); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success-text); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); }
.info-box { background: var(--info-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .875rem; color: var(--info-text); margin-bottom: 1rem; }

/* === Filter tabs / period === */
.filter-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.tab, .period-btn {
  padding: .32rem .8rem; border-radius: 99px; font-size: .8rem; font-weight: 600;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  transition: all .12s; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem;
}
.tab:hover, .period-btn:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.tab.active, .period-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab .count { font-variant-numeric: tabular-nums; opacity: .7; font-weight: 500; }
.period-filter { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.25rem; align-items: center; }
.period-btn--sm { padding: .22rem .55rem; font-size: .75rem; }
.period-btn.disabled { opacity: .4; pointer-events: none; }
.dash-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.dash-toolbar .period-filter { margin-bottom: 0; }
.dash-toolbar > * { min-width: 0; max-width: 100%; }
.date-range { display: flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: .3rem .5rem .3rem .9rem; }
.date-range__label { font-size: .78rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.date-range__sep { color: var(--text-muted); font-size: .85rem; }
.date-input { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .3rem .5rem; font-size: .8rem; font-family: inherit; cursor: pointer; color-scheme: dark; }
[data-theme="light"] .date-input { color-scheme: light; }
.range-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary-soft); color: var(--text); border: 1px solid var(--primary); border-radius: 99px; padding: .35rem .9rem; font-size: .8rem; margin: -.5rem 0 1.25rem; }

/* === Tables === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.table th, .table td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-weight: 600; color: var(--text-muted); font-size: .76rem; background: var(--surface-2); white-space: nowrap; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tbody tr:last-child td { border-bottom: none; }
.table-sm th, .table-sm td { padding: .42rem .65rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-followup { box-shadow: inset 3px 0 0 var(--warning); }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.actions-cell { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* === Status inline (select w tabeli) === */
.status-inline {
  border: none; border-radius: 99px; color: #fff; font-family: inherit;
  font-size: .72rem; font-weight: 600; padding: .25rem 1.4rem .25rem .6rem; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center;
}
.status-inline option { color: var(--text); background: var(--surface); }

/* === Lead detail === */
.lead-detail-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.lead-hero { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1.25rem; }
.lead-hero__main { flex: 1; min-width: 240px; }
.lead-hero h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.025em; }
.lead-hero__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--text-muted); font-size: .88rem; margin-top: .35rem; align-items: center; }
.lead-hero__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.action-stack { display: flex; flex-direction: column; gap: .5rem; }
.info-list { display: grid; grid-template-columns: 1fr 2fr; gap: .45rem .75rem; font-size: .87rem; }
.info-list dt { color: var(--text-muted); font-weight: 500; }
.info-list dd { min-width: 0; overflow-wrap: anywhere; }
.info-list--horizontal { grid-template-columns: auto 1fr; }

/* oś czasu */
.timeline { list-style: none; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.9rem; }
.timeline li::before { content: ''; position: absolute; left: .55rem; top: 1.4rem; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: .1rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.tl-dot .i { width: .7rem; height: .7rem; }
.tl-dot--call { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.tl-dot--ig { color: var(--pink-text); border-color: color-mix(in srgb, var(--pink-text) 40%, transparent); }
.tl-dot--mail { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
.tl-dot--in { color: var(--success); border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.tl-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; font-size: .87rem; }
.tl-head strong { font-weight: 600; }
.tl-time { color: var(--text-dim); font-size: .76rem; margin-left: auto; white-space: nowrap; }
.tl-body { font-size: .85rem; color: var(--text-muted); white-space: pre-wrap; margin-top: .2rem; overflow-wrap: anywhere; }
.tl-body--link { display: inline-block; font-size: .8rem; }

/* Wątek maili: jeden temat na górze, dymki jak w komunikatorze, cytaty schowane */
.thread { display: flex; flex-direction: column; gap: .75rem; }
.thread__topic { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); min-width: 0; }
.thread__topic .i { width: 1rem; height: 1rem; flex-shrink: 0; }
.thread__subject { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread__count { margin-left: auto; font-size: .76rem; color: var(--text-dim); white-space: nowrap; }
.thread__msgs { display: flex; flex-direction: column; gap: .55rem; max-height: min(560px, 70vh); overflow-y: auto; overscroll-behavior: contain; padding: .25rem .1rem; }
.thread__day { align-self: center; font-size: .72rem; color: var(--text-dim); padding: .15rem .6rem; border-radius: 99px; background: var(--surface-3); margin: .35rem 0 .1rem; }
.msg { max-width: min(88%, 62ch); padding: .6rem .85rem .7rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.msg--in { align-self: flex-start; border-bottom-left-radius: 5px; }
.msg--out { align-self: flex-end; background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 28%, transparent); border-bottom-right-radius: 5px; }
.msg--system { opacity: .75; border-style: dashed; }
.msg__meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .74rem; color: var(--text-muted); margin-bottom: .25rem; }
.msg__who { font-weight: 700; color: var(--text); }
.msg__meta time { margin-left: auto; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.msg__tag { font-size: .68rem; font-weight: 600; padding: .05em .5em; border-radius: 99px; background: var(--surface-3); color: var(--text-muted); }
.msg__tag--bad { background: var(--danger-soft); color: var(--danger-text); }
.msg__tag--ok { background: var(--success-soft); color: var(--success-text); }
.msg__subject { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .2rem; }
.msg__body { font-size: .9rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.msg__quote { margin-top: .45rem; }
.msg__quote summary { font-size: .74rem; color: var(--text-dim); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem 0; }
.msg__quote summary::-webkit-details-marker { display: none; }
.msg__quote summary::before { content: '···'; letter-spacing: .08em; padding: 0 .4rem; border-radius: 99px; background: var(--surface-3); line-height: 1.3; }
.msg__quote[open] summary { margin-bottom: .3rem; }
.msg__quote-body { font-size: .8rem; line-height: 1.5; color: var(--text-muted); white-space: pre-line; overflow-wrap: anywhere; border-left: 2px solid var(--border-strong); padding-left: .65rem; max-height: 260px; overflow-y: auto; }
.thread__draft { border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); background: var(--surface); border-radius: var(--radius-sm); padding: .8rem; }
.thread__draft-label { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; margin-bottom: .45rem; }
.thread__draft textarea, .thread__reply textarea { font-family: inherit; line-height: 1.55; }
.thread__reply { display: flex; gap: .5rem; align-items: flex-end; }
.thread__reply textarea { flex: 1; min-height: 2.75rem; resize: vertical; }
.thread__profile { align-self: flex-start; padding-left: 0; }

/* === Empty states === */
.empty-state { text-align: center; padding: 2.75rem 1.5rem; color: var(--text-muted); }
.empty-state > .i { width: 2.2rem; height: 2.2rem; color: var(--text-dim); margin-bottom: .6rem; }
.empty-icon { font-size: 2.4rem; margin-bottom: .6rem; opacity: .8; }
.empty-state h3 { color: var(--text); margin-bottom: .4rem; }
.empty-state p { margin: 0 auto 1.1rem; max-width: 52ch; }
.empty-state-small { text-align: center; padding: 1.75rem 1rem; color: var(--text-muted); font-size: .9rem; }

/* === Import === */
.divider-text { text-align: center; color: var(--text-muted); font-size: .85rem; margin: 1rem 0; position: relative; }
.divider-text::before, .divider-text::after { content: ''; position: absolute; top: 50%; width: 45%; height: 1px; background: var(--border); }
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }
.file-upload-area { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2rem; text-align: center; cursor: pointer; position: relative; transition: all .15s; background: var(--surface-2); }
.file-upload-area:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-upload-label { display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.file-icon { font-size: 2rem; }
.hints { margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.hints summary { padding: .65rem 1rem; cursor: pointer; font-size: .875rem; font-weight: 600; }
.hints-body { padding: 0 1rem 1rem; }
.code-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem 1rem; font-family: 'IBM Plex Mono', monospace; font-size: .8rem; color: var(--text); overflow-x: auto; white-space: pre; }
.mapping-table { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.mapping-row { display: grid; grid-template-columns: 200px 24px 1fr; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.mapping-row--required { background: var(--primary-soft); }
.mapping-label { font-size: .875rem; font-weight: 600; }
.mapping-arrow { color: var(--text-muted); font-size: 1rem; text-align: center; }
.mapping-select select { margin: 0; }

/* === Reply queue / drafts === */
.draft-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius); margin-bottom: .6rem; }
.draft-focused { border-left-color: var(--primary); }
.inbound-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem; }
.inbound-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .4rem; }
.inbound-body { font-size: .875rem; color: var(--text); white-space: pre-wrap; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.op-badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .16em .6em; border-radius: 99px; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.op-generate_email { background: var(--info-soft); color: var(--info-text); }
.op-generate_reply { background: var(--success-soft); color: var(--success-text); }
.op-analyze_reply  { background: var(--purple-soft); color: var(--purple-text); }
.op-detect_meeting { background: var(--warning-soft); color: var(--warning-text); }
.op-weekly_report  { background: var(--pink-soft); color: var(--pink-text); }
.op-call_script    { background: var(--warning-soft); color: var(--warning-text); }

/* === Settings === */
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.mode-option { cursor: pointer; border: 2px solid var(--border); border-radius: var(--radius); padding: 1.2rem; transition: all .15s; position: relative; }
.mode-option:hover { border-color: var(--border-strong); }
.mode-option input[type=radio] { position: absolute; opacity: 0; }
.mode-option:has(input:checked), .mode-active { border-color: var(--primary); background: var(--primary-soft); }
.mode-content { text-align: center; }
.mode-icon { font-size: 2rem; margin-bottom: .5rem; }
.mode-title { font-weight: 700; font-size: 1rem; margin-bottom: .4rem; font-family: var(--font-display); }
.mode-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.current-mode-info { margin-bottom: 1rem; font-size: .875rem; color: var(--text-muted); }
.settings-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .3rem; width: fit-content; max-width: 100%; }
.settings-tab { padding: .42rem .95rem; font-size: .85rem; font-weight: 600; color: var(--text-muted); border-radius: 9px; transition: all .12s; white-space: nowrap; }
.settings-tab:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.settings-tab.active { color: var(--primary-ink); background: var(--primary); }
.pkg-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.pkg-row .form-control { margin-bottom: 0; }
.pkg-row .pkg-name { flex: 1; min-width: 120px; }
.pkg-row .pkg-price { flex: 0 0 130px; }
.pkg-row .pkg-desc { flex: 2; min-width: 140px; }
.days-grid { display: flex; gap: .5rem; flex-wrap: wrap; }
.day-checkbox { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .5rem .75rem; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; color: var(--text-muted); transition: all .15s; min-width: 48px; }
.day-checkbox:hover { border-color: var(--border-strong); }
.day-checkbox input { display: none; }
.day-checkbox:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.tone-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.tone-option { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; padding: .75rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); transition: all .15s; }
.tone-option:hover { border-color: var(--border-strong); }
.tone-option input { margin-top: .2rem; accent-color: var(--primary); }
.tone-option.tone-active { border-color: var(--primary); background: var(--primary-soft); }
.tone-title { font-weight: 600; font-size: .9rem; }

/* === Kampanie === */
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.campaign-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem; }
.campaign-card__header { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.campaign-card__name { font-size: 1rem; font-family: var(--font-display); }
.campaign-card__desc { line-height: 1.5; }
.campaign-card__hint { color: var(--text-muted); }
.campaign-card__footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); }
.campaign-style-badge, .campaign-style-badge.style-A, .campaign-style-badge.style-B, .campaign-style-badge.style-C, .campaign-style-badge.style-D { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 8px; font-size: .75rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.style-A, .campaign-style-A { background: #2f78c4; }
.style-B, .campaign-style-B { background: #1f8fa3; }
.style-C, .campaign-style-C { background: #2a9463; }
.style-D, .campaign-style-D { background: #b8741a; }
.campaign-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .16em .6em; border-radius: 99px; color: #fff; white-space: nowrap; }
.style-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .25rem; }
.style-option { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; padding: .75rem 1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); transition: all .15s; }
.style-option:hover { border-color: var(--border-strong); }
.style-option input { display: none; }
.style-option.style-active { border-color: var(--primary); background: var(--primary-soft); }
.style-option__badge { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 8px; font-size: .75rem; font-weight: 800; color: #fff; flex-shrink: 0; margin-top: .1rem; }
.style-option__title { font-weight: 600; font-size: .9rem; }
.style-option__desc { margin-top: .1rem; }
.filter-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.filter-row > div { min-width: 0; max-width: 100%; }
.campaign-filter { flex-shrink: 0; }

/* Uwaga (dashboard email) */
.attention-card { border-left: 3px solid var(--warning); }
.attention-card .card-body { padding: 0; }
.attention-list { display: flex; flex-direction: column; gap: .4rem; }
.attention-item { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .45rem 1.2rem; font-size: .875rem; border-bottom: 1px solid var(--border); }
.attention-item:last-child { border-bottom: none; }
.attention-item .lead-name { flex: 1; }
.attn-group { border-top: 1px solid var(--border); }
.attn-group:first-child { border-top: none; }
.attn-group__header { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1.2rem; cursor: pointer; user-select: none; }
.attn-group__header:hover { background: var(--surface-2); }
.attn-group__title { font-size: .84rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.attn-count { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: var(--primary-ink); font-size: .7rem; font-weight: 700; border-radius: 999px; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; }
.attn-arrow { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.attn-more-btn { display: block; width: 100%; padding: .45rem 1.2rem; background: none; border: none; border-top: 1px solid var(--border); color: var(--link); font-size: .8rem; cursor: pointer; text-align: left; font-family: inherit; }
.attn-more-btn:hover { background: var(--surface-2); }

.rate-badge { display: inline-block; padding: .08em .5em; border-radius: 99px; font-size: .7rem; font-weight: 700; background: var(--surface-2); color: var(--text-muted); }
.rate-badge--green { background: var(--success-soft); color: var(--success-text); }
.rate-badge--cyan { background: var(--info-soft); color: var(--info-text); }
.chart-wrapper { position: relative; height: 240px; }
.chart-wrapper--sm { height: 200px; }
.chart-wrapper--lg { height: 300px; }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: .85rem; text-align: center; padding: 1rem; }
.next-action { display: inline-block; font-size: .78rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.next-action--primary { color: var(--link); font-weight: 600; }
.next-action--warn { color: var(--warning); font-weight: 600; }
.next-action--green { color: var(--success); font-weight: 600; }
.sort-buttons { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.cost-bar-wrap { display: flex; align-items: center; gap: .5rem; min-width: 100px; }
.cost-bar { height: 6px; border-radius: 99px; background: var(--primary); min-width: 2px; flex-shrink: 0; }
.cost-bar-wrap span { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.meeting-upcoming { font-weight: 600; color: var(--primary); white-space: nowrap; }

/* reguły personalizacji */
.rule-list { display: flex; flex-direction: column; }
.rule-item { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem 1.2rem; border-bottom: 1px solid var(--border); }
.rule-item:hover { background: var(--surface-2); }
.rule-item--disabled { opacity: .5; }
.rule-item__pos { width: 1.25rem; text-align: center; flex-shrink: 0; padding-top: .15rem; }
.rule-item__body { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.rule-condition { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .875rem; }
.rule-col-badge { display: inline-block; padding: .1em .5em; border-radius: 6px; background: var(--purple-soft); color: var(--purple-text); font-size: .75rem; font-weight: 600; }
.rule-instruction { color: var(--text); line-height: 1.4; }
.rule-item__actions { display: flex; gap: .25rem; flex-shrink: 0; align-items: flex-start; flex-wrap: wrap; }
.add-rule-form { padding: 1rem 1.2rem; background: var(--surface-2); border-top: 2px dashed var(--border); }
.add-rule-form__title { font-weight: 600; font-size: .875rem; margin-bottom: .75rem; }
.add-rule-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; margin-bottom: .5rem; }
.applied-rules-list { display: flex; flex-direction: column; gap: .4rem; }
.applied-rule-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; padding: .35rem .5rem; background: var(--success-soft); border-radius: var(--radius-sm); border-left: 3px solid var(--success); font-size: .85rem; }
.applied-rule-cond { font-weight: 600; color: var(--success-text); }
.applied-rule-instr { color: var(--text-muted); flex: 1; }

/* bulk bar */
.bulk-bar { display: none; align-items: center; gap: .6rem; padding: .55rem .9rem; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); border-radius: var(--radius-sm); margin-bottom: .6rem; font-size: .875rem; }
.bulk-bar.visible { display: flex; flex-wrap: wrap; }
.bulk-bar__count { font-weight: 700; margin-right: .25rem; }
.bulk-bar select.form-control, .bulk-bar input.form-control { width: auto; font-size: .8rem; padding: .3rem .6rem; }
.bulk-bar .bulk-field { display: flex; align-items: center; gap: .4rem; }
.bulk-bar .select-all-matching { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text); cursor: pointer; margin-left: .25rem; font-weight: 600; }

.progress { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); width: 0; transition: width .4s ease; }

.dup-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .1em .5em; border-radius: 99px; background: var(--warning-soft); color: var(--warning-text); border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent); }
.dup-group { border-bottom: 2px solid var(--border); }
.dup-group:last-child { border-bottom: none; }
.dup-group__header { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem 1.2rem; background: var(--warning-soft); border-bottom: 1px solid var(--border); }
.dup-group__name { font-weight: 600; font-size: .9rem; }
.dup-row--flagged { background: var(--warning-soft) !important; }

.bulk-send-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.draft-card__header { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; flex-wrap: wrap; }
.draft-card__meta { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.draft-card__company { font-weight: 600; }
.draft-card__subject { flex: 1; font-size: .875rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.draft-card__body { padding: 0 1rem 1rem; border-top: 1px solid var(--border); }
.draft-body-text { font-family: inherit; font-size: .85rem; white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-top: .75rem; line-height: 1.6; max-height: 320px; overflow-y: auto; }

.list-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.list-bar .search-input { flex: 1 1 220px; max-width: 300px; }
.list-bar form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin: 1rem 0 .5rem; }
.pagination__links { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pagination__gap { color: var(--text-muted); padding: 0 .15rem; }

.conv-list { display: flex; flex-direction: column; }
.conv-row { border-bottom: 1px solid var(--border); }
.conv-row:last-child { border-bottom: none; }
.conv-row__head { display: flex; align-items: flex-start; gap: .8rem; width: 100%; padding: .8rem 1.1rem; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.conv-row__head:hover { background: var(--surface-2); }
.conv-row__head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.conv-avatar { flex-shrink: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; background: var(--surface-3); color: var(--text-muted); }
.conv-row--waiting .conv-avatar { background: var(--primary); color: var(--primary-ink); }
.conv-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.conv-row__top { display: flex; align-items: baseline; gap: .6rem; }
.conv-row__company { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row--waiting .conv-row__company { font-weight: 800; }
.conv-row__time { margin-left: auto; font-size: .76rem; color: var(--text-dim); white-space: nowrap; }
.conv-row__snippet { color: var(--text-muted); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.conv-row__snippet b { color: var(--text); font-weight: 600; }
.conv-row__tags { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .15rem; }
.conv-row__email { color: var(--text-dim); font-size: .76rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conv-row__chev { flex-shrink: 0; color: var(--text-dim); transition: transform .15s ease; margin-top: .55rem; }
.conv-row.open .conv-row__chev { transform: rotate(180deg); }
.conv-row__body { padding: .6rem 1.1rem 1.1rem; background: var(--surface-2); }
.conv-row__body .msg--in { background: var(--surface); }

.prio-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .08rem .45rem; border-radius: 99px; margin-left: .35rem; vertical-align: middle; white-space: nowrap; }
.prio-badge--hot { background: var(--danger-soft); color: var(--danger-text); }
.prio-badge--warm { background: var(--warning-soft); color: var(--warning-text); }
.prio-badge--cold { background: var(--surface-2); color: var(--text-muted); }
.email-type-badge { display: inline-block; font-size: .8rem; margin-left: .2rem; vertical-align: middle; }
.email-type-badge--muted { opacity: .65; }

.ab-alert { padding: .6rem .85rem; border-radius: var(--radius-sm); margin-bottom: .85rem; font-size: .85rem; }
.ab-alert--warn { background: var(--warning-soft); border: 1px solid var(--warning); color: var(--warning-text); }
.ab-alert--success { background: var(--success-soft); border: 1px solid var(--success); color: var(--success-text); }
.ab-alert--info { background: var(--info-soft); border: 1px solid var(--info); color: var(--info-text); }
.ab-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .85rem; }
.ab-variant { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem; }
.ab-variant--winner { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.ab-variant__head { font-weight: 600; margin-bottom: .6rem; }
.ab-variant__sub { font-weight: 400; }
.ab-metrics { display: flex; gap: .5rem; text-align: center; }
.ab-metrics > div { flex: 1; }
.ab-metric-val { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ab-metric-val--win { color: var(--success); }
.ab-metric-lbl { font-size: .72rem; color: var(--text-muted); }
.ab-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; margin-left: .4rem; vertical-align: middle; }
.ab-badge--active { background: var(--success); color: #062b1f; }
.ab-badge--winner { background: var(--primary); color: var(--primary-ink); }
.ab-badge--paused { background: var(--text-dim); color: #fff; }
.quick-filters { display: flex; gap: .35rem; flex-wrap: wrap; margin: .15rem 0 .25rem; }
.funnel-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.funnel-rate { font-weight: 700; color: var(--primary); }
.narrow { max-width: 780px; }
.hr-sep { margin: 1.25rem 0; border: none; border-top: 1px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-weight: 500; }
.checkbox-label input { width: 1.1rem; height: 1.1rem; flex-shrink: 0; accent-color: var(--primary); }
.mt-sm { margin-top: .4rem; }
.mt-md { margin-top: 1rem; }
.mb-md { margin-bottom: 1rem; }
.mb-0 { margin-bottom: 0 !important; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.mini-stat__val { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-stat__val--primary { color: var(--primary); }
.mini-stat__val--green { color: var(--success); }
.mini-stat__val--amber { color: var(--warning); }
.note-box { margin-top: 1rem; padding: .6rem 1rem; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: var(--radius-sm); font-size: .85rem; }
.placeholder-chip { padding: .2rem .55rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 7px; font-size: .78rem; color: var(--link); user-select: none; cursor: pointer; font-family: 'IBM Plex Mono', monospace; }
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.queue-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem; background: var(--surface-2); }
.queue-item__row { display: flex; justify-content: space-between; margin-top: .4rem; font-size: .85rem; }
.mini-bar { background: var(--bg-elev); border-radius: 99px; height: 6px; margin-top: .45rem; overflow: hidden; }
.mini-bar__fill { background: var(--primary); height: 100%; border-radius: 99px; }
.edit-row > td { background: var(--surface-2); padding: .75rem 1rem; }
.edit-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.edit-form .form-group { margin: 0; }
.alert-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-banner--danger { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--text); }
.alert-banner__tag { padding: .2rem .55rem; border-radius: 9999px; font-size: .8rem; }
.alert-banner__tag--red { background: var(--danger-soft); color: var(--danger-text); }
.alert-banner__tag--amber { background: var(--warning-soft); color: var(--warning-text); }
.dash-side-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.25rem; }
.dash-side-grid > .card { margin-bottom: 1.25rem; min-width: 0; }
.ab-stat-block { margin-bottom: .75rem; }
.ab-stat-name { font-weight: 600; font-size: .85rem; margin-bottom: .6rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ab-variant-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ab-variant-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .75rem; }
.ab-variant-card--winner { border-color: var(--success); background: var(--success-soft); }
.ab-variant-label { font-size: .78rem; font-weight: 700; margin-bottom: .35rem; }
.ab-variant-stat { display: flex; justify-content: space-between; font-size: .8rem; margin-top: .15rem; color: var(--text-muted); }

.text-muted { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }
.text-sm { font-size: .82rem !important; }
.text-xs { font-size: .74rem !important; }
.fw-600 { font-weight: 600; }
.lead-name { font-weight: 600; color: var(--text); }
.lead-name:hover { color: var(--link); text-decoration: none; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-sm { gap: .4rem; }
.gap-md { gap: .75rem; }
.ml-auto { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: .75rem; }

/* === Login === */
.login-page { background: radial-gradient(900px 520px at 15% -10%, rgba(242,178,58,.16), transparent 60%), radial-gradient(800px 480px at 95% 110%, rgba(69,208,158,.12), transparent 60%), #0c171c; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 380px; padding: 1rem; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 2.4rem 2rem; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-logo { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--primary); color: var(--primary-ink); font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; margin-bottom: .75rem; transform: rotate(-4deg); }
.login-header h1 { font-size: 1.8rem; font-weight: 800; }
.login-header p { color: var(--text-muted); margin-top: .2rem; }

/* ===================================================================
   Nowe moduły
   =================================================================== */

/* --- Plan dnia --- */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.today-head h2 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.today-head p { color: var(--text-muted); }
.streak { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--primary); }
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.goal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .95rem 1.05rem; display: flex; gap: .9rem; align-items: center; }
.goal:hover { text-decoration: none; border-color: var(--border-strong); }
.ring { --p: 0; --c: var(--primary); width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.ring::after { content: ''; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); grid-area: 1/1; }
.ring .i { grid-area: 1/1; z-index: 1; color: var(--c); width: 20px; height: 20px; }
.goal__val { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.goal__val small { font-size: .85rem; color: var(--text-dim); font-weight: 600; }
.goal__label { font-size: .8rem; color: var(--text-muted); }
.goal--done .goal__val { color: var(--success); }

.agenda { list-style: none; }
.agenda li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem 1.15rem; border-bottom: 1px solid var(--border); }
.agenda li:last-child { border-bottom: none; }
.agenda__time { font-family: var(--font-display); font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.agenda__time--late { color: var(--danger); }
.agenda__time--now { color: var(--primary); }
.agenda__what { min-width: 0; }
.agenda__title { font-weight: 600; font-size: .9rem; display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.agenda__sub { font-size: .8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda__kind { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); color: var(--text-muted); }
.agenda__kind .i { width: 13px; height: 13px; }
.agenda__kind--call { background: var(--primary-soft); color: var(--primary); }
.agenda__kind--ig { background: var(--pink-soft); color: var(--pink-text); }
.agenda__kind--mail { background: var(--info-soft); color: var(--info-text); }
.agenda__kind--meet { background: var(--success-soft); color: var(--success-text); }
.agenda__kind--money { background: var(--purple-soft); color: var(--purple-text); }
.agenda__kind--hot { background: var(--warning-soft); color: var(--warning-text); }

.lead-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 1.15rem; border-bottom: 1px solid var(--border); }
.lead-row:last-child { border-bottom: none; }
.lead-row__main { flex: 1; min-width: 0; }
.lead-row__name { font-weight: 600; font-size: .9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lead-row__sub { font-size: .79rem; color: var(--text-muted); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.pipeline-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: .5rem 0 .75rem; }
.pipeline-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--text-muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .35rem; background: var(--c); }

/* --- Wyszukiwarka (Tom) --- */
.job-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .85rem 1.15rem; border-bottom: 1px solid var(--border); }
.job-card:last-child { border-bottom: none; }
.job-status { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); }
.job-status--RUNNING, .job-status--QUEUED { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); animation: pulse 1.6s infinite; }
.job-status--DONE { background: var(--success); }
.job-status--FAILED, .job-status--INTERRUPTED { background: var(--danger); }
.job-status--STOPPED { background: var(--text-muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.job-counters { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.job-counters b { color: var(--text); font-weight: 600; }
.live-log { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .76rem; line-height: 1.55; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; height: 340px; overflow: auto; white-space: pre-wrap; color: var(--text-muted); }
.live-log .ok { color: var(--success-text); }
.live-log .blk { color: var(--primary); font-weight: 600; }
.stage-now { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.funnel-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.funnel-step { background: var(--surface-2); border-radius: 10px; padding: .7rem .8rem; }
.funnel-step b { font-family: var(--font-display); font-size: 1.4rem; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.funnel-step span { font-size: .78rem; color: var(--text-muted); }
.fieldset { border: none; margin-bottom: 1.25rem; }
.fieldset legend { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: .6rem; }

/* --- Dzwonienie --- */
.dialer { max-width: 760px; margin: 0 auto; }
.dialer-progress { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; font-size: .85rem; color: var(--text-muted); }
.dialer-progress .progress { flex: 1; height: 6px; }
.dial-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.4rem; margin-bottom: 1rem; }
.dial-card__top { display: flex; gap: 1.1rem; align-items: flex-start; }
.dial-card__name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.dial-card__meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .4rem; color: var(--text-muted); font-size: .87rem; align-items: center; }
.call-btn {
  display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%;
  margin: 1.1rem 0 .4rem; padding: 1rem 1.2rem; border-radius: 16px;
  background: var(--primary); color: var(--primary-ink); font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.call-btn:hover { background: var(--primary-hover); text-decoration: none; color: var(--primary-ink); }
.call-btn .i { width: 1.4rem; height: 1.4rem; }
.call-hint { text-align: center; font-size: .8rem; color: var(--text-muted); }
.outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.outcome { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-family: inherit; text-align: left; font-size: .88rem; font-weight: 600; min-height: 56px; }
.outcome small { font-weight: 500; color: var(--text-muted); font-size: .74rem; }
.outcome:hover { border-color: var(--border-strong); background: var(--surface-3); }
.outcome--good { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.outcome--good:hover { background: var(--success-soft); }
.outcome--bad { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.outcome--selected { outline: 2px solid var(--primary); background: var(--primary-soft); }
.quick-times { display: flex; flex-wrap: wrap; gap: .35rem; }
.script-box { background: var(--surface-2); border-radius: 12px; padding: .9rem 1rem; font-size: .9rem; white-space: pre-wrap; line-height: 1.6; }
.issue-list { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.issue { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; }
.issue__sev { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: .45rem; background: var(--text-dim); }
.issue__sev--high { background: var(--danger); }
.issue__sev--medium { background: var(--warning); }
.issue__sev--low { background: var(--info); }
.issue small { display: block; color: var(--text-muted); }

.disk-line { margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.disk-line--low { color: var(--danger-text); }

/* Wybór firm do dzwonienia: numer przy firmie = miejsce w kolejce */
.pick-filters__row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pick-filters__row > .label { min-width: 6.5rem; margin: 0; }
.pick-filters__grid { margin: 0; }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 1rem 0 .5rem; font-size: .9rem; color: var(--text-muted); }
.pick-head b { color: var(--text); font-family: var(--font-display); font-size: 1.1rem; }
.pick-list { overflow: hidden; }
.pick-row { display: flex; align-items: center; gap: .25rem; border-bottom: 1px solid var(--border); padding-right: .6rem; transition: background-color .12s ease; }
.pick-row:last-child { border-bottom: none; }
.pick-row.is-picked { background: var(--primary-soft); }
.pick-row__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .8rem; padding: .75rem 0 .75rem 1rem; margin: 0; cursor: pointer; font-weight: 400; }
.pick-row__main input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick-row__mark { flex-shrink: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: .9rem; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.pick-row.is-picked .pick-row__mark { background: var(--primary); border-color: var(--primary); }
.pick-row__main:hover .pick-row__mark { border-color: var(--primary); }
.pick-row__main input:focus-visible ~ .pick-row__mark { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick-row__info { min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.pick-row__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row__meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); min-width: 0; }
.pick-row__meta .truncate { max-width: 26ch; }
.pick-row__tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.pick-row__tags .badge .i { width: .75rem; height: .75rem; }
.pick-row__call { flex-shrink: 0; }
.pick-bar { position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + .6rem); z-index: 40; margin-top: 1rem; background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.pick-bar[hidden] { display: none; }
.pick-bar__main { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; }
.pick-bar__main .btn-primary { margin-left: auto; }
.pick-bar__count { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: .35rem .4rem; border-radius: 8px; }
.pick-bar__count b { font-family: var(--font-display); font-size: 1.15rem; }
.pick-bar__count:hover { background: var(--surface-2); }
.pick-bar__count[aria-expanded="true"] .i { transform: rotate(180deg); }
.pick-bar__panel { padding: .75rem .9rem .5rem; border-bottom: 1px solid var(--border); }
.pick-bar__panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.pick-tray { margin: 0; padding-left: 1.6rem; max-height: 38vh; overflow-y: auto; font-size: .88rem; }
.pick-tray li { padding: .1rem 0; }
.pick-tray__item { display: flex; align-items: center; gap: .5rem; }
.pick-tray__item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tray__item .btn { flex-shrink: 0; padding: .15rem .5rem; font-size: .75rem; }
.i--up { transform: rotate(180deg); }

.list-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.list-card:last-child { border-bottom: none; }
.list-card__name { font-weight: 600; font-family: var(--font-display); font-size: 1.02rem; }
.list-card__bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: .45rem; max-width: 360px; }
.list-card__bar span { display: block; height: 100%; background: var(--primary); }
.hour-grid { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; }
.hour-cell { border-radius: 6px; padding: .45rem .15rem; text-align: center; font-size: .7rem; background: color-mix(in srgb, var(--success) calc(var(--v, 0) * 1%), var(--surface-2)); color: var(--text); font-variant-numeric: tabular-nums; }
.hour-cell b { display: block; font-size: .78rem; }

/* --- Instagram --- */
.ig-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem 1rem; padding: .9rem 1.15rem; border-bottom: 1px solid var(--border); align-items: center; }
.ig-card:last-child { border-bottom: none; }
.ig-handle { font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }
.ig-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.ig-msg { grid-column: 1 / -1; background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; white-space: pre-wrap; display: none; }
.ig-card.open .ig-msg { display: block; }

/* --- Lejek (kanban) --- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .85rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; }
.kanban-col { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 320px; max-height: calc(100vh - 190px); scroll-snap-align: start; }
.kanban-col__head { padding: .7rem .85rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.kanban-col__head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.kanban-col__title { font-weight: 700; font-size: .88rem; font-family: var(--font-display); }
.kanban-col__sum { margin-left: auto; font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.kanban-list { padding: .55rem; display: flex; flex-direction: column; gap: .45rem; overflow-y: auto; flex: 1; min-height: 60px; }
.kanban-list.drag-over { background: var(--primary-soft); border-radius: 0 0 var(--radius) var(--radius); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: .6rem .7rem; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard__name { font-weight: 600; font-size: .86rem; color: var(--text); display: block; line-height: 1.3; }
.kcard__meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }
.kcard__value { font-family: var(--font-display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kcard select { margin-top: .4rem; width: 100%; font-size: .78rem; padding: .25rem .5rem; display: none; }
.kanban-more { font-size: .78rem; color: var(--text-muted); text-align: center; padding: .3rem; }

/* --- Oferty / dokument --- */
.doc { background: #fff; color: #10232b; border-radius: 16px; max-width: 860px; margin: 0 auto; padding: 3rem 3.2rem; box-shadow: var(--shadow); }
.doc h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: #10232b; }
.doc h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 1.6rem 0 .6rem; color: #10232b; }
.doc p { line-height: 1.65; }
.doc .muted { color: #587078; }
.doc-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 2px solid #10232b; padding-bottom: 1.2rem; margin-bottom: 1.4rem; }
.doc-mark { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: #f2b23a; color: #13212a; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; transform: rotate(-4deg); margin-bottom: .6rem; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .93rem; }
.doc-table th { text-align: left; font-size: .8rem; color: #587078; font-weight: 600; border-bottom: 1px solid #d7e2e1; padding: .5rem .4rem; }
.doc-table td { border-bottom: 1px solid #edf2f1; padding: .7rem .4rem; vertical-align: top; }
.doc-table td.num, .doc-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-total { display: flex; justify-content: flex-end; margin-top: .8rem; }
.doc-total table { font-size: .95rem; }
.doc-total td { padding: .25rem .4rem; }
.doc-total .grand td { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; border-top: 2px solid #10232b; padding-top: .5rem; }
.doc-cta { margin-top: 2rem; padding: 1.3rem; border-radius: 14px; background: #f5f8f7; border: 1px solid #d7e2e1; }
.doc-cta .btn-primary { background: #f2b23a; border-color: #f2b23a; color: #13212a; }
.doc-cta input { background: #fff; color: #10232b; border-color: #c9d6d5; }
.public-body { background: #e9efee; min-height: 100vh; padding: 2rem 1rem 3rem; color: #10232b; }
.public-body .alert-success { background: #dff5ec; color: #0f6e4f; }
.audit-score { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.audit-grade { width: 88px; height: 88px; border-radius: 22px; display: grid; place-items: center; font-family: var(--font-display); font-size: 2.8rem; font-weight: 800; transform: rotate(-4deg); background: #10232b; color: #f2b23a; }
.audit-grade--A, .audit-grade--B { background: #16936a; color: #fff; }
.audit-grade--C { background: #e7a02a; color: #13212a; }
.audit-grade--D, .audit-grade--E { background: #c8443a; color: #fff; }
.doc .issue small { color: #587078; }

/* --- Projekty --- */
.project-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); align-items: center; }
.project-card:last-child { border-bottom: none; }
.stage-track { display: flex; gap: 3px; margin-top: .5rem; }
.stage-track span { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); }
.stage-track span.on { background: var(--primary); }
.checklist { list-style: none; }
.checklist li { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.checklist li:last-child { border-bottom: none; }
.checklist li.done span { color: var(--text-dim); text-decoration: line-through; }
.checklist input { width: 1.05rem; height: 1.05rem; accent-color: var(--success); }
.money { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Mapa --- */
.map-wrap { height: calc(100vh - 230px); min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.leaflet-popup-content { font-family: var(--font-body); }
.leaflet-container { background: var(--surface-2); }

/* --- Paleta poleceń (Ctrl+K) --- */
.palette { position: fixed; inset: 0; z-index: 400; background: rgba(4, 10, 12, .55); display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; }
.palette.open { display: flex; }
.palette__box { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.palette__input { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.palette__input input { flex: 1; border: none; background: none; color: var(--text); font-size: 1.05rem; font-family: inherit; outline: none; }
.palette__list { max-height: 55vh; overflow-y: auto; padding: .35rem; }
.palette__item { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: var(--text); cursor: pointer; }
.palette__item:hover, .palette__item.sel { background: var(--surface-2); text-decoration: none; }
.palette__item small { color: var(--text-muted); margin-left: auto; font-size: .76rem; }
.palette__group { font-size: .74rem; color: var(--text-dim); padding: .5rem .7rem .2rem; font-weight: 600; }

/* --- Porządki --- */
.storage-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: .6rem 0; }
.storage-bar span { height: 100%; }

/* --- Drukowanie ofert/audytów --- */
@media print {
  .no-print, .sidebar, .topbar, .bottom-nav, .flash-container { display: none !important; }
  body, .public-body { background: #fff !important; padding: 0 !important; }
  .doc { box-shadow: none; padding: 0; max-width: none; }
  .main-content { margin: 0 !important; }
}

/* ===================================================================
   Responsywność
   =================================================================== */
@media (max-width: 1100px) {
  .charts-grid, .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .lead-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .lead-sidebar { order: 2; }
  .conversation { order: 1; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  :root { --bottom-nav-h: 64px; }
  .sidebar { transform: translateX(-100%); width: min(300px, 86vw); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .sidebar-close { display: inline-flex; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .nav-links li a { padding: .7rem .8rem; font-size: .96rem; }
  .sidebar-footer { padding-bottom: calc(.9rem + env(safe-area-inset-bottom, 0px)); }
  .search-trigger { width: 40px; padding: 0; justify-content: center; height: 36px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .topbar { padding: .55rem .85rem; gap: .5rem; }
  .page-title { font-size: 1.08rem; }
  .content { padding: .9rem .85rem calc(var(--bottom-nav-h) + 1.2rem + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: color-mix(in srgb, var(--bg-elev) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    height: var(--bottom-nav-h); color: var(--text-muted); font-size: .68rem; font-weight: 600;
    background: none; border: none; font-family: inherit; position: relative; cursor: pointer;
  }
  .bottom-nav .i { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .dot-badge { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .62rem; line-height: 16px; text-align: center; }

  .stats-grid, .stats-grid--4 { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .mode-options { grid-template-columns: 1fr; }
  .form-grid, .form-grid--3, .add-rule-grid, .ab-variants { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .table th, .table td { padding: .5rem .55rem; font-size: .82rem; }
  .card { border-radius: 13px; }
  .card-header { padding: .75rem 1rem; }
  .card-body { padding: 1rem; }
  .stat-value { font-size: 1.45rem; }
  .chart-wrapper { height: 210px; }
  .filter-row { flex-direction: column; gap: .5rem; }
  .period-filter, .filter-tabs, .quick-filters, .settings-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .25rem; }
  .period-filter::-webkit-scrollbar, .filter-tabs::-webkit-scrollbar, .quick-filters::-webkit-scrollbar, .settings-tabs::-webkit-scrollbar { display: none; }
  .period-btn, .tab, .settings-tab { flex-shrink: 0; }
  .settings-tabs { width: 100%; }
  .flash-container { top: 60px; right: 10px; left: 10px; width: auto; }
  .kpi { padding: .7rem .9rem; border-right: none; gap: .6rem; }
  .send-kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .acct-row { grid-template-columns: 1fr; gap: .35rem; padding: .6rem 1rem; }
  .acct-row__meta { text-align: left; }
  .list-bar .search-input { max-width: none; flex: 1; min-width: 0; }
  .list-bar form { flex: 1 1 100%; width: 100%; }
  .edit-form { flex-direction: column; align-items: stretch; }
  .msg { max-width: 94%; }
  .pick-filters__row > .label { min-width: 0; width: 100%; }
  .pick-row__main { padding-left: .8rem; gap: .6rem; }
  .pick-bar__main { flex-wrap: wrap; }
  .pick-bar__main .btn-ghost { margin-left: auto; }
  .pick-bar__main .btn-primary { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .conv-row__head, .conv-row__body { padding-left: .85rem; padding-right: .85rem; }
  .thread__reply { flex-direction: column; align-items: stretch; }
  .pkg-row .pkg-price, .pkg-row .pkg-desc, .pkg-row .pkg-name { flex: 1 1 100%; min-width: 0; }
  .info-list { grid-template-columns: 1fr; gap: .1rem .75rem; }
  .info-list dt { margin-top: .45rem; }
  .pagination { justify-content: center; }
  .form-control, select.form-control, textarea.form-control, .palette__input input { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .goals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .goal { flex-direction: column; text-align: center; padding: .75rem .4rem; gap: .45rem; }
  .ring { width: 46px; height: 46px; }
  .ring::after { width: 36px; height: 36px; }
  .goal__val { font-size: 1.2rem; }
  .goal__label { font-size: .72rem; display: block; line-height: 1.25; }
  .agenda li { grid-template-columns: 52px minmax(0, 1fr); padding: .7rem .9rem; }
  .agenda li > :last-child { grid-column: 2; justify-self: start; }
  .job-card { grid-template-columns: auto minmax(0, 1fr); }
  .job-card > :last-child { grid-column: 2; }
  .ig-card { grid-template-columns: minmax(0, 1fr); }
  .ig-actions { justify-content: flex-start; }
  .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dial-card { padding: 1.1rem; border-radius: 16px; }
  .dial-card__name { font-size: 1.35rem; }
  .call-btn { font-size: 1.3rem; }
  .doc { padding: 1.6rem 1.2rem; border-radius: 12px; }
  .doc h1 { font-size: 1.5rem; }
  .kanban { grid-auto-columns: minmax(78vw, 1fr); }
  .kanban-col { max-height: none; }
  .kcard select { display: block; }
  .map-wrap { height: calc(100vh - 260px); }
  .hour-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .page-head h2, .today-head h2 { font-size: 1.45rem; }
  .lead-hero h2 { font-size: 1.4rem; }
  .project-card, .list-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .col-campaign, .col-emails, .col-next-action, .col-hide-sm { display: none !important; }
  [data-mobile-email] { display: block !important; }
  .stats-grid--6 { grid-template-columns: 1fr 1fr; }
  .mapping-row { grid-template-columns: 1fr; }
  .mapping-arrow { display: none; }
}
@media (max-width: 480px) {
  .col-last-msg, .col-hide-xs { display: none !important; }
  .content { padding-left: .65rem; padding-right: .65rem; }
  .stat-value { font-size: 1.3rem; }
  .btn { padding: .45rem .8rem; font-size: .84rem; }
  .action-buttons .btn { width: 100%; }
  .dash-toolbar .date-range { width: 100%; }
  .date-input { flex: 1; min-width: 0; }
  .range-pill { width: 100%; justify-content: center; }
}
.action-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.lead-table td { vertical-align: top; }
.lead-table .tier { margin-top: .1rem; }

/* Tryb dzwonienia: co firma oglądała (podgląd strony, oferta, audyt) */
.dial-signals { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.dial-signal { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 999px;
               background: var(--warning-soft); color: var(--warning-text); font-size: .8125rem; font-weight: 600; }
.dial-signal .i { width: 14px; height: 14px; }

/* Porządki → Bezpieczeństwo */
.sec-list { list-style: none; margin: 0; padding: 0 1.25rem; }
.sec-item { display: flex; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.sec-item:last-child { border-bottom: 0; }
.sec-item p { margin: .15rem 0 0; font-size: .875rem; color: var(--text-muted); }
.sec-item__mark { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-top: .05rem; }
.sec-item__mark .i { width: 15px; height: 15px; }
.sec-item--ok .sec-item__mark { background: var(--success-soft); color: var(--success-text); }
.sec-item--warn .sec-item__mark { background: var(--danger-soft); color: var(--danger-text); }
