/* =====================================================================
   Radar — Liquid Glass (ciemny motyw, fioletowe akcenty)
   Promienie koncentryczne: kontenery 32px · sekcje 24px · kafelki 18px · kontrolki: kapsuły
   ===================================================================== */
:root {
  --bg: #060609;
  --text: #F5F5F7;
  --muted: rgba(235, 235, 245, .55);
  --dim: rgba(235, 235, 245, .32);
  --accent: #A78BFA;
  --accent-2: #8B5CF6;
  --accent-deep: #7C3AED;
  --danger: #FF6B81;
  --sans: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
  --mono: var(--sans);

  --r-xl: 32px;   /* zewnętrzne kontenery szklane */
  --r-lg: 24px;   /* karty sekcji wewnątrz */
  --r-md: 18px;   /* kafelki interaktywne */
  --r-sm: 14px;
  --pill: 999px;

  --spring: cubic-bezier(.32, .72, 0, 1);
  --t: all .35s var(--spring);

  /* szkło */
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, .03) 45%, rgba(167, 139, 250, .06) 100%);
  --glass-blur: blur(36px) saturate(190%) brightness(1.1);
  --glass-border: 1px solid rgba(255, 255, 255, .16);
  --glass-rim: inset 0 1.5px 1px 0 rgba(255, 255, 255, .40), inset 0 -1px 1px 0 rgba(255, 255, 255, .08), inset 1.5px 0 1px 0 rgba(255, 255, 255, .16);
  --glass-shadow: var(--glass-rim), 0 24px 48px -12px rgba(0, 0, 0, .75);
  /* szkło wewnętrzne (bez rozmycia — leży już na szkle) */
  --inner-bg: linear-gradient(160deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .025) 60%, rgba(167, 139, 250, .04) 100%);
  --inner-border: 1px solid rgba(255, 255, 255, .10);
  --inner-rim: inset 0 1px 0.5px 0 rgba(255, 255, 255, .22), inset 0 -1px 0.5px 0 rgba(255, 255, 255, .04);
  --hair: rgba(255, 255, 255, .08);

  /* aliasy używane w kodzie */
  --line: var(--hair);
  --line-2: rgba(255, 255, 255, .14);
  --border: var(--hair);
  --border-2: rgba(255, 255, 255, .14);
  --panel: rgba(255, 255, 255, .05);
  --panel-2: rgba(255, 255, 255, .07);
  --panel-3: rgba(255, 255, 255, .10);
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .08);
  --accent-soft: rgba(139, 92, 246, .18);
  --green: var(--accent);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg { flex: none; }
::selection { background: rgba(167, 139, 250, .35); }
:focus-visible { outline: 2px solid rgba(167, 139, 250, .8); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- tło: ciemny obsydian z kulami światła ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .24; }
.orb.a { width: 62vw; height: 62vw; left: -14vw; top: -18vw; background: #7C3AED; animation: drift-a 38s var(--spring) infinite alternate; }
.orb.b { width: 48vw; height: 48vw; right: -10vw; top: 22vh; background: #A78BFA; opacity: .18; animation: drift-b 46s ease-in-out infinite alternate; }
.orb.c { width: 70vw; height: 70vw; left: 18vw; bottom: -40vw; background: #1E1B4B; opacity: .5; animation: drift-c 52s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(8vw, 6vh) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-6vw, 10vh) scale(.92); } }
@keyframes drift-c { to { transform: translate(-8vw, -6vh) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none !important; } * { transition-duration: .01s !important; } }

/* ---------- materiał szklany ---------- */
.sidebar, .topbar, .card, .stat, .modal, .drawer, .toast, .suggest, .table-wrap, .map-box, .preview-shell,
.leaflet-popup-content-wrapper, .rings .ring, .empty-glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
/* połysk górnej krawędzi */
.sidebar, .card, .modal, .drawer, .stat, .topbar { position: relative; isolation: isolate; }
.sidebar::before, .card::before, .modal::before, .drawer::before, .stat::before, .topbar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, .35) 18%, rgba(255, 255, 255, 0) 42%);
  opacity: .15;
}

/* ---------- układ ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex: none;
  margin: 16px 0 16px 16px;
  height: calc(100vh - 32px);
  position: sticky; top: 16px;
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  z-index: 30;
  padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #B69CFF 0%, #8B5CF6 55%, #6D28D9 100%);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .55), inset 0 -1px 1px rgba(0, 0, 0, .2), 0 8px 22px -8px rgba(139, 92, 246, .9);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: 11.5px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding: 0 2px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--dim); padding: 18px 14px 6px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--pill);
  color: var(--muted); font-weight: 500; font-size: 14px;
  border: 1px solid transparent;
  transition: var(--t);
}
.nav a i svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); transform: translateX(2px); }
.nav a:active { transform: scale(.97); }
.nav a.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(167, 139, 250, .42) 0%, rgba(139, 92, 246, .26) 100%);
  border-color: rgba(167, 139, 250, .55);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .45), inset 0 -1px 1px rgba(255, 255, 255, .06), 0 10px 28px -10px rgba(139, 92, 246, .95), 0 0 0 4px rgba(139, 92, 246, .08);
}
.nav a.active i { color: #fff; }
.nav-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text); background: rgba(255, 255, 255, .10); padding: 1px 8px; border-radius: var(--pill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.nav a.active .nav-count { background: rgba(255, 255, 255, .22); }

.side-foot { margin-top: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); }
.side-foot-label { font-size: 12px; color: var(--muted); }
.side-foot-value { font-weight: 700; font-size: 22px; letter-spacing: -.03em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.side-bar { height: 6px; border-radius: var(--pill); background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 8px; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .4); }
.side-bar span { display: block; height: 100%; width: 0; border-radius: var(--pill); background: linear-gradient(90deg, #8B5CF6, #C4B5FD); box-shadow: 0 0 12px rgba(167, 139, 250, .7); transition: width .6s var(--spring); }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 14px;
  margin: 16px 16px 0 20px; padding: 0 10px 0 16px;
  position: sticky; top: 16px; z-index: 20;
  border-radius: var(--pill);
}
.crumbs { flex: 1; display: flex; gap: 6px; align-items: center; min-width: 0; font-size: 13px; }
.crumb-pill { padding: 5px 12px; border-radius: var(--pill); color: var(--muted); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); font-weight: 500; white-space: nowrap; }
.crumb-pill.current { color: var(--text); background: rgba(255, 255, 255, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { width: 14px; height: 14px; flex: none; background: currentColor; color: var(--dim); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.topbar .menu-btn { display: none; }
.main { padding: 36px 20px 48px 24px; max-width: 1440px; width: 100%; }

/* ---------- typografia i nagłówki ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; padding: 0 8px; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: #DDD6FE;
  padding: 5px 12px 5px 10px; border-radius: var(--pill); margin-bottom: 14px;
  background: rgba(139, 92, 246, .16); border: 1px solid rgba(167, 139, 250, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ctx-box .eyebrow { margin-bottom: 8px; font-size: 11.5px; }
h1 { font-size: 44px; margin: 0; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
h2 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
h3 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0; }
.page-head p.muted { margin-top: 10px; font-size: 15px; max-width: 560px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- karty ---------- */
.card { border-radius: var(--r-xl); padding: 28px; margin-bottom: 22px; }
.card-title {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--text);
  margin: 0 0 20px; display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap;
}
.card-title .sub { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.split { display: grid; grid-template-columns: minmax(300px, 430px) 1fr; gap: 22px; align-items: start; }
.split > * { min-width: 0; }

/* ---------- przyciski (kapsuły) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .05) 100%);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .30), 0 6px 16px -8px rgba(0, 0, 0, .6);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--text);
  transition: var(--t);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.18); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .38), 0 12px 24px -10px rgba(0, 0, 0, .7); }
.btn:active { transform: scale(.97); filter: brightness(1.05); transition-duration: .12s; }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: none; }
.btn.primary {
  color: #fff; border-color: rgba(196, 181, 253, .55);
  background: linear-gradient(180deg, #B69CFF 0%, #8B5CF6 52%, #7C3AED 100%);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .55), inset 0 -1px 1px rgba(40, 0, 90, .35), 0 10px 26px -10px rgba(139, 92, 246, .95);
}
.btn.primary:hover { box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .6), inset 0 -1px 1px rgba(40, 0, 90, .35), 0 16px 34px -10px rgba(139, 92, 246, 1); }
.btn.green { color: #fff; background: linear-gradient(180deg, rgba(167, 139, 250, .45), rgba(139, 92, 246, .30)); border-color: rgba(167, 139, 250, .55); }
.btn.danger { color: #FFB4C0; }
.btn.danger:hover { background: rgba(255, 107, 129, .14); border-color: rgba(255, 107, 129, .4); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .07); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn svg { stroke-width: 2; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .3); transition: var(--t);
}
.icon-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 0; font-weight: 500; transition: var(--t); }
.link-btn:hover { color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- formularze ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--pill); padding: 11px 16px; outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .06);
  transition: var(--t);
}
.field textarea, textarea.input { border-radius: var(--r-md); resize: vertical; min-height: 90px; line-height: 1.6; padding: 14px 16px; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .2); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(167, 139, 250, .75); background: rgba(0, 0, 0, .34);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 4px rgba(139, 92, 246, .18);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type=color] { padding: 3px !important; height: 38px; cursor: pointer; border-radius: var(--pill) !important; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 99px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23B0B0BA' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 16px center !important; padding-right: 36px !important; }
select option, select optgroup { background: #17171d; }
.input-ic { position: relative; }
.input-ic > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--dim); display: flex; }
.input-ic > input { padding-left: 40px !important; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 12px; padding-left: 4px; line-height: 1.6; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  padding: 8px 14px; border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .2);
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: var(--t);
}
.chip:hover { color: var(--text); transform: translateY(-2px); background: rgba(255, 255, 255, .10); }
.chip:active { transform: scale(.97); }
.chip input { display: none; }
.chip .box { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .3); display: grid; place-items: center; transition: var(--t); }
.chip.on { color: #fff; background: rgba(139, 92, 246, .25); border-color: rgba(167, 139, 250, .65); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .35), 0 6px 18px -8px rgba(139, 92, 246, .9); }
.chip.on .box { background: #fff; border-color: #fff; }
.chip.on .box:after { content: ""; width: 7px; height: 4px; border: 2px solid #7C3AED; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- pigułki statusów ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .4); flex: none; }
.pill.violet { background: rgba(139, 92, 246, .2); border-color: rgba(167, 139, 250, .38); color: #E4DCFF; }
.pill.violet::before { background: #A78BFA; box-shadow: 0 0 8px #A78BFA; }
.pill.blue::before { background: #9CA3AF; }
.pill.amber::before { background: #E5E7EB; }
.pill.cyan { background: rgba(196, 181, 253, .12); }
.pill.cyan::before { background: #C4B5FD; box-shadow: 0 0 8px #C4B5FD; }
.pill.pink { background: rgba(124, 58, 237, .26); border-color: rgba(139, 92, 246, .45); }
.pill.pink::before { background: #8B5CF6; box-shadow: 0 0 8px #8B5CF6; }
.pill.green { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); }
.pill.green::before { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.pill.gray { color: var(--muted); }
.pill.gray::before { background: rgba(255, 255, 255, .22); }
.pill.red::before { background: var(--danger); }
.pill.hot::before { background: var(--accent); }

.score { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 3px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.score.hi { color: #fff; background: rgba(139, 92, 246, .32); border-color: rgba(167, 139, 250, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 14px -6px rgba(139, 92, 246, .9); }
.score.mid { color: var(--text); }
.score.lo { color: var(--dim); }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.card .table-wrap { background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); -webkit-backdrop-filter: none; backdrop-filter: none; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 14px 18px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .25s var(--spring); }
tbody tr.click { cursor: pointer; }
tbody tr:hover { background: rgba(255, 255, 255, .05); }
.cell-name b { display: block; font-weight: 600; letter-spacing: -.01em; }
.cell-name small { color: var(--muted); font-size: 12.5px; display: block; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb { width: 17px; height: 17px; accent-color: var(--accent-2); cursor: pointer; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar > select.input { width: auto; }

/* ---------- statystyki ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { border-radius: var(--r-lg); padding: 22px 22px 24px; transition: var(--t); }
.stat:hover { transform: translateY(-2px); }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.stat-label i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(139, 92, 246, .3); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .35); }
.stat-label i svg { width: 14px; height: 14px; }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin-top: 16px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat-sub a { color: var(--accent); }

.pipeline { display: flex; height: 10px; border-radius: var(--pill); overflow: hidden; background: rgba(255, 255, 255, .06); margin: 4px 0 16px; gap: 2px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.pipeline span { height: 100%; border-radius: var(--pill); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend b { color: var(--text); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 4px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-md); cursor: pointer; transition: var(--t); }
.list-item:hover { background: rgba(255, 255, 255, .06); transform: translateX(2px); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; background: linear-gradient(160deg, rgba(167, 139, 250, .55), rgba(124, 58, 237, .35)); border: 1px solid rgba(196, 181, 253, .35); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45); }

.empty { text-align: left; padding: 28px 4px 8px; color: var(--muted); max-width: 600px; }
.empty .ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; margin-bottom: 20px; background: linear-gradient(160deg, #B69CFF, #7C3AED); box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .5), 0 12px 28px -10px rgba(139, 92, 246, .9); }
.empty h3 { color: var(--text); font-size: 24px; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 8px; font-weight: 700; }
.empty p { margin-bottom: 20px; line-height: 1.6; }

/* ---------- AutoPilot: wyniki ---------- */
.res-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.res-summary b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; display: block; }
.res-summary ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.res-summary li { font-size: 12.5px; color: var(--muted); padding: 4px 11px; border-radius: var(--pill); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); }
.loader { display: flex; align-items: flex-start; gap: 16px; padding: 4px 0; }
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; filter: drop-shadow(0 0 6px rgba(167, 139, 250, .6)); }
@keyframes spin { to { transform: rotate(360deg); } }
.steps-log { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.steps-log div.ok:before { content: "✓  "; color: var(--accent); font-weight: 700; }
.steps-log div.run:before { content: "●  "; color: var(--accent); }
.alert { padding: 13px 18px; border-radius: var(--r-md); border: 1px solid rgba(255, 107, 129, .35); background: rgba(255, 107, 129, .10); color: #FFD0D7; font-size: 13.5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.alert.info, .alert.warn { border-color: rgba(167, 139, 250, .35); background: rgba(139, 92, 246, .12); color: var(--text); }
.alert a { color: var(--accent); }

/* ---------- drawer (pływający panel) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4, 3, 10, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 50; animation: fade .3s var(--spring); }
.drawer {
  position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(480px, calc(100vw - 32px));
  border-radius: var(--r-xl); z-index: 51; overflow-y: auto; padding: 30px;
  background: linear-gradient(145deg, rgba(40, 36, 58, .82) 0%, rgba(20, 18, 30, .86) 50%, rgba(46, 30, 84, .82) 100%);
  animation: slide .5s var(--spring);
}
@keyframes slide { from { transform: translateX(40px) scale(.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer .close { position: absolute; top: 22px; right: 22px; }
.drawer h2 { font-size: 30px; padding-right: 48px; line-height: 1.08; letter-spacing: -.035em; margin-top: 2px; }
.d-sec { margin-top: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); }
.d-sec > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.d-contact { display: flex; flex-direction: column; gap: 8px; }
.d-contact a, .d-contact span { display: inline-flex; align-items: center; gap: 10px; }
.d-contact a { color: var(--text); font-weight: 600; transition: var(--t); }
.d-contact a:hover { color: var(--accent); }
.d-contact i { color: var(--accent); display: flex; }
.d-reasons { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.d-links { display: flex; flex-wrap: wrap; gap: 8px; }
.d-links a, .d-links span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; font-weight: 500; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); transition: var(--t); }
.d-links span { color: var(--dim); }
.d-links a:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, .6); }
.history { list-style: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--muted); max-height: 180px; overflow-y: auto; }
.history li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.history li:last-child { border-bottom: 0; }
.history li time { color: var(--dim); flex: none; min-width: 92px; font-variant-numeric: tabular-nums; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: var(--r-xl); padding: 30px; z-index: 61;
  background: linear-gradient(145deg, rgba(44, 40, 62, .86) 0%, rgba(22, 20, 32, .9) 50%, rgba(50, 32, 90, .86) 100%);
  animation: pop .45s var(--spring);
}
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0; } }
.modal h2 { padding-right: 44px; font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.modal h2 + p { margin-top: 8px; }
.modal .close { position: absolute; top: 22px; right: 22px; }
.modal-body { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

/* ---------- toasty ---------- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { border-radius: var(--pill); padding: 12px 20px 12px 16px; font-size: 13.5px; font-weight: 500; max-width: 420px; display: flex; gap: 10px; align-items: center; animation: pop .45s var(--spring); background: linear-gradient(145deg, rgba(50, 44, 72, .88), rgba(26, 22, 40, .9)); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; }
.toast.error::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.toast.ok::before { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .9); }

/* ---------- wiadomości / kreator (panel — nie płótno strony) ---------- */
.ctx-box { border-radius: var(--r-lg); padding: 16px 18px; font-size: 13px; color: var(--muted); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); }
.ctx-box div { margin-top: 3px; word-break: break-word; }
.seg {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--pill); flex-wrap: wrap;
  background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .10); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45);
}
.seg button { border: 1px solid transparent; background: none; padding: 7px 14px; border-radius: var(--pill); cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: var(--t); }
.seg button:hover { color: var(--text); }
.seg button:active { transform: scale(.96); }
.seg button.on { color: #fff; background: linear-gradient(180deg, rgba(167, 139, 250, .5), rgba(139, 92, 246, .32)); border-color: rgba(196, 181, 253, .45); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45), 0 6px 16px -8px rgba(139, 92, 246, .9); }
.preview-frame { width: 100%; height: 760px; border: 0; background: #fff; display: block; }
.preview-shell { border-radius: var(--r-lg); overflow: hidden; }
.card .preview-shell { box-shadow: var(--inner-rim), 0 18px 40px -16px rgba(0, 0, 0, .8); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--hair); }
.preview-bar .dots { display: flex; gap: 6px; }
.preview-bar .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.preview-bar .url { flex: 1; padding: 5px 14px; border-radius: var(--pill); background: rgba(0, 0, 0, .3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.preview-bar .seg { padding: 2px; }
.preview-bar .seg button { padding: 4px 10px; }
.preview-body { display: flex; justify-content: center; background: rgba(0, 0, 0, .25); }
.preview-body.mobile { padding: 18px; }
.preview-body.mobile .preview-frame { width: 390px; max-width: 100%; height: 780px; border-radius: 34px; border: 6px solid rgba(255, 255, 255, .12); }
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pal { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); cursor: pointer; text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .10); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); transition: var(--t); }
.pal:hover { color: var(--text); transform: translateY(-2px); }
.pal:active { transform: scale(.97); }
.pal.on { color: #fff; background: rgba(139, 92, 246, .25); border-color: rgba(167, 139, 250, .7); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .35), 0 0 0 3px rgba(139, 92, 246, .14); }
.pal .sw { display: flex; flex: none; border-radius: var(--pill); overflow: hidden; border: 1px solid rgba(255, 255, 255, .2); }
.pal .sw span { width: 12px; height: 22px; display: block; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 14px; }
.color-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.color-grid input[type=color] { width: 100%; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .14); }
.contrast-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; padding-left: 4px; }
.contrast-note b { font-weight: 700; color: var(--text); }
.contrast-note.bad b { color: var(--danger); }

/* ---------- audyt ---------- */
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rings .ring { border-radius: var(--r-lg); padding: 20px; text-align: center; }
.ring svg { display: block; margin: 0 auto 10px; filter: drop-shadow(0 0 10px rgba(167, 139, 250, .35)); }
.ring b { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.audit-list { list-style: none; padding: 0; margin: 0; }
.audit-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 13.5px; align-items: baseline; }
.audit-list li:last-child { border-bottom: 0; }
.audit-list .v { margin-left: auto; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; transform: translateY(-1px); }
.args { margin: 0; padding: 0; list-style: none; counter-reset: a; display: flex; flex-direction: column; gap: 8px; }
.args li { padding: 12px 14px 12px 48px; border-radius: var(--r-md); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); position: relative; counter-increment: a; line-height: 1.55; }
.args li::before { content: counter(a); position: absolute; left: 14px; top: 11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(139, 92, 246, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }

/* ---------- call center ---------- */
.cc-phone { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--text); display: inline-flex; align-items: center; gap: 14px; margin: 14px 0 8px; font-variant-numeric: tabular-nums; transition: var(--t); }
.cc-phone i { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #B69CFF, #7C3AED); box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .5), 0 12px 28px -10px rgba(139, 92, 246, 1); }
.cc-phone i svg { width: 22px; height: 22px; }
.cc-phone:hover { transform: translateY(-2px); }
.cc-outcomes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.script { white-space: pre-wrap; padding: 18px 20px; border-radius: var(--r-lg); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); font-size: 14px; line-height: 1.7; color: var(--text); }
.queue .list-item.on { background: rgba(139, 92, 246, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px rgba(167, 139, 250, .45); }

/* ---------- kalendarz ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.cal-head h2 { min-width: 200px; text-transform: capitalize; font-size: 26px; letter-spacing: -.03em; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 10px 4px; }
.cal-day { min-height: 116px; border-radius: var(--r-md); padding: 9px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; min-width: 0; background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); transition: var(--t); }
.cal-day:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .09); }
.cal-day:active { transform: scale(.98); }
.cal-day.out { opacity: .38; }
.cal-day.today { border-color: rgba(167, 139, 250, .7); box-shadow: var(--inner-rim), 0 0 0 3px rgba(139, 92, 246, .16); }
.cal-day .n { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.cal-day.today .n { color: #fff; }
.cal-day .add { color: var(--dim); font-size: 11.5px; margin-top: auto; opacity: 0; transition: opacity .3s; }
.cal-day:hover .add { opacity: 1; }
.sale { border-radius: 12px; padding: 5px 9px; font-size: 11.5px; line-height: 1.3; color: #fff; min-width: 0; background: linear-gradient(180deg, rgba(167, 139, 250, .55), rgba(124, 58, 237, .45)); border: 1px solid rgba(196, 181, 253, .45); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45), 0 6px 14px -6px rgba(139, 92, 246, .9); transition: var(--t); }
.sale:hover { transform: translateY(-1px); filter: brightness(1.12); }
.sale b { display: block; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sale span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.sale.deposit { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .1)); border-color: rgba(255, 255, 255, .3); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45); }
.sale.planned { background: rgba(255, 255, 255, .05); border: 1px dashed rgba(196, 181, 253, .5); box-shadow: none; color: var(--text); }

/* ---------- AutoPilot: branże ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tab { border: 1px solid rgba(255, 255, 255, .10); background: rgba(255, 255, 255, .05); color: var(--muted); padding: 7px 14px; border-radius: var(--pill); cursor: pointer; font-size: 13px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); transition: var(--t); }
.tab:hover { color: var(--text); transform: translateY(-2px); background: rgba(255, 255, 255, .09); }
.tab:active { transform: scale(.96); }
.tab.on { color: #fff; background: linear-gradient(180deg, rgba(167, 139, 250, .5), rgba(139, 92, 246, .3)); border-color: rgba(196, 181, 253, .5); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45), 0 6px 18px -8px rgba(139, 92, 246, .95); }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ind-grid.compact { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); max-height: 380px; overflow-y: auto; padding: 4px 6px 8px 2px; margin: -4px -6px -8px -2px; }
.ind2 {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r-md); cursor: pointer; user-select: none; min-width: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .03) 100%);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .22), 0 6px 16px -10px rgba(0, 0, 0, .7);
  transition: var(--t);
}
.ind2:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .05) 100%); }
.ind2:active { transform: scale(.97); }
.ind2.on {
  background: linear-gradient(160deg, rgba(167, 139, 250, .32) 0%, rgba(139, 92, 246, .25) 100%);
  border-color: #A78BFA;
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .42), 0 0 0 1px rgba(167, 139, 250, .35), 0 10px 26px -10px rgba(139, 92, 246, 1);
}
.ind2 .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25); flex: none; display: grid; place-items: center; transition: var(--t); }
.ind2.on .tick { background: #fff; border-color: #fff; box-shadow: 0 0 12px rgba(196, 181, 253, .9); transform: scale(1.05); }
.ind2.on .tick:after { content: ""; width: 9px; height: 5px; border: 2.2px solid #7C3AED; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ind2 .lbl { flex: 1; min-width: 0; }
.ind2 .lbl b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind2 .lbl small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ind2.on .lbl small { color: rgba(255, 255, 255, .72); }
.ind { display: flex; gap: 12px; text-align: left; align-items: flex-start; padding: 14px; border-radius: var(--r-md); cursor: pointer; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .10); transition: var(--t); }
.ind.active { background: rgba(139, 92, 246, .25); border-color: #A78BFA; }
.ind-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: rgba(255, 255, 255, .08); flex: none; }
.ind b { display: block; font-size: 13.5px; }
.ind small { display: block; color: var(--muted); font-size: 12px; }
.ind em { font-style: normal; color: var(--accent); font-size: 12px; }
.ind-toggle { margin-top: 12px; }
.star { background: none; border: 0; cursor: pointer; color: var(--dim); padding: 5px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: var(--t); }
.star svg path { fill: none; }
.star:hover { color: #fff; background: rgba(255, 255, 255, .1); transform: scale(1.12); }
.star:active { transform: scale(.9); }
.star.on { color: #DDD6FE; filter: drop-shadow(0 0 6px rgba(167, 139, 250, .9)); }
.star.on svg path { fill: currentColor; }
.mini-x { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 4px; border-radius: 50%; display: grid; place-items: center; transition: var(--t); }
.mini-x:hover { color: var(--danger); background: rgba(255, 107, 129, .12); }
.sel-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.sel-row .small { font-weight: 600; }
.sel-row .pill { padding-right: 4px; background: rgba(139, 92, 246, .25); border-color: rgba(167, 139, 250, .5); color: #fff; }
.sel-row .pill::before { background: #fff; box-shadow: 0 0 6px #C4B5FD; }
.sel-row .pill button { background: rgba(255, 255, 255, .15); border: 0; color: #fff; cursor: pointer; font-size: 13px; line-height: 1; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; padding: 0; transition: var(--t); }
.sel-row .pill button:hover { background: rgba(255, 255, 255, .3); }

/* ---------- AutoPilot: lokalizacja ---------- */
.place-grid { display: grid; grid-template-columns: 210px 1fr 160px; gap: 18px; align-items: start; }
.place-field { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; border-radius: var(--r-lg); max-height: 340px; overflow-y: auto; padding: 6px; background: linear-gradient(145deg, rgba(44, 40, 62, .9), rgba(22, 20, 32, .94)); animation: pop .35s var(--spring); }
.modal .suggest { top: 72px; }
.sug { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); transition: background .2s; }
.sug b { display: block; font-weight: 600; font-size: 14px; }
.sug small { display: block; color: var(--muted); font-size: 12px; }
.sug:hover, .sug.on { background: rgba(139, 92, 246, .28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.sug-empty { padding: 12px 14px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.place-chosen { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 8px; min-height: 44px; border-radius: var(--pill); background: rgba(139, 92, 246, .2); border: 1px solid rgba(167, 139, 250, .55); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .35), 0 8px 22px -12px rgba(139, 92, 246, .9); }
.place-chosen > i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(139, 92, 246, .55); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, .45); flex: none; }
.place-chosen > i svg { width: 15px; height: 15px; }
.place-chosen .grow { flex: 1; min-width: 0; }
.place-chosen b { display: block; line-height: 1.2; font-weight: 600; }
.place-chosen small { display: block; color: rgba(235, 235, 245, .65); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip small { font-size: 11.5px; margin-left: 2px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.dist-note { margin-top: 16px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.go-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--hair); }
.go-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.go-right .btn.primary { padding: 12px 24px; font-size: 14.5px; }
.manual-links { margin-top: 18px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.manual-links a { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .10); color: var(--text); font-weight: 500; transition: var(--t); }
.manual-links a:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, .6); color: #fff; }

/* ---------- AutoPilot: filtry ---------- */
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fgroup { padding: 18px 20px 20px; border-radius: var(--r-lg); background: var(--inner-bg); border: var(--inner-border); box-shadow: var(--inner-rim); }
.fgroup > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.fgroup > label b { color: #fff; font-weight: 700; padding: 1px 8px; border-radius: var(--pill); background: rgba(139, 92, 246, .4); margin-left: 4px; }
.fgroup .chips { margin-top: 0; }
input[type=range] { width: 100%; accent-color: var(--accent-2); height: 22px; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .10); color: var(--muted); }
.tag.g { color: var(--text); }
.tag.star { color: #E4DCFF; background: rgba(139, 92, 246, .22); border-color: rgba(167, 139, 250, .4); }
.tag.warn { color: var(--text); border-style: dashed; }

/* ---------- mapy ---------- */
.map-box { height: 560px; border-radius: var(--r-lg); overflow: hidden; }
.mini-map { height: 170px; border-radius: var(--r-md); overflow: hidden; margin-top: 12px; border: 1px solid rgba(255, 255, 255, .12); box-shadow: var(--inner-rim); }
.dark-tiles { filter: invert(1) hue-rotate(200deg) brightness(.82) contrast(.92) saturate(.45); }
.leaflet-container { font-family: var(--sans) !important; background: #0b0a12 !important; }
.leaflet-popup-content-wrapper { border-radius: var(--r-md) !important; background: linear-gradient(145deg, rgba(44, 40, 62, .92), rgba(22, 20, 32, .95)) !important; color: var(--text); }
.leaflet-popup-tip { background: rgba(30, 27, 44, .95) !important; box-shadow: none !important; }
.leaflet-popup-content { margin: 14px 16px; font-size: 13px; line-height: 1.5; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar { border: 1px solid rgba(255, 255, 255, .16) !important; border-radius: var(--r-sm) !important; overflow: hidden; box-shadow: var(--glass-rim) !important; }
.leaflet-bar a { background: rgba(30, 27, 44, .85) !important; color: var(--text) !important; border-color: rgba(255, 255, 255, .1) !important; }
.leaflet-control-attribution { background: rgba(6, 6, 9, .6) !important; color: var(--dim) !important; border-radius: 8px 0 0 0; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pop b { font-size: 14.5px; display: block; margin-bottom: 2px; letter-spacing: -.01em; }
.pop .btn { margin-top: 8px; }
code { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); padding: 1px 7px; border-radius: 8px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- responsywność ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .place-grid { grid-template-columns: 1fr 1fr; }
  .place-grid .place-field { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; margin: 12px; height: calc(100vh - 24px); transform: translateX(calc(-100% - 24px)); transition: transform .5s var(--spring); }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: grid; }
  .topbar { margin: 12px 12px 0; padding: 0 8px; }
  .main { padding: 24px 12px 40px; }
  .card { padding: 22px; border-radius: 28px; }
  h1 { font-size: 34px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .rings { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .ind-grid.compact { grid-template-columns: 1fr 1fr; max-height: 320px; }
  .map-box { height: 420px; }
  .cal { gap: 4px; }
  .cal-dow { padding: 2px; font-size: 10.5px; }
  .cal-day { min-height: 72px; padding: 6px; border-radius: 12px; }
  .sale { padding: 2px 5px; font-size: 10px; border-radius: 8px; }
  .sale b { font-size: 10.5px; }
  .sale span { display: none; }
  .d-actions { grid-template-columns: 1fr; }
  .preview-frame { height: 600px; }
  .cc-phone { font-size: 30px; }
  .palettes { grid-template-columns: 1fr; }
  .drawer { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 24px; }
}
@media (max-width: 520px) {
  .ind-grid.compact { grid-template-columns: 1fr; }
  .place-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 18px; border-radius: 26px; }
  .crumb-pill:not(.current), .crumbs .sep { display: none; }
}

/* linki do sprawdzenia firmy (wyniki AutoPilota, karta leada) */
.res-links { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 11.5px; }
.res-links a { color: var(--muted); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(235, 235, 245, .2); text-underline-offset: 3px; transition: var(--t); }
.res-links a:hover { color: var(--accent); text-decoration-color: var(--accent); }
