@charset "UTF-8";
/* ==========================================================================
   CRM HubAI -- Redesign 2026 (PHP UI layer)
   Paleta: zielony #00AB35 (primary energia) + niebieski #005AA9 (akcent), Sora + Jakarta.
   ========================================================================== */

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('./fonts/sora-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('./fonts/sora-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/sora-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('./fonts/sora-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand: zielony = energia/primary, niebieski = trust/akcent */
  --hub: #00AB35;
  --hub-hover: #00962E;
  --hub-dark: #007A26;
  --hub-soft: #E8F8ED;
  --hub-ink: #0B1B2E;
  --accent: #005AA9;
  --accent-hover: #004A8F;
  --accent-soft: #E8F2FA;
  --accent-ink: #003F7A;
  --success: #00AB35;
  --success-hover: #00962E;
  --success-soft: #E8F8ED;
  --bg: #e8eef4;
  --surface: #ffffff;
  --ink: #0b1220;
  --muted: #5a6a7c;
  --line: #d5dee8;
  --radius: 0.95rem;
  --font: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Sora', 'Plus Jakarta Sans Variable', system-ui, sans-serif;
  --shadow-soft: 0 1px 0 rgba(11, 18, 32, 0.04), 0 10px 28px rgba(11, 18, 32, 0.06);
}

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: #f5f7fa;
  background-image: none;
}

h1,
h2,
.deal-client-name,
.crm-display {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.crm-eyebrow {
  font-family: var(--font);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.crm-page-hero {
  position: relative;
  margin-bottom: 1.75rem;
  padding-bottom: 0.25rem;
}
.crm-page-hero h1 {
  margin-top: 0.35rem;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.crm-page-hero p.lead {
  margin-top: 0.55rem;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.crm-card {
  border-radius: var(--radius);
  border: 1px solid rgba(213, 222, 232, 0.95);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, box-shadow 0.2s ease, transform 0.18s ease;
}
.crm-card:hover {
  border-color: rgba(0, 171, 53, 0.28);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.03), 0 14px 32px rgba(11, 18, 32, 0.07);
}

.crm-btn-primary {
  background: linear-gradient(160deg, #2BC24E 0%, #00AB35 72%);
  border: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}
.crm-btn-primary:hover {
  background: linear-gradient(160deg, #00AB35 0%, #007A26 78%);
}

.crm-brand-mark {
  background: linear-gradient(145deg, #00AB35 0%, #2BC24E 42%, #005AA9 100%);
  box-shadow: 0 6px 16px rgba(0, 171, 53, 0.28);
  transition: transform 0.25s ease;
}
a:hover .crm-brand-mark,
.group:hover .crm-brand-mark {
  transform: scale(1.04);
}

.crm-topbar {
  border-bottom-color: rgba(213, 222, 232, 0.85) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.03);
  animation: crm-topbar-in 0.45s ease both;
}
.crm-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.crm-brand-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

footer.crm-site-footer.hubai-site-footer {
  border-top: 1px solid #1e293b;
  background: #0b1220;
  margin-top: 3rem;
  color: #e2e8f0;
}
footer.crm-site-footer:not(.hubai-site-footer) {
  border-top: 1px solid rgba(213, 222, 232, 0.9);
  background: #fff;
  margin-top: 3rem;
}
footer.crm-site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Public / login -- bez atmosferycznych gradientow */
.crm-auth-stage {
  position: relative;
  width: 100%;
  max-width: none;
}
.crm-auth-stage::before {
  content: none;
  display: none;
}

/* Pulpit: interaktywne KPI bez ciezkich kart dashboardu */
.crm-kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (min-width: 1024px) {
  .crm-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.crm-kpi {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(13, 148, 136, 0.35), rgba(213, 222, 232, 0.9)) border-box;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.crm-kpi:hover {
  transform: translateY(-2px);
  background: linear-gradient(#E8F8ED, #fff) padding-box,
    linear-gradient(135deg, rgba(13, 148, 136, 0.55), rgba(14, 116, 144, 0.25)) border-box;
}
.crm-kpi .kpi-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.crm-kpi .kpi-value {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}
.crm-kpi .kpi-hint {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.crm-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Deale: mniej banerow, czytelniejsza lista */
.deal-hint-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(213, 222, 232, 0.85);
  font-size: 0.875rem;
  color: var(--muted);
}
.deal-hint-bar strong {
  color: var(--ink);
  font-weight: 650;
}

.deal-card {
  border-radius: 0.9rem;
  border-color: rgba(213, 222, 232, 0.95);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.03), 0 8px 22px rgba(11, 18, 32, 0.045);
  scroll-margin-top: 5.5rem;
}
.deal-card.is-deep-link-pin,
.deal-card.is-deep-link-flash {
  box-shadow: 0 0 0 2px rgba(0, 171, 53, 0.55), 0 10px 28px rgba(15, 23, 42, 0.12);
}
.deal-card:hover {
  transform: none;
}
.deal-client-name {
  font-size: 1.02rem;
  font-weight: 700;
}

@keyframes crm-topbar-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes crm-atmosphere {
  from { opacity: 0.85; transform: translateY(0) scale(1); }
  to { opacity: 1; transform: translateY(6px) scale(1.03); }
}
@keyframes crm-fade-up {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-up {
  animation: crm-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.animate-fade-up-delay {
  animation: crm-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-fade-up-delay,
  .crm-topbar,
  .crm-auth-stage::before,
  a:hover .crm-brand-mark {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* CRM HubAI -- lekkie UI (toast tla, skeleton) */
.crm-bg-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 80;
  max-width: min(92vw, 22rem);
  transform: translateX(-50%);
  border-radius: 0.85rem;
  border: 1px solid rgb(167 243 208);
  background: rgb(236 253 245);
  color: rgb(6 95 70);
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
}
.crm-bg-toast.is-error {
  border-color: rgb(254 202 202);
  background: rgb(254 242 242);
  color: rgb(153 27 27);
}
.crm-bg-toast.hidden {
  display: none;
}

.crm-skel {
  display: grid;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.crm-skel-line {
  height: 0.85rem;
  border-radius: 0.4rem;
  background: linear-gradient(90deg, #e2e8f0 0%, #f8fafc 45%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: crm-skel 1.1s ease-in-out infinite;
}
.crm-skel-line.sm { width: 33%; }
.crm-skel-line.md { width: 50%; }
.crm-skel-line.lg { width: 66%; }
.crm-skel-line.full { width: 100%; }
.crm-skel-line.tall { height: 2.5rem; }
.crm-skel-line.block { height: 6rem; }

@keyframes crm-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-skel-line { animation: none; background: #e2e8f0; }
}

/* ---- Szybki start (poradnik) ---- */
.qs-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgb(15 23 42 / 48%);
}
@media (min-width: 640px) {
  .qs-overlay {
    align-items: center;
    padding: 1.25rem;
  }
}
.qs-overlay.hidden { display: none; }
.qs-dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 34rem);
  max-height: min(92vh, 44rem);
  border-radius: 1.1rem 1.1rem 0 0;
  background: #fff;
  overflow: hidden;
}
@media (min-width: 640px) {
  .qs-dialog { border-radius: 1.15rem; }
}
.qs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.qs-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00AB35;
}
.qs-title {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.qs-close {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.qs-close:hover { background: #f1f5f9; color: #0f172a; }
.qs-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.qs-lead {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #475569;
}
.qs-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.5rem;
}
.qs-step-text {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.qs-num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #00AB35;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.qs-step h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
}
.qs-step p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
}
.qs-caption {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}
.qs-mock {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #f8fafc;
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}
.qs-mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.qs-mock-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.qs-mock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.7rem;
  border-radius: 0.55rem;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}
.qs-mock-btn-teal {
  background: #00AB35;
  color: #fff;
}
.qs-mock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.qs-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
}
.qs-chip.is-on {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.qs-mock-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.7rem 0.75rem;
}
.qs-mock-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}
.qs-chevron {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.4;
}
.qs-chevron.is-open { color: #00AB35; }
.qs-mock-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.qs-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #E8F8ED;
  color: #00AB35;
  border: 1px solid #93c5fd;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
}
.qs-mock-meta {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
}
.qs-mock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.qs-btn-ghost {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 0.5rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.qs-check-block {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid #f1f5f9;
  display: grid;
  gap: 0.35rem;
}
.qs-check-h {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.qs-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #334155;
}
.qs-box {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 0.25rem;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
}
.qs-box.is-on {
  background: #00AB35;
  border-color: #00AB35;
  box-shadow: inset 0 0 0 2px #fff;
}
.qs-ankieta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.qs-ankieta-t {
  font-size: 0.8rem;
  font-weight: 650;
  color: #0f172a;
}
.qs-comment {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.qs-comment-in {
  flex: 1;
  min-height: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  color: #94a3b8;
  background: #fff;
}
.qs-toast {
  margin: 0.15rem auto 0;
  max-width: 16rem;
  text-align: center;
  border-radius: 0.7rem;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 650;
}
.qs-tips {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: #E8F8ED;
  border: 1px solid #93c5fd;
}
.qs-tips-title {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00AB35;
}
.qs-tips ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.45;
}
.qs-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}
.qs-dont {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
}
.qs-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #00AB35;
  font-weight: 800;
  font-size: 0.95rem;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer;
  text-decoration: none;
}
.qs-info-btn:hover {
  background: #E8F8ED;
  border-color: #93c5fd;
}

/* Offline banner */
.crm-offline-banner {
  position: fixed;
  left: 50%;
  top: 0.75rem;
  z-index: 90;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  max-width: min(94vw, 28rem);
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
}
.crm-offline-banner.hidden { display: none; }
.crm-offline-retry {
  border: 0;
  border-radius: 0.5rem;
  background: #00AB35;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

/* Filtry etapow: scrolluja z trescia (bez sticky) */
@media (max-width: 1023px) {
  .deals-filters .stage-filter-row {
    position: static;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: 0.45rem 0.25rem 0.55rem;
  }
}

/* ---- Mobile-first: overflow, header, deals, QS ---- */
html {
  overflow-x: clip;
  max-width: 100%;
}
body {
  overflow-x: clip;
  max-width: 100%;
}

.notif-bell-panel {
  width: min(24rem, calc(100vw - 2rem));
}

/* Dropdown ?Wi?cej?: przewijanie, ?eby dolne pozycje by?y klikalne */
#nav-more-panel,
.nav-more-panel {
  max-height: min(70vh, 28rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (max-width: 639px) {
  .crm-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  main.crm-shell {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }

  .crm-topbar .crm-shell {
    gap: 0.5rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .crm-topbar .qs-info-btn {
    width: 2.35rem;
    height: 2.35rem;
  }

  /* Panel powiadomien: nie wychodzi poza ekran */
  .notif-bell-panel {
    position: fixed !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: 3.5rem !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 0 !important;
    z-index: 60;
  }

  .pipeline-select-mobile {
    width: 100%;
    min-height: 3rem;
    font-size: 1rem;
    line-height: 1.3;
  }

  .deal-header-collapsed {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .deal-header-main {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .deal-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    justify-content: stretch;
  }

  .deal-header-actions .deal-action-btn,
  .deal-header-actions .crm-btn-primary,
  .deal-header-actions .crm-btn-ghost {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.45rem 0.35rem;
    font-size: 0.875rem;
    justify-content: center;
  }

  .deal-client-name {
    font-size: 1.05rem;
    word-break: break-word;
  }

  .deal-contact-row a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Gestsza checklista, nadal z zachowaniem touch target ~44px */
  .stage-check-row {
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
    gap: 0.7rem;
  }

  .stage-check-label {
    font-size: 0.92rem;
  }

  .crm-card:hover {
    transform: none;
  }

  .qs-dialog {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 1rem 1rem 0 0;
  }

  .qs-footer {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  .qs-footer .crm-btn-primary {
    width: 100%;
  }

  .qs-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 639px) {
  .ankieta-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ankieta-container {
    width: 100%;
    height: min(94dvh, 100%);
    max-height: 94dvh;
    border-radius: 1rem 1rem 0 0;
  }
  #ankieta-form .table-row {
    grid-template-columns: 1fr 1fr;
  }
  .ankieta-nav-bar {
    flex-wrap: wrap;
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }
  .ankieta-nav-hint {
    order: -1;
    flex: 1 1 100%;
  }
  .stage-info-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .stage-info-card {
    width: 100% !important;
    max-width: none !important;
    max-height: 90dvh;
    border-radius: 1rem 1rem 0 0 !important;
  }
}

/* Ramka formularza Bitrix (Programy) */
#b24-form-frame {
  width: 100%;
  max-width: 100%;
  vertical-align: top;
  background: #fff;
}

/* Naglowek: Sync / i / dzwonek / profil -- bez sklejania */
.header-actions {
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .header-actions {
    gap: 0.85rem;
  }
}
.header-actions .qs-info-btn,
.header-actions #notif-bell-btn {
  flex-shrink: 0;
}

/* ---- Kontrast: aktywne przyciski ghost (bialy tekst tylko na ciemnym tle) ---- */
.crm-btn-ghost.is-active,
.crm-btn-ghost.is-active:hover,
.crm-btn-ghost.is-active:focus-visible,
.crm-btn-ghost.active-filter,
.crm-btn-ghost.active-filter:hover,
.crm-btn-ghost.active-filter:focus-visible,
.extra-filter.active,
.extra-filter.active:hover,
.extra-filter.active:focus-visible,
.date-preset.active,
.date-preset.active:hover,
.date-preset.active:focus-visible,
.toggle-all-deals.is-active,
.toggle-all-deals.is-active:hover,
.toggle-all-deals.is-active:focus-visible {
  background: #0f172a !important;
  border-color: #0f172a !important;
  color: #fff !important;
}

/* Nawigacja / pipeline: aktywny link nie moze stac sie jasny na hover */
a.bg-hub-ink.text-white:hover,
a.bg-hub-ink.text-white:focus-visible,
button.bg-hub-ink.text-white:hover,
button.bg-hub-ink.text-white:focus-visible {
  background-color: #0c1222 !important;
  color: #fff !important;
}

@media (max-width: 639px) {
  .stage-filter-chip .chip-title {
    white-space: normal !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
  }
}

/* Zakladki narzedzi (Dysk / Wiedza / Umowy) -- aktywna zawsze czytelna */
.tools-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tools-tab:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.tools-tab.is-active,
.tools-tab[aria-current="page"] {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.tools-tab.is-active:hover,
.tools-tab[aria-current="page"]:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}
@media (max-width: 639px) {
  .tools-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .tools-tab {
    width: 100%;
  }
}

/* Filtry etapow: aktywny chip zawsze czytelny */
.stage-filter-chip.active,
.stage-filter-chip.active:hover,
.stage-filter-chip.active:focus-visible {
  background: #0f172a !important;
  border-color: #0f172a !important;
  color: #fff !important;
}
.stage-filter-chip.active .chip-title,
.stage-filter-chip.active .chip-sub,
.stage-filter-chip.active:hover .chip-title,
.stage-filter-chip.active:hover .chip-sub {
  color: #fff !important;
}
.stage-filter-chip.active .chip-count,
.stage-filter-chip.active:hover .chip-count {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Admin: filtr uzytkownikow - osobne pola, bez nakladania */
.users-filter-form {
  display: grid;
  gap: 0.75rem;
  align-items: end;
  grid-template-columns: 1fr;
}
.users-filter-field {
  display: block;
  min-width: 0;
  position: relative;
}
.users-filter-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}
.users-filter-submit {
  width: 100%;
}
@media (min-width: 640px) {
  .users-filter-form {
    grid-template-columns: minmax(0, 1fr) 11rem auto;
  }
  .users-filter-submit {
    width: auto;
  }
}

/* Deale: lzejsze renderowanie + paginacja lokalna */
.deal-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 140px;
}
.deal-card.is-deferred {
  display: none !important;
}

.deal-jump-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.deal-jump-link:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.deal-next-step {
  border-color: rgba(0, 171, 53, 0.25);
  background: linear-gradient(135deg, rgba(0, 171, 53, 0.06), rgba(255, 255, 255, 0.9));
}
.deal-stage-block > summary {
  list-style: none;
}
.deal-stage-block > summary::-webkit-details-marker {
  display: none;
}

.crm-pwa-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 171, 53, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
.crm-pwa-banner-text {
  flex: 1 1 12rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}
.crm-pwa-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Zapisane filtry (zamiast starego select+Usun) */
.saved-filter-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.saved-filter-apply {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.saved-filter-apply:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.saved-filter-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #cbd5e1;
  flex-shrink: 0;
}
.saved-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-filter-row.is-active .saved-filter-apply {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}
.saved-filter-row.is-active .saved-filter-dot {
  background: #7EB8E8;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
}
.saved-filter-delete {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}
.saved-filter-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* Rozwinieta karta deala: mniej scrolla */
.deal-body-extra {
  background: #fafbfc;
}
.deal-extra-block > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
}
.deal-extra-block > summary::-webkit-details-marker {
  display: none;
}
.deal-extra-summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 0.45rem;
  color: #94a3b8;
  transition: transform 0.15s ease;
}
.deal-extra-block[open] > .deal-extra-summary::before {
  transform: rotate(90deg);
}
.deal-card:not(.is-collapsed) .deal-checklist-mount {
  max-height: min(52vh, 28rem);
  overflow-y: auto;
}

/* FAB Nowy deal (telefon) */
.deal-create-fab {
  display: none;
}
@media (max-width: 639px) {
  .deal-create-fab.is-hidden {
    display: none !important;
  }
  .deal-create-fab {
    position: fixed;
    right: max(0.85rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 3.25rem;
    padding: 0 1.1rem 0 0.85rem;
    border: 0;
    border-radius: 999px;
    background: #00AB35;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 171, 53, 0.35);
    cursor: pointer;
  }
  .deal-create-fab span[aria-hidden="true"] {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 600;
  }
  /* Odstep tylko gdy FAB jest na stronie -- nie dmuchaj calej stopki na innych podstronach */
  body:has(.deal-create-fab:not(.is-hidden)) {
    padding-bottom: max(4.5rem, calc(env(safe-area-inset-bottom) + 3.5rem));
  }
  footer .crm-shell {
    padding-top: 2.5rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }
  .date-preset {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
  }
  .notif-bell-panel {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    top: max(4.25rem, calc(env(safe-area-inset-top) + 3.5rem));
    width: auto;
    max-height: min(70vh, 28rem);
  }
  .notif-log-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }
  .notif-log-actions .crm-btn-ghost {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ---- Deal INFO / create modal: full-viewport overlay ---- */
.deal-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 200 !important;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.deal-modal-overlay.is-open,
.deal-modal-overlay.flex {
  display: flex !important;
}
.deal-modal-overlay.hidden {
  display: none !important;
}
body.deal-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}
html.deal-modal-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}
.deal-modal-overlay {
  overscroll-behavior: contain;
}
.deal-modal-dialog {
  display: flex;
  flex-direction: column;
  width: min(56rem, calc(100vw - 1.25rem));
  max-height: min(94dvh, 64rem);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 1.15rem;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 24px 48px rgba(15, 23, 42, 0.22);
}
.deal-modal-dialog--sm {
  width: min(28rem, calc(100vw - 1.5rem));
  max-height: min(88dvh, 52rem);
}
.deal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}
.deal-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.deal-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.1rem 1.15rem;
  color: #334155;
  font-size: 0.925rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.deal-modal-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deal-info-view {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.deal-info-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 480px) {
  .deal-info-meta {
    grid-template-columns: 1fr 1fr;
  }
}
.deal-info-meta-item {
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: #f5f8fb;
  border: 1px solid #e8eef4;
}
.deal-info-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.deal-info-value {
  display: block;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}
.deal-info-value--mono {
  font-size: 0.88rem;
  font-weight: 500;
}
.deal-info-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.deal-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.deal-task-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .deal-task-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10.5rem auto;
    gap: 0.75rem 0.65rem;
    align-items: end;
  }
}
.deal-task-form-title,
.deal-task-form-date {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.35rem;
}
.deal-task-form-actions {
  margin-top: 0.15rem;
}
@media (min-width: 640px) {
  .deal-task-form-actions {
    margin-top: 0;
  }
}
.deal-task-form-submit {
  width: 100%;
}
@media (min-width: 640px) {
  .deal-task-form-submit {
    width: auto;
  }
}
.deal-task-list {
  margin-top: 0.35rem;
}
.deal-info-contact {
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid #e8eef4;
  background: #fff;
}
.deal-info-contact-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.deal-info-contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.35rem;
  font-size: 0.875rem;
}
.deal-info-contact-meta a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.deal-info-empty {
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
}
.deal-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0.65em;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.deal-info-note {
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  white-space: pre-wrap;
  font-size: 0.875rem;
}
.deal-info-pre {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: 0.85rem;
  color: #334155;
}
.deal-field-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid #eef2f6;
  border-radius: 0.85rem;
  background: #fff;
}
.deal-field-row {
  border-bottom: 1px solid #f1f5f9;
}
.deal-field-row:last-child {
  border-bottom: 0;
}
.deal-info-files {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.deal-info-files a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.deal-info-upload {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px dashed #d7e0ea;
  border-radius: 0.9rem;
  background: #f8fafc;
}
.deal-info-upload-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.deal-info-upload-hint {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #64748b;
}
.deal-file-upload {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.deal-file-field {
  display: block;
}
.deal-file-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.deal-file-select {
  min-height: 2.75rem;
  width: 100%;
}
.deal-file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 5.5rem;
  padding: 0.9rem 1rem;
  border: 1px dashed #9db8c4;
  border-radius: 0.85rem;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.deal-file-drop:hover,
.deal-file-drop:focus-within {
  border-color: var(--accent, #005AA9);
  background: var(--accent-soft, #E8F2FA);
}
.deal-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.deal-file-drop-main {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  pointer-events: none;
}
.deal-file-drop-name {
  font-size: 0.78rem;
  color: #64748b;
  pointer-events: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-file-drop-name.has-file {
  color: #00AB35;
  font-weight: 600;
}
.deal-file-submit {
  width: 100%;
  min-height: 2.75rem;
}
.deal-file-upload-msg {
  margin: 0.5rem 0 0;
  min-height: 1rem;
  font-size: 0.75rem;
  color: #64748b;
}
.deal-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid #eef2f6;
}

@media (max-width: 639px) {
  .deal-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .deal-modal-dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: 1.15rem 1.15rem 0 0;
  }
}

@media (min-width: 640px) {
  .deal-create-fab-label {
    /* desktop uses header button */
  }
}

/* Programy -- pelny formularz (parity Bitrix) */
.program-form-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--hub-line, #e2e8f0) 90%, transparent);
}
.program-form > .program-form-field:first-child,
.program-form > .program-form-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.program-form-section-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hub-ink, #0f172a);
}
.program-form-field {
  margin: 0;
}
.program-form-field.is-invalid .crm-input,
.program-form-field .crm-input.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}
.program-form-error {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #b91c1c;
}
.program-form-alert {
  border-radius: 0.9rem;
  border: 1px solid #fecaca;
  background: #fef2f2;
  padding: 0.9rem 1rem;
  outline: none;
}
.program-form-alert:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f87171;
}
.program-form-dup-confirm {
  user-select: none;
}
.program-form-dup-checkbox {
  min-width: 1.25rem;
  min-height: 1.25rem;
  cursor: pointer;
}
html.crm-dark .program-form-dup-confirm {
  background: #3b2f14 !important;
  border-color: #a16207 !important;
  color: #fef3c7 !important;
}
.program-form-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.program-form-options--wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
@media (min-width: 640px) {
  .program-form-options--wrap {
    grid-template-columns: 1fr 1fr;
  }
}
.program-form-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--hub-line, #e2e8f0) 100%, transparent);
  border-radius: 0.85rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
}
.program-form-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--hub, #00AB35) 55%, #94a3b8);
  background: color-mix(in srgb, var(--hub, #00AB35) 8%, #fff);
}
.program-form-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}




/* ==========================================================================
   Motywy: jasny (czytelnosc) + ciemny (kompletny, bez bialych dziur)
   ========================================================================== */

/* --- Jasny: kolumny etapow checklisty --- */
.deal-checklist-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
@media (min-width: 768px) {
  .deal-checklist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .deal-checklist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.stage-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1rem;
  background: #f8fafc;
}
.stage-section--done {
  border-color: #93c5fd;
  background: #E8F8ED;
}
.stage-section--locked {
  background: #f1f5f9;
  opacity: 0.92;
}
.stage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.stage-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
}
.stage-lock-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #64748b;
}
.stage-badge {
  display: inline-block;
  border-radius: 0.4rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stage-badge--locked {
  background: #e2e8f0;
  color: #475569;
}
.stage-badge--ok {
  background: #ccfbf1;
  color: #00AB35;
}

/* --- Jasny: checklista i etykiety --- */
.stage-check-label {
  color: #0f172a !important;
  font-weight: 550;
}
.stage-check-row.is-checked {
  background: #ecfdf5 !important;
  border-color: #7EB8E8 !important;
}
.stage-check-row.is-checked .stage-check-label {
  color: #00AB35 !important;
  font-weight: 700;
}
.stage-check-row.is-ankieta-row:not(.is-checked) {
  background: #fffbeb !important;
  border-color: #fbbf24 !important;
}
.stage-check-row.is-ankieta-row:not(.is-checked) .stage-check-label {
  color: #92400e !important;
  font-weight: 700;
}
.deal-body-extra {
  background: #f8fafc;
}
.comments-list {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a;
}
.deal-meta-ankieta,
.deal-meta-check.is-warn {
  color: #b45309 !important;
  font-weight: 700;
}
.deal-meta-check.is-ok {
  color: #00AB35 !important;
  font-weight: 600;
}

/* ==========================================================================
   CIEMNY MOTYW - audyt pelny (layout / leady / admin / modale / tabele)
   ========================================================================== */
html.crm-dark {
  --accent: #7EB8E8;
  --accent-hover: #6BB8F0;
  --accent-soft: #0c2744;
  --accent-ink: #93c5fd;
  --bg: #0a0f1a;
  --surface: #141c2b;
  --surface-2: #1a2436;
  --surface-3: #0c1220;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: #2d3a4f;
  --line-soft: #243044;
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

html.crm-dark body {
  background-color: var(--bg) !important;
  background-image:
    radial-gradient(ellipse 90% 55% at 0% -15%, rgba(0, 171, 53, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(0, 90, 169, 0.1), transparent 50%);
  color: var(--ink);
}

/* --- Shell / nav --- */
html.crm-dark .crm-topbar {
  background: rgba(10, 15, 26, 0.94) !important;
  border-bottom-color: var(--line) !important;
  backdrop-filter: blur(18px);
}
html.crm-dark .crm-site-footer.hubai-site-footer {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #e2e8f0;
}
html.crm-dark .crm-site-footer:not(.hubai-site-footer) {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--muted);
}
html.crm-dark #nav-menu-btn,
html.crm-dark #notif-bell-btn,
html.crm-dark .qs-info-btn {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: #e2e8f0 !important;
}
html.crm-dark #nav-more-panel,
html.crm-dark #nav-drawer,
html.crm-dark #notif-bell-panel {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-soft) !important;
}
html.crm-dark #nav-drawer a,
html.crm-dark #nav-more-panel a {
  color: #e2e8f0 !important;
}
html.crm-dark #nav-drawer a:hover,
html.crm-dark #nav-more-panel a:hover {
  background: var(--surface-2) !important;
  color: #f8fafc !important;
}
html.crm-dark #logout-btn-drawer {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: #f1f5f9 !important;
}
html.crm-dark #crm-dark-toggle {
  color: #fbbf24 !important;
  border-color: var(--line) !important;
  background: var(--surface-2) !important;
}

/* --- Karty / KPI / kanban --- */
html.crm-dark .crm-card,
html.crm-dark .crm-kpi,
html.crm-dark .kanban-col,
html.crm-dark .kanban-card,
html.crm-dark .deal-card {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-soft);
}
html.crm-dark .deal-card.is-deep-link-pin,
html.crm-dark .deal-card.is-deep-link-flash {
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.55), 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}
html.crm-dark .crm-kpi {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(45, 212, 191, 0.45), rgba(45, 58, 79, 0.9)) border-box !important;
  border: 1px solid transparent !important;
}
html.crm-dark .crm-kpi:hover,
html.crm-dark .crm-card:hover,
html.crm-dark .deal-card:hover {
  background: var(--surface-2) !important;
  border-color: #3d4f68 !important;
}
html.crm-dark .crm-kpi .kpi-label { color: var(--muted) !important; }
html.crm-dark .crm-kpi .kpi-value { color: #f8fafc !important; }
html.crm-dark .crm-kpi .kpi-hint { color: #6BB8F0 !important; }
html.crm-dark .kanban-col { background: var(--surface-3) !important; }
html.crm-dark .kanban-card { background: var(--surface) !important; }
html.crm-dark .kanban-col .bg-white,
html.crm-dark .kanban-col span.rounded.bg-white {
  background: var(--surface-2) !important;
  color: #e2e8f0 !important;
}

/* --- Typografia --- */
html.crm-dark .crm-page-hero h1,
html.crm-dark .text-hub-ink,
html.crm-dark h1,
html.crm-dark h2,
html.crm-dark h3,
html.crm-dark .crm-section-title,
html.crm-dark .crm-display,
html.crm-dark .crm-brand-text,
html.crm-dark .deal-client-name,
html.crm-dark .font-semibold.text-hub-ink,
html.crm-dark .font-bold.text-hub-ink {
  color: #f8fafc !important;
}
html.crm-dark .crm-page-hero p.lead,
html.crm-dark .text-slate-400,
html.crm-dark .text-slate-500,
html.crm-dark .text-slate-600,
html.crm-dark .text-slate-700,
html.crm-dark .crm-brand-sub,
html.crm-dark .muted,
html.crm-dark .text-gray-500,
html.crm-dark .text-gray-600 {
  color: var(--muted) !important;
}
html.crm-dark .crm-eyebrow,
html.crm-dark .text-hub,
html.crm-dark a.text-hub {
  color: #6BB8F0 !important;
}
html.crm-dark a.text-hub-ink,
html.crm-dark .hover\:text-slate-800:hover,
html.crm-dark .hover\:text-slate-900:hover,
html.crm-dark .hover\:text-hub-ink:hover {
  color: #6BB8F0 !important;
}

html.crm-dark .deal-info-note {
  background: #1c1000;
  border-color: #78350f;
  color: #fcd34d;
}
html.crm-dark .deal-stage-pill {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

/* --- Formularze / przyciski --- */
html.crm-dark .crm-input,
html.crm-dark input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']),
html.crm-dark select,
html.crm-dark textarea {
  background: var(--surface-3) !important;
  color: #f1f5f9 !important;
  border-color: var(--line) !important;
}
html.crm-dark .crm-input::placeholder,
html.crm-dark textarea::placeholder,
html.crm-dark input::placeholder {
  color: #64748b !important;
}
html.crm-dark option {
  background: var(--surface);
  color: var(--ink);
}
html.crm-dark .crm-btn-ghost,
html.crm-dark .deal-action-btn,
html.crm-dark button.crm-btn-ghost {
  background: var(--surface-2) !important;
  color: #f1f5f9 !important;
  border: 1px solid var(--line) !important;
}
html.crm-dark .crm-btn-ghost:hover,
html.crm-dark .deal-action-btn:hover {
  background: #243247 !important;
  border-color: #4a5d78 !important;
}
html.crm-dark .crm-btn-primary,
html.crm-dark .ankieta-inline-btn,
html.crm-dark .ankieta-btn-primary {
  background: linear-gradient(160deg, #2BC24E 0%, #00AB35 75%) !important;
  color: #fff !important;
  border: 0 !important;
}
html.crm-dark .ankieta-btn-secondary {
  background: #334155 !important;
  color: #f1f5f9 !important;
}
html.crm-dark .active-filter {
  background: #00AB35 !important;
  color: #fff !important;
  border-color: #7EB8E8 !important;
}

/* --- Tailwind light utilities --- */
html.crm-dark .bg-white,
html.crm-dark .bg-white\/80,
html.crm-dark .bg-white\/90,
html.crm-dark .bg-slate-50,
html.crm-dark .bg-slate-50\/50,
html.crm-dark .bg-slate-50\/60,
html.crm-dark .bg-slate-50\/70,
html.crm-dark .bg-slate-50\/80,
html.crm-dark .bg-slate-100,
html.crm-dark .bg-slate-100\/80,
html.crm-dark .bg-gray-50,
html.crm-dark .hover\:bg-white\/90:hover,
html.crm-dark .hover\:bg-white\/80:hover,
html.crm-dark .hover\:bg-white:hover,
html.crm-dark .hover\:bg-slate-50:hover,
html.crm-dark .hover\:bg-slate-50\/60:hover,
html.crm-dark .hover\:bg-slate-100:hover {
  background-color: var(--surface) !important;
}
html.crm-dark thead.bg-slate-50,
html.crm-dark thead.bg-slate-50\/80,
html.crm-dark .bg-slate-50\/80,
html.crm-dark tr:hover {
  background-color: var(--surface-2) !important;
}
html.crm-dark .border-slate-50,
html.crm-dark .border-slate-100,
html.crm-dark .border-slate-200,
html.crm-dark .border-slate-200\/70,
html.crm-dark .border-slate-200\/80,
html.crm-dark .border-slate-200\/90,
html.crm-dark .border-slate-300,
html.crm-dark .divide-slate-50 > :not([hidden]) ~ :not([hidden]),
html.crm-dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.crm-dark .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--line) !important;
}
html.crm-dark .text-slate-800,
html.crm-dark .text-slate-900,
html.crm-dark .text-gray-900 {
  color: #f1f5f9 !important;
}
html.crm-dark .bg-hub-soft {
  background: rgba(45, 212, 191, 0.18) !important;
  color: #93c5fd !important;
}
html.crm-dark .text-hub-dark {
  color: #93c5fd !important;
}
html.crm-dark .group-hover\:bg-teal-100:hover,
html.crm-dark .group:hover .group-hover\:bg-teal-100 {
  background: rgba(45, 212, 191, 0.28) !important;
}

/* Alerty */
html.crm-dark .bg-emerald-50,
html.crm-dark .border-emerald-200 {
  background: #064e3b !important;
  color: #a7f3d0 !important;
  border-color: #059669 !important;
}
html.crm-dark .text-emerald-700,
html.crm-dark .text-emerald-800,
html.crm-dark .text-emerald-600 { color: #6FDD8F !important; }
html.crm-dark .bg-amber-50,
html.crm-dark .border-amber-200,
html.crm-dark .log-unread {
  background: #422006 !important;
  color: #fde68a !important;
  border-color: #d97706 !important;
}
html.crm-dark .text-amber-700,
html.crm-dark .text-amber-800,
html.crm-dark .text-amber-900,
html.crm-dark .text-amber-950 { color: #fcd34d !important; }
html.crm-dark .bg-red-50,
html.crm-dark .border-red-200 {
  background: #7f1d1d !important;
  color: #fecaca !important;
  border-color: #ef4444 !important;
}
html.crm-dark .text-red-700,
html.crm-dark .text-red-600 { color: #fca5a5 !important; }
html.crm-dark .bg-red-100 { background: #7f1d1d !important; color: #fecaca !important; }
html.crm-dark .bg-blue-50,
html.crm-dark .border-blue-200 {
  background: #1e3a5f !important;
  color: #bfdbfe !important;
  border-color: #3b82f6 !important;
}
html.crm-dark .bg-orange-50 { background: #431407 !important; color: #fdba74 !important; }
html.crm-dark pre,
html.crm-dark code {
  background: var(--surface-3) !important;
  color: #cbd5e1 !important;
  border-color: var(--line);
}
html.crm-dark .shadow-lift,
html.crm-dark .shadow-soft,
html.crm-dark .shadow-sm,
html.crm-dark .shadow-xl {
  box-shadow: var(--shadow-soft) !important;
}

/* --- Tabele --- */
html.crm-dark table {
  color: var(--ink);
}
html.crm-dark thead,
html.crm-dark thead th,
html.crm-dark .notif-day-head {
  background: var(--surface-3) !important;
  color: #94a3b8 !important;
  border-color: var(--line) !important;
}
html.crm-dark tbody tr,
html.crm-dark tbody td {
  border-color: var(--line-soft) !important;
  color: #e2e8f0 !important;
}
html.crm-dark tbody tr:hover {
  background: rgba(45, 212, 191, 0.06) !important;
}
html.crm-dark .h-2\.5.bg-slate-100,
html.crm-dark .h-3.bg-slate-100,
html.crm-dark .bg-slate-100.rounded-full,
html.crm-dark .overflow-hidden.rounded-full.bg-slate-100 {
  background: #1e293b !important;
}

/* --- Leady --- */
html.crm-dark .deal-body,
html.crm-dark .deal-body-extra,
html.crm-dark .deal-checklist-mount {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
html.crm-dark .deal-extra-block > summary,
html.crm-dark .deal-extra-summary {
  color: #f1f5f9 !important;
}
html.crm-dark .comments-list,
html.crm-dark .autenti-form {
  background: var(--surface-3) !important;
  border-color: var(--line) !important;
  color: #e2e8f0 !important;
}
html.crm-dark .comment-handlowiec {
  background: rgba(59, 130, 246, 0.15) !important;
  border-left-color: #60a5fa !important;
  color: #e2e8f0 !important;
}
html.crm-dark .comment-admin {
  background: rgba(148, 163, 184, 0.12) !important;
  border-left-color: #94a3b8 !important;
  color: #e2e8f0 !important;
}
html.crm-dark .comment-reply {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(251, 191, 36, 0.45) !important;
  color: #fde68a !important;
}
html.crm-dark .deal-meta-ankieta,
html.crm-dark .deal-meta-check.is-warn {
  color: #fbbf24 !important;
}
html.crm-dark .deal-meta-check.is-ok {
  color: #6BB8F0 !important;
}
html.crm-dark .deal-jump-link,
html.crm-dark .deal-next-step {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: #e2e8f0 !important;
}
html.crm-dark .deal-next-step {
  border-color: rgba(45, 212, 191, 0.35) !important;
  background: linear-gradient(135deg, rgba(0, 171, 53, 0.25), var(--surface-2)) !important;
}
html.crm-dark .saved-filter-apply,
html.crm-dark .tools-tab {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: #f1f5f9 !important;
}
html.crm-dark .tools-tab:hover,
html.crm-dark .saved-filter-apply:hover {
  background: #243247 !important;
}
html.crm-dark .tools-tab.is-active,
html.crm-dark .tools-tab[aria-current="page"] {
  background: #00AB35 !important;
  border-color: #7EB8E8 !important;
  color: #fff !important;
}
html.crm-dark .deals-sidebar,
html.crm-dark aside .crm-card {
  background: var(--surface) !important;
}

/* Checklista */
html.crm-dark .stage-section,
html.crm-dark .stage-section--open {
  background: var(--surface-3) !important;
  border-color: var(--line) !important;
}
html.crm-dark .stage-section--done {
  background: #0B1B2E !important;
  border-color: #7EB8E8 !important;
}
html.crm-dark .stage-section--locked {
  background: #111827 !important;
  border-color: #374151 !important;
  opacity: 1;
}
html.crm-dark .stage-section-title { color: #cbd5e1 !important; }
html.crm-dark .stage-lock-hint { color: #94a3b8 !important; }
html.crm-dark .stage-badge--locked {
  background: #1f2937 !important;
  color: #d1d5db !important;
}
html.crm-dark .stage-badge--ok {
  background: #065f46 !important;
  color: #a7f3d0 !important;
}
html.crm-dark .stage-check-row {
  background: var(--surface-3) !important;
  border-color: var(--line) !important;
}
html.crm-dark .stage-check-row:hover {
  background: var(--surface-2) !important;
  border-color: #3d4f68 !important;
}
html.crm-dark .stage-check-label {
  color: #f1f5f9 !important;
  font-weight: 600;
}
html.crm-dark .stage-check-row.is-checked {
  background: #00AB35 !important;
  border-color: #7EB8E8 !important;
}
html.crm-dark .stage-check-row.is-checked .stage-check-label {
  color: #ffffff !important;
  font-weight: 700;
}
html.crm-dark .stage-check-row.is-ankieta-row:not(.is-checked) {
  background: #422006 !important;
  border-color: #f59e0b !important;
}
html.crm-dark .stage-check-row.is-ankieta-row:not(.is-checked) .stage-check-label {
  color: #fde68a !important;
}
html.crm-dark .stage-check-row.is-ankieta-row:hover {
  background: #78350f !important;
  border-color: #fbbf24 !important;
}
html.crm-dark .stage-locked .stage-check-row,
html.crm-dark .stage-locked .stage-check-row:hover {
  background: #111827 !important;
  border-color: #374151 !important;
  opacity: 0.75;
}
html.crm-dark .stage-locked .stage-check-label { color: #9ca3af !important; }
html.crm-dark .stage-done-badge {
  background: #065f46 !important;
  color: #a7f3d0 !important;
}
html.crm-dark .deal-checkbox {
  border-color: #64748b !important;
  accent-color: #7EB8E8;
}
html.crm-dark .stage-filter-chip {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
html.crm-dark .stage-filter-chip .chip-title { color: #f1f5f9 !important; }
html.crm-dark .stage-filter-chip .chip-sub { color: var(--muted) !important; }
html.crm-dark .stage-filter-chip.active,
html.crm-dark .stage-filter-chip.active:hover {
  background: #00AB35 !important;
  border-color: #7EB8E8 !important;
  color: #fff !important;
}
html.crm-dark .stage-filter-chip.active .chip-title,
html.crm-dark .stage-filter-chip.active .chip-sub {
  color: #fff !important;
}
html.crm-dark .stage-info-btn {
  background: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

/* --- Modale: deal / QS / stage-info / news --- */
html.crm-dark .deal-modal-dialog,
html.crm-dark .deal-modal-header,
html.crm-dark .qs-dialog,
html.crm-dark .stage-info-card,
html.crm-dark .news-popup-card,
html.crm-dark [id$="-modal"] .crm-card {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line);
}
html.crm-dark .deal-modal-header,
html.crm-dark .qs-header {
  border-bottom-color: var(--line) !important;
  background: var(--surface) !important;
}
html.crm-dark .deal-modal-title,
html.crm-dark .qs-title,
html.crm-dark #stage-info-title,
html.crm-dark #news-popup-title {
  color: #f8fafc !important;
}
html.crm-dark #news-popup-body {
  color: #cbd5e1 !important;
}
html.crm-dark .text-blue-600 {
  color: #60a5fa !important;
}
html.crm-dark .deal-modal-body,
html.crm-dark .qs-body,
html.crm-dark .stage-info-body {
  color: #cbd5e1 !important;
}
html.crm-dark .deal-info-meta-item {
  background: var(--surface-3) !important;
  border-color: var(--line) !important;
}
html.crm-dark .deal-info-label { color: #94a3b8 !important; }
html.crm-dark .deal-info-value { color: #f1f5f9 !important; }
html.crm-dark .qs-kicker { color: #6BB8F0 !important; }
html.crm-dark .qs-close,
html.crm-dark .qs-step,
html.crm-dark .qs-chip {
  background: var(--surface-2) !important;
  color: #e2e8f0 !important;
  border-color: var(--line) !important;
}
html.crm-dark .qs-close:hover {
  background: #243247 !important;
  color: #fff !important;
}
html.crm-dark .qs-footer {
  background: var(--surface) !important;
  border-top-color: var(--line) !important;
}
html.crm-dark .crm-pwa-banner,
html.crm-dark .crm-offline-banner {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
html.crm-dark .crm-pwa-banner-text { color: #f1f5f9 !important; }

/* --- Ankieta (nadpisuje crm.css / ankieta.css) --- */
html.crm-dark .ankieta-container,
html.crm-dark .ankieta-header,
html.crm-dark .progress-container,
html.crm-dark .ankieta-nav-bar,
html.crm-dark .ankieta-scroll {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
html.crm-dark .ankieta-title { color: #f8fafc !important; }
html.crm-dark .ankieta-close {
  background: var(--surface-2) !important;
  color: #e2e8f0 !important;
}
html.crm-dark .progress-bar { background: #1e293b !important; }
html.crm-dark .step-indicator {
  background: var(--surface-2) !important;
  color: #94a3b8 !important;
  border-color: var(--line) !important;
}
html.crm-dark .step-indicator.active,
html.crm-dark .step-indicator.done {
  background: #00AB35 !important;
  color: #fff !important;
}
html.crm-dark .ankieta-step-label,
html.crm-dark .ankieta-nav-hint,
html.crm-dark #ankieta-form label,
html.crm-dark #ankieta-form .form-group,
html.crm-dark #ankieta-form p {
  color: #cbd5e1 !important;
}
html.crm-dark #ankieta-form input,
html.crm-dark #ankieta-form select,
html.crm-dark #ankieta-form textarea {
  background: var(--surface-3) !important;
  color: #f1f5f9 !important;
  border-color: var(--line) !important;
}
html.crm-dark #b24-form-frame {
  background: var(--surface) !important;
}

/* --- Powiadomienia / profil / admin --- */
html.crm-dark .notif-day-head {
  background: var(--surface-3) !important;
  color: #94a3b8 !important;
  border-bottom-color: var(--line) !important;
}
html.crm-dark .users-filter-label {
  color: #94a3b8 !important;
}
html.crm-dark .program-form-option {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: #e2e8f0 !important;
}
html.crm-dark .program-form-option:has(input:checked) {
  background: rgba(45, 212, 191, 0.12) !important;
  border-color: #7EB8E8 !important;
}
html.crm-dark .crm-skel-line {
  background: #1e293b !important;
}

/* Nav aktywny / nieaktywny - nie psuj bia?ego tekstu na hub-ink */
html.crm-dark a.bg-hub-ink,
html.crm-dark .bg-hub-ink {
  background-color: #00AB35 !important;
  color: #fff !important;
}
html.crm-dark a.bg-hub-ink .bg-white\/15,
html.crm-dark .bg-hub-ink .bg-white\/15 {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

html.crm-dark .deal-contact-row,
html.crm-dark .deal-contact-row a {
  color: #94a3b8 !important;
}
html.crm-dark .deal-contact-row a:hover {
  color: #6BB8F0 !important;
}
html.crm-dark .crm-btn-ghost.is-active {
  background: #00AB35 !important;
  border-color: #7EB8E8 !important;
  color: #fff !important;
}

/* Disabled inputs - czytelne */
html.crm-dark input:disabled,
html.crm-dark select:disabled,
html.crm-dark textarea:disabled {
  opacity: 0.75;
  color: #94a3b8 !important;
  background: #111827 !important;
}

@media (max-width: 640px) {
  .deal-card { padding: 0.75rem !important; }
  .deal-jump { gap: 0.35rem; }
  .deal-jump-link { font-size: 0.75rem; padding: 0.4rem 0.65rem; }
  #btn-ankieta, .crm-btn-primary { min-height: 2.75rem; }
}




/* ===== Brand palette overrides (zielony primary, niebieski akcent) ===== */
.bg-hub { background-color: #00AB35 !important; }
.bg-hub-ink { background-color: #00AB35 !important; }
.bg-hub-soft { background-color: #E8F8ED !important; }
.bg-hub-soft\/80 { background-color: rgba(232, 248, 237, 0.8) !important; }
.text-hub { color: #00AB35 !important; }
.text-hub-dark { color: #007A26 !important; }
.text-hub-ink { color: #0B1B2E !important; }
.border-hub-ink { border-color: #00AB35 !important; }
.hover\:text-hub-ink:hover { color: #00AB35 !important; }
.hover\:decoration-hub:hover { text-decoration-color: #00AB35 !important; }

.crm-btn-accent,
.crm-accent-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border-radius: 0.85rem;
  background: #005AA9 !important;
  border: 1px solid #005AA9 !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none !important;
  box-shadow: none;
}
.crm-btn-accent:hover { background: #004A8F !important; border-color: #004A8F !important; color: #fff !important; }
.crm-accent-text { color: #005AA9 !important; }
a.crm-link-accent {
  color: #005AA9;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.crm-link-accent:hover { color: #004A8F; }

/* Focus rings = niebieski akcent (a11y + brand) */
:focus-visible {
  outline: 2px solid var(--accent, #005AA9);
  outline-offset: 2px;
}
.crm-btn-primary:focus-visible,
.crm-btn-accent:focus-visible,
.bg-hub-ink:focus-visible {
  outline-color: #005AA9;
}

.crm-btn-success {
  background: #00AB35 !important;
  border-color: #00AB35 !important;
  color: #fff !important;
}
.crm-btn-success:hover { background: #00962E !important; }

.bg-emerald-50 { background-color: #E8F8ED !important; }
.bg-emerald-100 { background-color: #C8F0D4 !important; }
.text-emerald-600,
.text-emerald-700,
.text-emerald-800 { color: #007A26 !important; }
.border-emerald-200 { border-color: #9AD9AE !important; }
.group-hover\:bg-teal-100:hover,
.group:hover .group-hover\:bg-teal-100 { background-color: #D6F5DF !important; }
html.crm-dark .group-hover\:bg-teal-100:hover,
html.crm-dark .group:hover .group-hover\:bg-teal-100 {
  background-color: rgba(0, 171, 53, 0.25) !important;
}
html.crm-dark .bg-emerald-50,
html.crm-dark .bg-emerald-100 {
  background-color: #005C1C !important;
}
html.crm-dark .text-emerald-600,
html.crm-dark .text-emerald-700,
html.crm-dark .text-emerald-800 { color: #6FDD8F !important; }

/* ?? Deal file grid with thumbnails ?? */
.deal-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .625rem;
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
}
.deal-file-item { margin: 0; }
.deal-file-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .375rem;
  border-radius: .625rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .5rem .375rem;
  text-decoration: none;
  transition: background .12s, border-color .12s;
  overflow: hidden;
}
.deal-file-link:hover { background: #eef2ff; border-color: #a5b4fc; }
.deal-file-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: .375rem;
  flex-shrink: 0;
}
.deal-file-icon {
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}
.deal-file-name {
  font-size: .65rem;
  color: #475569;
  text-align: center;
  line-height: 1.2;
  word-break: break-all;
  max-width: 80px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===================================================================
   MODERNIZACJA 2026 — warstwa estetyczna, nie nadpisuje designu
   =================================================================== */

/* Lepsze karty — głębszy cień, płynniejszy hover */
.crm-card {
  border-radius: 1rem;
  border: 1px solid rgba(213,222,232,.8);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 8px 24px rgba(11,18,32,.06);
  transition: border-color .18s, box-shadow .2s, transform .18s;
}
.crm-card:hover {
  border-color: rgba(0,171,53,.22);
  box-shadow: 0 1px 2px rgba(11,18,32,.03), 0 12px 30px rgba(11,18,32,.09);
  transform: translateY(-1px);
}

/* Primary button — wyraźniejszy, więcej powietrza */
.crm-btn-primary {
  min-height: 2.5rem;
  padding-left: 1.125rem;
  padding-right: 1.125rem;
  border-radius: .75rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
  background: linear-gradient(155deg, #2BC24E 0%, #00AB35 65%);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 2px 8px rgba(0,171,53,.22);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.crm-btn-primary:hover {
  background: linear-gradient(155deg, #00AB35 0%, #007A26 72%);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 14px rgba(0,171,53,.28);
  transform: translateY(-1px);
}
.crm-btn-primary:active { transform: translateY(0); }

/* Ghost button — czystszy, nowoczesny */
.crm-btn-ghost {
  min-height: 2.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: .75rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid rgba(213,222,232,.9);
  background: rgba(255,255,255,.7);
  color: #334155;
  transition: border-color .15s, background .15s, color .15s;
}
.crm-btn-ghost:hover {
  border-color: rgba(0,171,53,.35);
  background: rgba(0,171,53,.05);
  color: #00AB35;
}

/* Inputy — focus ring w zielonym, bez browser default */
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='color']),
select, textarea, .crm-input {
  border-radius: .625rem;
  border: 1px solid #d5dee8;
  background: #fff;
  color: #0b1220;
  font-size: .875rem;
  padding: .5rem .75rem;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='color']):focus,
select:focus, textarea:focus, .crm-input:focus {
  border-color: #00AB35;
  box-shadow: 0 0 0 3px rgba(0,171,53,.14);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }

/* Sekcje — wyraźny nagłówek z lewą linią */
.crm-section-title {
  position: relative;
  padding-left: .75rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
}
.crm-section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 3px;
  border-radius: 9999px;
  background: #00AB35;
}

/* KPI strip — mniejszy gap, lepszy hover */
.crm-kpi {
  border-radius: .875rem;
  border: 1px solid rgba(213,222,232,.8);
  background: rgba(255,255,255,.95);
  box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 4px 12px rgba(11,18,32,.05);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  padding: 1rem 1.25rem;
}
.crm-kpi:hover {
  border-color: rgba(0,171,53,.3);
  box-shadow: 0 2px 4px rgba(11,18,32,.04), 0 8px 20px rgba(11,18,32,.08);
  transform: translateY(-1px);
}
.kpi-value {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: #0b1220;
}
.kpi-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .25rem;
}
.kpi-hint {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: .25rem;
}

/* Tabele — lżejsze, czytelniejsze */
table { border-collapse: collapse; width: 100%; }
thead tr { border-bottom: 2px solid #e2e8f0; }
tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
tbody tr:hover { background: rgba(0,171,53,.03); }
thead th {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  padding: .625rem .875rem;
}
tbody td { padding: .75rem .875rem; font-size: .875rem; color: #334155; vertical-align: middle; }

/* Alert / info boxes */
.crm-alert {
  border-radius: .75rem;
  padding: .875rem 1rem;
  font-size: .875rem;
  border-left: 3px solid;
}

/* Scrollbar — subtelny */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.6); }

/* Dark mode ulepszenia */
html.crm-dark .crm-card {
  background: #152033 !important;
  border-color: #1e3448 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25) !important;
}
html.crm-dark .crm-card:hover {
  border-color: rgba(0,171,53,.3) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 12px 30px rgba(0,0,0,.3) !important;
}
html.crm-dark .crm-btn-ghost {
  background: #1a2535 !important;
  border-color: #253448 !important;
  color: #cbd5e1 !important;
}
html.crm-dark .crm-btn-ghost:hover {
  border-color: rgba(0,171,53,.4) !important;
  background: rgba(0,171,53,.08) !important;
  color: #4ade80 !important;
}
html.crm-dark .crm-kpi {
  background: #152033 !important;
  border-color: #1e3448 !important;
}
html.crm-dark .kpi-value { color: #f1f5f9 !important; }
html.crm-dark thead tr { border-color: #1e3448; }
html.crm-dark tbody tr { border-color: #152033; }
html.crm-dark tbody tr:hover { background: rgba(0,171,53,.04); }
html.crm-dark thead th { color: #475569; }
html.crm-dark tbody td { color: #94a3b8; }

/* ===================================================================
   NOWOCZESNE SELECT — zastępuje domyślny wygląd przeglądarki
   =================================================================== */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2.25rem !important;
  cursor: pointer;
}
select:focus {
  border-color: #00AB35 !important;
  box-shadow: 0 0 0 3px rgba(0,171,53,.14) !important;
  outline: none;
}

/* Multi-select bez strzałki */
select[multiple] {
  background-image: none;
  padding-right: .75rem !important;
}

/* Disabled */
select:disabled {
  opacity: .6;
  cursor: not-allowed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Dark mode select */
html.crm-dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* �� Public lead form (embed + /f
/* Public lead form (embed + /f pages) */
.crm-embed-body {
  margin: 0;
  min-height: 0;
  background: transparent;
  overflow-x: hidden;
}
.crm-embed-main {
  padding: 0;
  margin: 0;
}
.crm-public-wrap {
  margin: 0 auto;
  width: 100%;
  max-width: 36rem;
  min-width: 0;
  box-sizing: border-box;
}
.crm-public-wrap--embed {
  max-width: 28rem;
  padding: 0;
}
.crm-public-form {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.95rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.25rem;
  padding: 1.15rem;
}
.crm-public-form--embed {
  margin-top: 0;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
}
.crm-public-form__head { margin: 0 0 0.15rem; }
.crm-public-form__brand {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00ab35;
}
.crm-public-form__title {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #0b1220;
}
.crm-public-form__lead {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #64748b;
}
.crm-public-field {
  display: block;
  margin: 0;
  min-width: 0;
}
.crm-public-field__label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: #334155;
}
.crm-public-form .crm-input,
.crm-public-form input.crm-input,
.crm-public-form textarea.crm-input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1.35;
}
.crm-public-field__textarea {
  min-height: 5rem;
  resize: vertical;
}
.crm-public-wrap--biz {
  max-width: 32rem;
}
.crm-public-form--biz {
  gap: 1.5rem;
  padding: 1.45rem 1.4rem 1.55rem;
}
.crm-public-section {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.crm-public-section__title {
  margin: 0 0 0.85rem;
  padding: 0 0 0.55rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #0b1220;
  border-bottom: 2px solid #e2e8f0;
}
.crm-public-section--optional .crm-public-section__title {
  margin-top: 0.15rem;
}
.crm-public-section__hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #64748b;
}
.crm-public-section__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.crm-public-field--solo {
  margin: 0;
}
.crm-public-phone {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-radius: 0.8rem;
  background: #fff;
  overflow: hidden;
}
.crm-public-phone__prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.crm-public-form .crm-public-phone__input.crm-input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-height: 3rem;
}
.crm-public-phone:focus-within {
  border-color: #00ab35;
  box-shadow: 0 0 0 3px rgba(0, 171, 53, 0.14);
}
.crm-public-req {
  color: #ef4444;
  font-weight: 700;
}
.crm-public-form--biz .crm-public-rodo {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
  gap: 0.65rem;
}
.crm-public-submit--biz {
  margin-top: 0.2rem;
  min-height: 3rem;
  font-size: 1rem;
}
.crm-public-form--biz .crm-input {
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.8rem;
  border-color: #dbe3ee;
}
.crm-public-form--biz .crm-public-field__textarea {
  min-height: 6.5rem;
}
.crm-public-rodo {
  display: flex !important;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #475569;
}
.crm-public-rodo input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: #00ab35;
}
.crm-public-rodo__link {
  font-weight: 700;
  color: #00ab35;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.crm-public-submit {
  display: inline-flex !important;
  width: 100% !important;
  min-height: 2.85rem;
  margin-top: 0.15rem;
}
.crm-public-err {
  margin: 0;
  border-radius: 0.75rem;
  background: #fef2f2;
  padding: 0.7rem 0.85rem;
  font-size: 0.8125rem;
  color: #b91c1c;
}
.crm-public-ok {
  margin: 0 0 1.5rem;
  border-radius: 1rem;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  padding: 1.25rem 1.1rem;
  text-align: center;
}
.crm-public-ok:not(.hidden) + .crm-public-form {
  margin-top: 0.15rem;
}
.crm-public-form.hidden {
  display: none !important;
}
.crm-public-ok__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #064e3b;
}
.crm-public-ok__text {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  color: #065f46;
}
.crm-hp {
  position: absolute !important;
  left: -10000px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.crm-hp input,
.crm-hp label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 0 !important;
}
@media (min-width: 480px) {
  .crm-public-form--embed { padding: 1.15rem 1.25rem 1.3rem; }
  .crm-public-form__title { font-size: 1.35rem; }
  .crm-public-form .crm-input { font-size: 0.9375rem; }
}
@media (max-width: 379px) {
  .crm-public-form--embed { padding: 0.85rem 0.8rem 1rem; border-radius: 0.85rem; }
  .crm-public-form { gap: 0.8rem; }
  .crm-public-form__title { font-size: 1.125rem; }
}
