:root{--bg:#f1f5f9;--card:#fff;--text:#0f172a;--muted:#64748b;--accent:#2563eb;--accent-dark:#1d4ed8;--border:#e2e8f0;--danger:#dc2626;--ok:#16a34a}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:linear-gradient(180deg,#f8fafc 0,#f1f5f9 100%);color:var(--text)}
.topbar{position:sticky;top:0;z-index:20;background:#0b1220;color:#fff;border-bottom:1px solid rgba(255,255,255,.08)}
.topbar-inner{max-width:1240px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;padding:8px 10px;border-radius:10px}
.brand:hover{background:rgba(255,255,255,.08)}.brand-dot{width:10px;height:10px;border-radius:50%;background:#60a5fa;box-shadow:0 0 0 6px rgba(96,165,250,.16)}
.main-nav{display:flex;align-items:center;gap:8px;flex:1 1 auto;flex-wrap:wrap}
.nav-link{color:#e2e8f0;text-decoration:none;padding:8px 12px;border-radius:10px;font-weight:600}
.nav-link:hover{background:rgba(255,255,255,.1);color:#fff}
.topbar-actions{display:flex;align-items:center;gap:10px;margin-left:auto;flex-wrap:wrap}.user-chip{font-size:13px;color:#cbd5e1;background:rgba(255,255,255,.08);padding:7px 10px;border-radius:999px}
.container{padding:20px;max-width:1240px;margin:0 auto}.leads-wide,.panel-wide{width:calc(100vw - 40px);max-width:none;margin-left:calc(50% - 50vw + 20px)}
.card{background:var(--card);border-radius:14px;padding:16px;margin:12px 0;box-shadow:0 10px 25px rgba(15,23,42,.05);border:1px solid var(--border)}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.charts{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;align-items:center}.filters{margin-bottom:12px}
input,select,textarea,button{padding:10px;border:1px solid #cbd5e1;border-radius:10px;font:inherit}
button,.button{background:var(--accent);color:#fff;border:none;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 14px;border-radius:10px;font-weight:600}
button:hover,.button:hover{background:var(--accent-dark)}.button-secondary{background:#0f172a}.button-secondary:hover{background:#1e293b}.button-danger{background:#b91c1c}.button-danger:hover{background:#991b1b}.button-ghost{background:transparent;border:1px solid rgba(255,255,255,.25)}.button-ghost:hover{background:rgba(255,255,255,.1)}.button-success{background:#16a34a}.button-success:hover{background:#15803d}.button-warning{background:#f59e0b}.button-warning:hover{background:#d97706}.button-info{background:#2563eb}.button-info:hover{background:#1d4ed8}.button-php{background:#4f46e5;min-width:44px}.button-php:hover{background:#4338ca}.button-json{background:#0ea5e9;min-width:44px}.button-json:hover{background:#0284c7}
.inline{display:inline}.flash{padding:11px 12px;border-radius:10px;margin:10px 0;font-weight:600}.flash.success{background:#dcfce7;color:#166534}.flash.error{background:#fee2e2;color:#991b1b}
.table-wrap{overflow:auto}table{width:100%;border-collapse:separate;border-spacing:0}th,td{padding:10px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top}th{font-size:13px;color:#334155;text-transform:uppercase;letter-spacing:.02em}
.pagination a{padding:7px 11px;background:#e2e8f0;margin-right:5px;border-radius:8px;text-decoration:none;color:#0f172a;display:inline-block}.pagination .active{background:#0f172a;color:#fff}
details summary{cursor:pointer;color:#1d4ed8;font-weight:600}
.badge-info{display:inline-block;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;padding:4px 8px;border-radius:10px;font-size:12px;font-weight:600;line-height:1.4;white-space:normal}
.status-badge{display:inline-block;padding:4px 8px;border-radius:999px;font-weight:700;font-size:12px;letter-spacing:.02em}.status-nowy{background:#dbeafe;color:#1e40af}.status-dubel{background:#e2e8f0;color:#0f172a}.status-pomylka{background:#fef3c7;color:#92400e}.status-bledne_dane{background:#fee2e2;color:#991b1b}.status-zainteresowany{background:#cffafe;color:#155e75}.status-niezainteresowany{background:#ede9fe;color:#5b21b6}.status-wyslana_oferta{background:#e0f2fe;color:#075985}.status-sprzedany{background:#dcfce7;color:#166534}
.chart-list{display:grid;gap:10px}.chart-row{display:grid;grid-template-columns:110px 1fr 40px;gap:10px;align-items:center}.chart-label{font-size:13px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chart-bar-wrap{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden}.chart-bar{height:100%;background:linear-gradient(90deg,#2563eb,#38bdf8)}.chart-bar-alt{background:linear-gradient(90deg,#0f172a,#334155)}
.sources-label{display:grid;gap:6px;font-weight:600}.sources-select{min-height:140px}
.source-edit-card .source-editable:disabled{background:#f8fafc;color:#64748b;border-color:#e2e8f0;cursor:not-allowed}.source-edit-form.is-editing .source-editable{background:#fff;color:#0f172a;cursor:text}
.auth-body{display:flex;min-height:100vh;align-items:center;justify-content:center}.auth-card{width:min(420px,92vw)}
.auth-pro{padding:20px}.auth-shell{display:grid;grid-template-columns:1fr 1fr;gap:18px;width:min(920px,96vw)}.auth-side{background:linear-gradient(145deg,#0b1220,#1e293b);color:#e2e8f0}
.auth-side h1{margin-top:0;color:#fff}.auth-side p{color:#cbd5e1}.auth-side ul{margin:0;padding-left:18px;display:grid;gap:8px}.auth-form{display:grid;gap:12px}.auth-form label{display:grid;gap:6px;font-weight:600}.muted{color:var(--muted);margin-top:-4px}
.form-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap}
@media(max-width:860px){.charts{grid-template-columns:1fr}.topbar-inner{padding:10px 12px}.topbar-actions{width:100%;justify-content:space-between;margin-left:0}.auth-shell{grid-template-columns:1fr}.form-actions{flex-direction:column;align-items:stretch}.chart-row{grid-template-columns:90px 1fr 34px}.leads-wide,.panel-wide{width:100%;margin-left:0}.site-footer-inner{width:100%;margin-left:0}}

.lead-edit-row td{background:#f8fafc}
.lead-edit-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;align-items:end}
.lead-edit-form label{display:grid;gap:6px;font-weight:600}
.note-indicator{display:inline-block;width:14px;height:14px;border-radius:50%;position:relative;cursor:help;border:2px solid rgba(255,255,255,.8);box-shadow:0 0 0 1px rgba(15,23,42,.15)}
.note-indicator.no-note{background:#dc2626}
.note-indicator.has-note{background:#16a34a}
.note-indicator:hover::after{content:attr(data-tooltip);position:absolute;left:20px;top:-6px;min-width:180px;max-width:320px;background:#0f172a;color:#fff;padding:8px 10px;border-radius:8px;z-index:30;font-size:12px;line-height:1.4;white-space:normal;box-shadow:0 10px 20px rgba(0,0,0,.25)}

.lead-actions{display:flex;flex-direction:row;gap:6px;min-width:120px;align-items:center;flex-wrap:nowrap}
.lead-actions .button{width:34px;height:34px;padding:0;border-radius:8px}
.lead-actions form{margin:0}
.action-icon-button{font-size:16px;line-height:1}
.leads-filters{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}

.users-compact-list{display:grid;gap:10px}
.user-row{border:1px solid #e2e8f0;border-radius:12px;background:#fff}
.user-row-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px}
.user-row-body{padding:12px 14px;border-top:1px solid #e2e8f0;background:#f8fafc}
.user-edit-form{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:12px}
.sources-select-stacked{width:100%;display:block}

.user-name-wrap{display:flex;align-items:center;gap:8px}
.user-active-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.user-active-dot.is-on{background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.18)}.user-active-dot.is-off{background:#dc2626;box-shadow:0 0 0 4px rgba(220,38,38,.18)}


.site-footer{margin-top:14px;padding:10px 20px;color:#475569}.site-footer-inner{width:calc(100vw - 40px);max-width:none;margin-left:calc(50% - 50vw + 20px);font-size:14px}.site-footer a{color:#1d4ed8;text-decoration:none;font-weight:700}.site-footer a:hover{text-decoration:underline}

.source-links{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;justify-content:flex-end}.source-actions-right{justify-content:flex-end}
.source-meta{font-size:13px;color:#475569;margin-top:8px}

.lp-body{background:linear-gradient(180deg,#f8fafc 0,#e2e8f0 100%);padding:20px}
.lp-container{max-width:980px;margin:0 auto;display:grid;grid-template-columns:1.1fr .9fr;gap:16px}
.lp-hero,.lp-form-card{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:20px;box-shadow:0 10px 24px rgba(15,23,42,.06)}
.lp-badge{display:inline-block;background:#dbeafe;color:#1e40af;padding:6px 10px;border-radius:999px;font-weight:700;font-size:12px;margin:0 0 10px}
.lp-notes{margin-top:12px;padding:12px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;color:#334155}
.lp-form-stack{display:flex;flex-direction:column;gap:10px;align-items:stretch}.lp-form-stack input,.lp-form-stack textarea{width:100%}.lp-result{margin-top:12px;padding:12px;border-radius:10px;font-weight:600}
.lp-result-success{background:#dcfce7;color:#166534}
.lp-result-error{background:#fee2e2;color:#991b1b}

@media(max-width:860px){.lp-container{grid-template-columns:1fr}}
