:root {
  --green: #00a551;
  --green-dark: #007652;
  --green-xdark: #004f46;
  --red: #ef2f2f;
  --text: #111827;
  --text-muted: #6b7280;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { text-decoration: none; display: flex; align-items: center; }
.logo-text { font-size: 22px; font-weight: 700; color: var(--green); letter-spacing: -0.5px; }
.logo-dot { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.navbar-sub { font-size: 13px; color: var(--text-muted); margin-left: 4px; flex:1; }
.navbar-nav { display: flex; gap: 4px; }
.nav-link { font-size: 13px; font-weight: 600; color: var(--text-muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav-link:active, .nav-link.active { background: var(--bg); color: var(--green); }

/* Main */
.main-content { padding: 20px 16px; max-width: 680px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.badge-hot { background: #fef2f2; color: var(--red); }
.badge-cold { background: #f0f9ff; color: #0369a1; }
.badge-done { background: #f0fdf4; color: var(--green-dark); }
.badge-muted { background: var(--bg); color: var(--text-muted); }
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.badge-hot .badge-dot { background: var(--red); }
.badge-cold .badge-dot { background: #0369a1; }

/* Lead header */
.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.lead-name { font-size: 24px; font-weight: 700; }
.lead-phone { font-size: 16px; color: var(--text-muted); margin-top: 2px; }
.lead-time { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* Data rows */
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.data-row:last-child { border-bottom: none; }
.data-label { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.data-value { font-size: 14px; font-weight: 600; text-align: right; }
.data-value.budget-ok { color: var(--green-dark); }
.data-value.budget-low { color: var(--red); }

/* Score box */
.score-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.score-box.hot { border-left: 3px solid var(--red); }
.score-box.cold { border-left: 3px solid #0369a1; }

/* Channel badge */
.channel-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 500;
}

/* Audio player */
.audio-section audio {
  width: 100%;
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

/* Transcript */
.transcript {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}

/* WhatsApp */
.wa-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.wa-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.wa-from-client .wa-bubble {
  background: #f0f0f0;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.wa-from-estify .wa-bubble {
  background: #dcf8c6;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}
.wa-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}
.wa-from-estify .wa-time { align-self: flex-end; }

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.15s;
  width: 100%;
  min-height: 48px;
  margin-bottom: 10px;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  color: inherit;
}
.btn:active { opacity: 0.75; transform: scale(0.99); }
.btn-primary { background: var(--green); color: var(--white); }
.btn-outline { background: var(--white); color: var(--green); border: 2px solid var(--green); }
.btn-muted { background: var(--white); color: var(--text-muted); border: 1px solid var(--border); }
.btn-done { background: #f0fdf4; color: var(--green-dark); border: 1px solid var(--green); }

/* Dashboard */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 10px;
}
.section-title:first-child { margin-top: 4px; }

.lead-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 10px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,166,81,0.08);
}
.lead-card:active { border-color: var(--green); opacity: 0.9; }
.lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.lead-card-name { font-size: 16px; font-weight: 700; color: var(--text); }
.lead-card-offer { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.lead-card-meta { font-size: 12px; color: var(--text-muted); }

/* Filter bar */
.filter-bar { margin-bottom: 4px; }
.search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  background: var(--white);
  color: var(--text);
  margin-bottom: 10px;
  outline: none;
}
.search-input:focus { border-color: var(--green); }

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.filter-tab.active { background: var(--green); color: var(--white); border-color: var(--green); }

/* Contacted mark */
.contacted-mark { color: var(--green); font-size: 13px; margin-left: 4px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 0; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.page-btn.active { background: var(--green); color: var(--white); border-color: var(--green); }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 15px; }

/* Index */
.index-wrap { text-align: center; padding: 60px 20px; }
.index-wrap h1 { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.index-wrap p { color: var(--text-muted); margin-bottom: 28px; }

/* Back link */
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  padding: 4px 0;
}
.back-link:active { color: var(--green); }

/* Language tag */
.lang-tag { font-size: 12px; }

/* Action banner */
.action-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.banner-hot { background: #fef2f2; border: 1px solid #fecaca; }
.banner-cold { background: #eff6ff; border: 1px solid #bfdbfe; }
.banner-done { background: #f0fdf4; border: 1px solid #bbf7d0; }
.banner-icon { font-size: 24px; flex-shrink: 0; }
.banner-title { font-size: 16px; font-weight: 700; }
.banner-hot .banner-title { color: var(--red); }
.banner-cold .banner-title { color: #1d4ed8; }
.banner-done .banner-title { color: var(--green-dark); }
.banner-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Call widget */
.call-widget { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.call-widget-title { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px; }

/* Contacted row with unmark */
.btn-uncontact-link {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0 0;
  font-family: 'Outfit', sans-serif;
  text-align: left;
  touch-action: manipulation;
}
.btn-uncontact-link:active { color: var(--red); }

/* No answer */
.no-answer-badge { font-size: 13px; color: #6b7280; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.no-answer-pill { font-size: 11px; background: #fef3c7; color: #92400e; padding: 2px 7px; border-radius: 10px; font-weight: 600; }

/* Urgency timer */
.urgency-time { font-weight: 600; }
.urgency-now { color: var(--green-dark); }
.urgency-soon { color: #d97706; }
.urgency-late { color: var(--red); }

/* Section headers on dashboard */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px;
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-header:first-child { margin-top: 4px; }
.section-header-hot { color: var(--red); }
.section-header-cold { color: #0369a1; }
.section-header-done { color: var(--green-dark); }
.section-count {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
}

/* Hot card accent */
.lead-card-hot { border-left: 3px solid var(--red); }
.lead-card-contacted { border-left: 3px solid var(--green); opacity: 0.85; }
.lead-card-dismissed { border-left: 3px solid #d1d5db; background: #fafafa; }
.section-header-muted { color: var(--text-muted); }
.show-more-btn { text-align:center; padding:10px; color:var(--green); font-size:14px; cursor:pointer; border:1px dashed #d1d5db; border-radius:8px; margin:4px 0 8px; }

/* Action hint on card */
.lead-card-action-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

.btn-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  min-height: 48px;
  margin-top: 6px;
  background: none;
  border: 1px dashed #d1d5db;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  transition: border-color 0.15s, color 0.15s;
  box-sizing: border-box;
}
.btn-dismiss:active { color: var(--red); }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.kpi-number { font-size: 32px; font-weight: 700; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-label { font-size: 13px; color: var(--text-muted); width: 110px; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.funnel-bar { height: 18px; border-radius: 4px; min-width: 4px; transition: width 0.4s; }
.funnel-val { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Channel chart */
.channel-split { display: flex; gap: 24px; justify-content: center; align-items: flex-end; padding: 16px 0 4px; }
.channel-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.channel-num { font-size: 24px; font-weight: 700; }
.channel-lbl { font-size: 13px; color: var(--text-muted); }
.channel-bar { width: 48px; border-radius: 6px 6px 0 0; min-height: 4px; }

/* Notes */
.note-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.note-item:last-of-type { border-bottom: none; }
.note-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.note-time { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.note-empty { font-size: 14px; color: var(--text-muted); padding: 4px 0 12px; }
.note-input-wrap { margin-top: 12px; }
.note-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.5;
}
.note-input:focus { border-color: var(--green); }

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.stat-box {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: rgba(0,166,81,0.08);
}
.stat-box:active { opacity: 0.85; }
.stat-box.stat-active { border-color: var(--green); background: #f0fdf4; }
.stat-box.stat-active .stat-label { color: var(--green-dark); font-weight: 600; }
.stat-number { font-size: 28px; font-weight: 700; }
.stat-number.hot { color: var(--red); }
.stat-number.all { color: var(--green); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stats time filter */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--white);
  touch-action: manipulation;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-tab.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f0fdf4;
  font-weight: 600;
}

/* Custom date range */
.date-range-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.date-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  touch-action: manipulation;
}
.date-input:focus { outline: none; border-color: var(--green); }
.date-sep { color: #6b7280; font-size: 14px; flex-shrink: 0; }
.btn-date-go {
  padding: 8px 16px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn-date-go:active { opacity: 0.8; }

/* Dismiss button — same visual weight as other action buttons */

/* === Dashboard AI value card === */
.ai-value-card {
  display: block;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--text);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,166,81,0.08);
}
.ai-value-card:active { opacity: 0.85; }
.ai-value-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ai-value-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
}
.ai-value-link {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}
.ai-value-metrics {
  display: flex;
}
.ai-metric {
  flex: 1;
  text-align: center;
  padding: 0 4px;
  border-right: 1px solid #d1fae5;
}
.ai-metric:last-child { border-right: none; }
.ai-metric-num {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.2;
}
.ai-metric-lbl {
  font-size: 10px;
  color: #6b7280;
  margin-top: 3px;
  line-height: 1.3;
}
.ai-value-progress-wrap {
  height: 5px;
  background: #d1fae5;
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}
.ai-value-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* === Osiągnięcia (gamification) === */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.achievement {
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.ach-unlocked {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
}
.ach-locked {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
}
.ach-icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 6px;
  display: block;
}
.ach-locked .ach-icon { filter: grayscale(1); opacity: 0.4; }
.ach-title {
  font-size: 11px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2px;
}
.ach-locked .ach-title { color: #9ca3af; }
.ach-desc {
  font-size: 9.5px;
  color: #6b7280;
  line-height: 1.3;
}
.ach-progress-wrap {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.ach-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.ach-progress-label {
  font-size: 9.5px;
  color: #9ca3af;
  margin-top: 3px;
}
.level-badge {
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

/* === Oferty (dashboard) === */
.offers-section { margin-bottom: 14px; }
.offers-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.offers-see-all {
  font-size: 12px; font-weight: 600; color: var(--green-dark);
  text-decoration: none; white-space: nowrap;
}
.offers-see-all:active { opacity: 0.7; }
.offers-list { display: flex; flex-direction: column; gap: 6px; }
.offer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  text-decoration: none;
  touch-action: manipulation;
}
.offer-row:active { border-color: var(--green); opacity: 0.9; }
.offer-row-hot { border-left: 3px solid var(--red); background: #fffafa; }
.offer-row-addr { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-row-right { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.offers-title {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.offers-count {
  font-size: 11px; font-weight: 700; background: var(--bg);
  padding: 2px 8px; border-radius: 10px; color: var(--text-muted);
}
.offers-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.offers-scroll::-webkit-scrollbar { display: none; }
.offer-card {
  min-width: 150px; max-width: 180px; flex-shrink: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px;
}
.offer-card-hot { border-left: 3px solid var(--red); background: #fffafa; }
.offer-addr {
  font-size: 12px; font-weight: 600; color: var(--text);
  line-height: 1.3; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.offer-pills { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.offer-pill { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 8px; }
.offer-pill-hot { background: #fef2f2; color: var(--red); }
.offer-pill-cold { background: #eff6ff; color: #0369a1; }
.offer-pill-done { background: #f0fdf4; color: var(--green-dark); }
.offer-rec {
  font-size: 10.5px; font-weight: 500; line-height: 1.3;
  padding: 4px 6px; border-radius: 6px;
}
.offer-rec-hot { background: #fef2f2; color: #b91c1c; }
.offer-rec-up { background: #f0fdf4; color: var(--green-dark); }
.offer-rec-down { background: #fffbeb; color: #92400e; }
.offer-rec-warn { background: #fffbeb; color: #b45309; }
.offer-rec-ok { background: #f0fdf4; color: var(--green-dark); }
.offer-rec-neutral { background: #f9fafb; color: #6b7280; }

/* === Widok oferty pełny === */
.offers-page-header {
  margin-bottom: 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.offers-page-title { font-size: 20px; font-weight: 700; }
.agency-tag {
  font-size: 12px; font-weight: 600; color: var(--green-dark);
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 3px 10px; border-radius: 20px; text-decoration: none;
}
.agency-tag:active { opacity: 0.7; }

.offers-full-list { display: flex; flex-direction: column; gap: 12px; }

.offer-full-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.offer-full-card-hot { border-left: 3px solid var(--red); background: #fffafa; }

.offer-full-header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.offer-full-icon { font-size: 22px; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.offer-full-info { flex: 1; min-width: 0; }
.offer-full-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  line-height: 1.3; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offer-full-addr { font-size: 12px; color: var(--text-muted); }
.offer-full-price { text-align: right; flex-shrink: 0; }
.offer-full-price-val { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.offer-price-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 8px; margin-top: 2px;
  background: #eff6ff; color: #0369a1;
}
.offer-price-badge.sale { background: #f0fdf4; color: var(--green-dark); }

.offer-full-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.offer-gp-code {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); padding: 2px 8px; border-radius: 10px;
}
.offer-no-leads { font-size: 12px; color: #9ca3af; }

.offer-leads-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.offer-lead-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: var(--bg); border-radius: 8px;
  text-decoration: none; gap: 8px;
}
.offer-lead-item:active { opacity: 0.7; }
.offer-lead-budget { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.offer-more-leads { font-size: 12px; color: var(--text-muted); padding: 0 4px; }

.offer-full-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.offer-ext-link {
  font-size: 12px; font-weight: 600; color: var(--green-dark); text-decoration: none;
  white-space: nowrap;
}
.offer-ext-link:active { opacity: 0.7; }

/* === Deduplikacja === */
.dup-notice {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.dup-notice-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.dup-notice-title { font-size: 13px; font-weight: 600; color: #92400e; }
.dup-item {
  padding: 8px 0; border-top: 1px solid #fde68a;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.dup-item-info {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: 1;
}
.dup-item-name { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.dup-item-name:hover { text-decoration: underline; }
.dup-item-eq { font-size: 15px; color: #fbbf24; }
.dup-item-phone { font-size: 12px; color: var(--text-muted); }
.dup-item-actions { display: flex; gap: 6px; }
.btn-dup-keep {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--white); cursor: pointer; color: var(--text);
}
.btn-dup-dismiss {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid #fca5a5; background: #fef2f2; cursor: pointer; color: #dc2626;
}
.dup-lead-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fffbeb; border-color: #fbbf24;
}
.dup-lead-icon { font-size: 18px; flex-shrink: 0; padding-top: 2px; }
.dup-lead-body { flex: 1; }
.dup-lead-title { font-size: 13px; font-weight: 600; color: #92400e; margin-bottom: 4px; }
.dup-lead-text { font-size: 14px; color: var(--text); margin-bottom: 10px; line-height: 1.4; }
.dup-lead-link { color: var(--green); text-decoration: none; font-weight: 600; }
.dup-lead-link:hover { text-decoration: underline; }
.dup-lead-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* === Wartość AI (ROI) === */
.roi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.roi-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}
.roi-number {
  font-size: 19px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.2;
}
.roi-label {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  line-height: 1.3;
}

/* === Panel właściciela biura === */
.owner-ai-value {
  background: linear-gradient(135deg, #00a551 0%, #007a3d 100%);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; color: var(--white);
}
.owner-ai-title { font-size: 13px; font-weight: 600; opacity: 0.85; margin-bottom: 12px; }
.owner-ai-metrics { display: flex; gap: 0; }
.owner-ai-metric { flex: 1; text-align: center; border-right: 1px solid rgba(255,255,255,0.2); padding: 0 8px; }
.owner-ai-metric:last-child { border-right: none; }
.owner-ai-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.owner-ai-lbl { font-size: 10px; opacity: 0.75; margin-top: 3px; line-height: 1.3; }
.owner-ai-formula { font-size: 12px; opacity: 0.85; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rate-input {
  width: 56px; padding: 2px 6px; border-radius: 4px; border: none;
  background: rgba(255,255,255,0.25); color: var(--white);
  font-size: 13px; font-weight: 700; text-align: center;
  -moz-appearance: textfield;
}
.rate-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rate-input:focus { outline: 2px solid rgba(255,255,255,0.6); background: rgba(255,255,255,0.35); }
.rate-hint { opacity: 0.55; font-size: 11px; }

.owner-header { margin-bottom: 12px; }
.owner-title { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.owner-meta { font-size: 13px; color: var(--text-muted); }

.owner-period-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; width: fit-content;
}
.owner-period-tab {
  font-size: 13px; font-weight: 500; padding: 5px 14px;
  border-radius: 6px; text-decoration: none; color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.owner-period-tab.active {
  background: var(--white); color: var(--text);
  font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.owner-alert-block {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px;
}
.owner-alert-label { font-size: 12px; font-weight: 700; color: #c2410c; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.owner-alert-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-top: 1px solid #fed7aa; flex-wrap: wrap;
}
.owner-alert-info { flex: 1; }
.owner-alert-name { font-size: 14px; font-weight: 700; color: var(--text); margin-right: 8px; }
.owner-alert-detail { font-size: 13px; color: #c2410c; }
.btn-owner-view {
  font-size: 12px; font-weight: 600; padding: 6px 14px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); color: var(--green-dark); text-decoration: none;
  white-space: nowrap;
}

.owner-stats-bar {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.owner-stat {
  flex: 1; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.owner-stat-num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.owner-stat-num.hot { color: var(--red); }
.owner-stat-num.ok { color: var(--green-dark); }
.owner-stat-num.muted { color: #9ca3af; }
.owner-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

.owner-team-list { display: flex; flex-direction: column; gap: 10px; }
.owner-agent-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-decoration: none; color: inherit;
}
.owner-agent-card:active { opacity: 0.85; }
.owner-agent-card-alert { border-left: 3px solid #fb923c; background: #fff7ed; }
.owner-agent-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.owner-agent-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: var(--white);
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.owner-agent-card-alert .owner-agent-avatar { background: #fb923c; }
.owner-agent-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.owner-agent-last { font-size: 11px; color: var(--text-muted); }
.owner-agent-metrics { display: flex; gap: 20px; flex-shrink: 0; }
.owner-metric { text-align: center; min-width: 52px; }
.owner-metric-val { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.1; }
.owner-metric-val.hot { color: var(--red); }
.owner-metric-val.ok { color: var(--green-dark); }
.owner-metric-val.warn { color: #ea580c; }
.owner-metric-val.muted { color: #9ca3af; font-weight: 500; }
.owner-metric-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

.owner-agent-score {
  font-size: 18px; font-weight: 800; line-height: 1; text-align: center;
}
.owner-agent-score .score-max { font-size: 11px; font-weight: 500; opacity: 0.6; }
.score-ok { color: #15803d; }
.score-warn-mild { color: #a16207; }
.score-warn { color: #b91c1c; }
.score-muted { color: #9ca3af; font-weight: 500; }

/* === Konwersja page === */

/* Two-column layout: speed-to-lead left, stage rates right */
.konw-two-col {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.konw-metric-block {
  flex: 0 0 auto;
  min-width: 130px;
  text-align: center;
}
.konw-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.konw-big-number {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
}
.konw-metric-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 8px;
}
.konw-color-green  { color: var(--green-dark); }
.konw-color-yellow { color: #d97706; }
.konw-color-red    { color: var(--red); }
.konw-color-muted  { color: #9ca3af; }

/* Speed badge */
.konw-speed-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.konw-speed-green  { background: #f0fdf4; color: var(--green-dark); }
.konw-speed-yellow { background: #fffbeb; color: #92400e; }
.konw-speed-red    { background: #fef2f2; color: var(--red); }

/* Stage rates list (right column) */
.konw-stage-list {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.konw-stage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.konw-stage-lbl { font-size: 14px; color: var(--text-muted); }
.konw-stage-val  { font-size: 15px; font-weight: 700; }

/* Funnel (card 2) */
.konw-funnel { display: flex; flex-direction: column; }
.konw-funnel-step {}
.konw-funnel-bar-row {
  height: 20px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.konw-funnel-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.4s;
}
.konw-funnel-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.konw-funnel-label { font-size: 13px; color: var(--text-muted); }
.konw-funnel-num   { font-size: 14px; font-weight: 700; }
.konw-funnel-arrow {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0 4px 8px;
  color: var(--text-muted);
}
.konw-funnel-pct  { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.konw-funnel-arrow-icon { font-size: 14px; color: #d1d5db; }

/* Channel cards (card 3) */
.konw-channels {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.konw-channel-card {
  flex: 1;
  min-width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
}
.konw-channel-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.konw-channel-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.konw-channel-stat:last-child { border-bottom: none; }
.konw-channel-stat-lbl { font-size: 12px; color: var(--text-muted); }
.konw-channel-stat-val { font-size: 13px; font-weight: 700; }

/* Stale leads list (card 4) */
.konw-stale-list { display: flex; flex-direction: column; gap: 0; }
.konw-stale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  touch-action: manipulation;
}
.konw-stale-row:last-child { border-bottom: none; }
.konw-stale-row:active { opacity: 0.75; }
.konw-stale-left { flex: 1; min-width: 0; }
.konw-stale-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.konw-stale-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.konw-stale-days {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}
.konw-stale-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}

/* No-answer analysis (card 5) */
.konw-noanswer-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.konw-noanswer-item {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
}
.konw-noanswer-sep {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}
.konw-noanswer-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
  color: var(--text);
}
.konw-noanswer-lbl {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive: stack two-col on very narrow screens */
@media (max-width: 360px) {
  .konw-two-col { flex-direction: column; }
  .konw-metric-block { min-width: 0; width: 100%; }
}

/* === Fix 1: Navbar overflow na bardzo wąskich ekranach === */
@media (max-width: 560px) {
  .navbar-sub { display: none; }
  .nav-link { font-size: 12px; padding: 4px 5px; }
  .navbar-nav { gap: 0; }
  .navbar { padding: 10px 14px; gap: 8px; }
}

/* === Transaction type badges === */
.tx-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tx-sprzedaz { background: #fef3c7; color: #92400e; }
.tx-wynajem  { background: #dbeafe; color: #1e40af; }

/* Cena inline w kartach leadów */
.offer-price-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  margin-left: 6px;
  white-space: nowrap;
}

/* === Fix 3: Małe przyciski — min touch target na mobile === */
@media (max-width: 599px) {
  .btn-outline, .btn-muted { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* === Fix 2: Agent card — responsive layout na mobile === */
@media (max-width: 599px) {
  /* Każda karta agenta staje się pionowym cardem */
  .owner-agent-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  /* Lewa strona (avatar + imię) zajmuje całą szerokość */
  .owner-agent-left {
    width: 100%;
  }

  /* Metryki: lista z etykietami po lewej i wartościami po prawej */
  .owner-agent-metrics {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .owner-metric {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }

  .owner-metric:last-child {
    border-bottom: none;
  }

  /* Etykiety zawsze widoczne i wyrównane do lewej */
  .owner-metric-lbl {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 0;
    order: -1;
  }

  /* Wartości wyrównane do prawej */
  .owner-metric-val {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
  }

  /* Score w metrykach też wyrównany do prawej */
  .owner-agent-score {
    font-size: 18px;
    text-align: right;
  }

  /* Przycisk "Otwórz dashboard" w alert-block — większy touch target */
  .btn-owner-view {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }
}

