html, body {
  height: 100%;
}

body.crm-page-body {
  overflow: auto;
}

.crm-page-shell {
  min-height: 100vh;
  padding: 20px;
  display: grid;
  gap: 18px;
}

.crm-page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 28px;
}

.crm-brand-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
}

.crm-brand-logo {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(115,214,79,.22));
}

.crm-page-title {
  font-size: 34px;
  font-weight: 800;
}

.crm-top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-workspace-shell {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
}

.crm-list-pane,
.crm-editor-pane {
  border-radius: 28px;
  min-height: 0;
}

.crm-list-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crm-pane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.crm-pane-head h2,
.crm-editor-head h2 {
  margin: 0;
  font-size: 26px;
}


/* Patch 5 — kompaktowy pulpit kontroli refinansowania. */
.crm-refinance-dashboard {
  display: grid;
  gap: 6px;
}

.crm-refinance-filter {
  --crm-refinance-color: 148, 163, 184;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(var(--crm-refinance-color), .28);
  border-radius: 14px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #edf5ff;
  background:
    radial-gradient(circle at 100% 0, rgba(var(--crm-refinance-color), .10), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
  box-shadow: 0 0 0 1px rgba(255,255,255,.018) inset;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.crm-refinance-filter.is-base { --crm-refinance-color: 148, 163, 184; }
.crm-refinance-filter.is-safe { --crm-refinance-color: 255, 100, 120; }
.crm-refinance-filter.is-potential { --crm-refinance-color: 245, 200, 75; }
.crm-refinance-filter.is-current { --crm-refinance-color: 99, 217, 139; }

.crm-refinance-filter:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--crm-refinance-color), .48);
  background:
    radial-gradient(circle at 100% 0, rgba(var(--crm-refinance-color), .15), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
}

.crm-refinance-filter.active {
  border-color: rgba(var(--crm-refinance-color), .72);
  background:
    radial-gradient(circle at 100% 0, rgba(var(--crm-refinance-color), .22), transparent 50%),
    linear-gradient(135deg, rgba(var(--crm-refinance-color), .14), rgba(255,255,255,.025));
  box-shadow:
    0 0 0 1px rgba(var(--crm-refinance-color), .10) inset,
    0 0 18px rgba(var(--crm-refinance-color), .11);
}

.crm-refinance-filter-label {
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.crm-refinance-filter-count {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: rgb(var(--crm-refinance-color));
  background: rgba(var(--crm-refinance-color), .10);
  border: 1px solid rgba(var(--crm-refinance-color), .30);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.crm-refinance-filter.active .crm-refinance-filter-count {
  color: #071018;
  background: rgb(var(--crm-refinance-color));
  border-color: rgb(var(--crm-refinance-color));
  box-shadow: 0 0 12px rgba(var(--crm-refinance-color), .25);
}

.crm-filters {
  display: grid;
  gap: 10px;
}

.crm-list-scroll {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.crm-record-tile {
  --crm-status-color: #64748b;
  width: 100%;
  position: relative;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  color: var(--text);
  border-radius: 20px;
  padding: 14px;
  transition: .22s ease;
}

/* Dyskretna szyna statusu: nie zmienia wymiarów kafla ani układu listy. */
.crm-record-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--crm-status-color);
  box-shadow: 0 0 10px var(--crm-status-color);
  opacity: .72;
  pointer-events: none;
}

.crm-record-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--crm-status-color);
  box-shadow: 0 0 0 2px rgba(255,255,255,.025), 0 0 8px var(--crm-status-color);
}

.crm-record-tile.crm-status-new,
.crm-record-tile.crm-status-neutral {
  --crm-status-color: #64748b;
}

.crm-record-tile.crm-status-meeting {
  --crm-status-color: #8f86ff;
}

/* Prawidłowy tok procesu: coraz mocniejszy błękit, bez bursztynowego alarmu. */
.crm-record-tile.crm-status-analysis {
  --crm-status-color: #71c8ff;
}

/* Aktywny etap poszukiwania: spokojny błękit z lekkim fioletem. */
.crm-record-tile.crm-status-property-search {
  --crm-status-color: #7c9fff;
}

.crm-record-tile.crm-status-waiting {
  --crm-status-color: #4fa6f7;
}

.crm-record-tile.crm-status-application {
  --crm-status-color: #7489ff;
}

/* Decyzja pozytywna: wyraźne „prawie sukces”, ale bez używania zieleni finału. */
.crm-record-tile.crm-status-positive {
  --crm-status-color: #43dfc1;
  border-color: rgba(67,223,193,.2);
  background:
    radial-gradient(circle at 100% 0, rgba(67,223,193,.10), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
}

.crm-record-tile.crm-status-positive::before {
  width: 4px;
  opacity: .95;
  box-shadow: 0 0 17px var(--crm-status-color);
}

.crm-record-tile.crm-status-positive .crm-record-title {
  color: #bcfff1;
}

.crm-record-tile.crm-status-success {
  --crm-status-color: #63d98b;
}

.crm-record-tile.crm-status-success .crm-record-title {
  color: #c5f7d4;
}

.crm-record-tile.crm-status-negative {
  --crm-status-color: #ff6478;
}

.crm-record-tile.crm-status-negative .crm-record-title {
  color: #ffc2cb;
}

.crm-record-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(86,184,255,.3);
}

.crm-record-tile.active {
  border-color: rgba(86,184,255,.48);
  background: linear-gradient(135deg, rgba(45,127,255,.18), rgba(115,214,79,.10));
  box-shadow: 0 0 0 1px rgba(86,184,255,.12) inset;
}

.crm-record-tile strong,
.crm-person-card strong {
  display: block;
  font-size: 16px;
}

.crm-record-client {
  color: #f2f7ff;
  font-size: 17px !important;
  line-height: 1.28;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}

.crm-record-title {
  display: block;
  color: #e7eef9;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.38;
}

.crm-record-tile small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.48;
}

.crm-record-details > span,
.crm-tile-finalization > span {
  display: block;
}

.crm-record-line {
  margin-bottom: 7px;
}

.crm-record-snapshots-label {
  margin-top: 8px;
}

.crm-record-updated {
  margin-top: 2px;
  color: #8798b1;
  font-size: 12px;
}

.crm-tile-finalization {
  margin: 8px 0 7px;
  padding: 9px 10px;
  border: 1px solid rgba(99,217,139,.18);
  border-radius: 13px;
  background:
    radial-gradient(circle at 0 0, rgba(99,217,139,.08), transparent 52%),
    rgba(255,255,255,.024);
  color: #cbd8e9;
}

.crm-tile-finalization.is-empty {
  border-style: dashed;
  color: #91a2b8;
}

.crm-tile-finalization-label {
  margin-bottom: 3px;
  color: #aeeec4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.crm-tile-finalization-line {
  line-height: 1.42;
}

.crm-tile-finalization-line.is-primary {
  color: #edf8f1;
  font-weight: 700;
}

.crm-tile-finalization-line.is-reminder {
  color: #c7ddff;
}

.crm-editor-pane {
  overflow: auto;
}

.crm-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.crm-editor-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.crm-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-editor-stack {
  display: grid;
  gap: 14px;
}

.crm-section {
  border-radius: 22px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}

.crm-section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-form-grid .full {
  grid-column: 1 / -1;
}

.crm-person-card {
  display: grid;
  gap: 12px;
}

.crm-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-empty-box {
  border-radius: 20px;
  padding: 18px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
  color: #d7e3f5;
  line-height: 1.65;
}

.danger-btn {
  border-color: rgba(255,122,122,.35) !important;
  color: #ffd2d2 !important;
}

.danger-btn:hover {
  background: rgba(255,122,122,.12) !important;
}



/* AI-Decide — status i przycisk w kokpicie CRM */
.crm-ai-decide-btn {
  background: linear-gradient(135deg, #8f7cff, #56b8ff) !important;
  color: #07111f !important;
  box-shadow: 0 12px 34px rgba(86, 184, 255, .18), 0 0 0 1px rgba(255,255,255,.06) inset;
}

.crm-ai-decide-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 42px rgba(143, 124, 255, .22), 0 0 0 1px rgba(255,255,255,.08) inset;
}

.crm-ai-decide-btn.is-disabled,
.crm-ai-decide-btn[aria-disabled="true"] {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.045)) !important;
  color: rgba(234, 241, 255, .62) !important;
  border-color: rgba(255,255,255,.10) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: .72;
}

.crm-ai-decide-btn.is-disabled:hover,
.crm-ai-decide-btn[aria-disabled="true"]:hover {
  transform: none;
}

.crm-system-snapshots-line {
  color: #b8c4d9;
  white-space: nowrap;
}

.crm-ai-status-line {
  color: #b8c4d9;
}

.crm-ai-status-line.is-ready {
  color: #bfffd1;
}


/* CRM toolbar — grupy akcji po dodaniu AI Decide */
.crm-editor-actions-grouped {
  align-items: center;
  gap: 12px;
}

.crm-action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  border-radius: 22px;
  background: rgba(255,255,255,.022);
  border: 1px solid rgba(255,255,255,.045);
}

.crm-action-group-save {
  background: transparent;
  border-color: transparent;
  margin-left: 2px;
}

.crm-action-basic {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04)) !important;
  color: #eaf1ff !important;
  border-color: rgba(130,155,190,.22) !important;
  box-shadow: none !important;
}

.crm-action-basic:hover {
  background: linear-gradient(180deg, rgba(86,184,255,.12), rgba(255,255,255,.055)) !important;
  border-color: rgba(86,184,255,.28) !important;
}

.crm-flow-btn,
.crm-ai-decide-btn:not(.is-disabled):not([aria-disabled="true"]) {
  background: linear-gradient(135deg, #76e464 0%, #4fbcff 100%) !important;
  color: #06111e !important;
  border-color: rgba(145,255,174,.26) !important;
  box-shadow: 0 12px 34px rgba(86,184,255,.15), 0 0 0 1px rgba(255,255,255,.07) inset;
}

.crm-flow-btn:hover,
.crm-ai-decide-btn:not(.is-disabled):not([aria-disabled="true"]):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 42px rgba(118,228,100,.18), 0 0 0 1px rgba(255,255,255,.10) inset;
}

.crm-action-tools {
  background: linear-gradient(180deg, rgba(255,132,101,.14), rgba(255,255,255,.045)) !important;
  color: #ffd8cf !important;
  border-color: rgba(255,132,101,.26) !important;
  box-shadow: none !important;
}

.crm-action-tools:hover {
  background: linear-gradient(180deg, rgba(255,132,101,.20), rgba(255,255,255,.06)) !important;
  border-color: rgba(255,132,101,.38) !important;
}

.crm-action-danger {
  background: linear-gradient(180deg, rgba(255,92,92,.16), rgba(255,255,255,.045)) !important;
  color: #ffd0d0 !important;
  border-color: rgba(255,92,92,.36) !important;
  box-shadow: none !important;
}

.crm-action-danger:hover {
  background: linear-gradient(180deg, rgba(255,92,92,.24), rgba(255,255,255,.06)) !important;
  border-color: rgba(255,92,92,.48) !important;
}

.crm-save-final-btn {
  background: linear-gradient(135deg, #2d7fff 0%, #56d2ff 100%) !important;
  color: #06111e !important;
  border-color: rgba(86,210,255,.38) !important;
  box-shadow: 0 14px 38px rgba(45,127,255,.22), 0 0 0 1px rgba(255,255,255,.08) inset !important;
  min-width: 142px;
}

.crm-save-final-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 48px rgba(86,210,255,.26), 0 0 0 1px rgba(255,255,255,.12) inset !important;
}

@media (max-width: 760px) {
  .crm-action-group {
    flex: 1 1 100%;
    justify-content: stretch;
  }

  .crm-action-group > button {
    flex: 1 1 auto;
  }
}

@media (max-width: 1360px) {
  .crm-workspace-shell {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .crm-page-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .crm-workspace-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .crm-list-scroll,
  .crm-editor-pane {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .crm-page-shell {
    padding: 14px;
  }

  .crm-page-title {
    font-size: 28px;
  }

  .crm-brand-wrap {
    align-items: flex-start;
  }

  .crm-brand-logo {
    width: 64px;
    height: 64px;
  }

  .crm-form-grid,
  .crm-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Finalizacja kredytu — panel pojawia się wyłącznie dla statusu „Uruchomiony”. */
.crm-finalization-panel {
  margin-top: 2px;
  padding: 17px;
  border: 1px solid rgba(99,217,139,.24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0 0, rgba(99,217,139,.10), transparent 34%),
    linear-gradient(135deg, rgba(45,127,255,.07), rgba(99,217,139,.045));
  box-shadow: 0 0 0 1px rgba(255,255,255,.025) inset;
}

.crm-finalization-panel.is-hidden,
#crmFixedRateEndField.is-hidden {
  display: none !important;
}

.crm-finalization-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.crm-finalization-title {
  color: #eafff0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.01em;
}

.crm-finalization-subtitle {
  margin-top: 3px;
  color: #97acbf;
  font-size: 12px;
}

.crm-finalization-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(99,217,139,.25);
  border-radius: 999px;
  background: rgba(99,217,139,.10);
  color: #bff7d1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-finalization-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.crm-finalization-panel .field-label {
  display: block;
  margin-bottom: 7px;
  color: #bcd0e4;
  font-size: 12px;
}

.crm-finalization-panel input[type='date'] {
  color-scheme: dark;
}

.crm-input-with-unit {
  position: relative;
}

.crm-input-with-unit .text-input {
  padding-right: 46px;
}

.crm-input-with-unit .crm-field-unit.is-wide + .text-input,
.crm-input-with-unit .text-input:has(+ .crm-field-unit.is-wide) {
  padding-right: 62px;
}

.crm-field-unit {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #8295ad;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.crm-refinance-reminder {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.45fr);
  gap: 16px;
  align-items: end;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(113,200,255,.16);
  border-radius: 16px;
  background: rgba(8,18,31,.30);
}

.crm-reminder-copy strong,
.crm-reminder-copy span {
  display: block;
}

.crm-reminder-copy strong {
  color: #d9ecff;
  font-size: 13px;
}

.crm-reminder-copy span {
  margin-top: 4px;
  color: #8fa4ba;
  font-size: 11px;
  line-height: 1.45;
}

.crm-reminder-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 12px;
}

@media (max-width: 1250px) {
  .crm-finalization-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .crm-refinance-reminder {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .crm-finalization-grid,
  .crm-reminder-grid {
    grid-template-columns: 1fr;
  }
  .crm-finalization-head {
    align-items: center;
  }
}


/* Finalizacja v3 — czyste pola bez mikrosuwaków i szybka zmiana banku. */
.crm-finalization-panel input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.crm-finalization-panel input[type='number']::-webkit-inner-spin-button,
.crm-finalization-panel input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.crm-combobox-field {
  position: relative;
}

.crm-combobox-field .text-input {
  padding-right: 74px;
}

.crm-input-clear {
  position: absolute;
  right: 34px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: 1px solid rgba(151,172,191,.22);
  border-radius: 999px;
  background: rgba(8,18,31,.46);
  color: #aebfd0;
  font-size: 19px;
  line-height: 24px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.crm-input-clear:hover,
.crm-input-clear:focus-visible {
  border-color: rgba(113,200,255,.48);
  background: rgba(45,127,255,.14);
  color: #e7f5ff;
  outline: none;
}

.crm-input-clear:active {
  transform: translateY(-50%) scale(.94);
}

.crm-input-clear.is-hidden {
  display: none;
}

/* HipoFlow snapshots / restore */
.crm-snapshots-section {
  background: linear-gradient(135deg, rgba(45,127,255,.08), rgba(115,214,79,.045));
}

.crm-snapshots-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.crm-snapshots-list {
  display: grid;
  gap: 10px;
}

.crm-snapshot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
  border-radius: 18px;
  padding: 12px;
}

.crm-snapshot-copy strong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.crm-snapshot-copy small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.crm-snapshot-actions {
  display: flex;
  justify-content: flex-end;
}

.hipofaq-restore-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  z-index: 9999;
  border-radius: 20px;
  border: 1px solid rgba(86,184,255,.35);
  background: linear-gradient(135deg, rgba(13,22,37,.96), rgba(22,50,54,.96));
  box-shadow: 0 18px 54px rgba(0,0,0,.42), 0 0 34px rgba(86,184,255,.12);
  padding: 14px 16px;
  color: var(--text);
  animation: restoreToastIn .24s ease both;
}

.hipofaq-restore-toast strong {
  display: block;
  margin-bottom: 4px;
}

.hipofaq-restore-toast small {
  color: var(--muted);
  line-height: 1.45;
}

@keyframes restoreToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .crm-snapshot-row {
    grid-template-columns: 1fr;
  }

  .crm-snapshot-actions {
    justify-content: stretch;
  }

  .crm-snapshot-actions .primary-btn {
    width: 100%;
  }
}

/* CRM/FLOW separated notes */
.crm-note-block textarea.crm-auto-note {
  min-height: 76px;
  resize: none;
  line-height: 1.45;
  overflow-y: hidden;
}

.crm-flow-note-block textarea.crm-flow-note {
  background: linear-gradient(135deg, rgba(45,127,255,.07), rgba(115,214,79,.045));
  border-color: rgba(86,184,255,.16);
  color: #dcecff;
}

.crm-flow-note-block textarea.crm-flow-note:focus {
  transform: none;
}

.crm-note-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

/* v2.6 — więcej oddechu w panelu procesu i notatkach */
.crm-section.crm-process-section {
  padding: 22px 22px 20px;
}
.crm-process-section .crm-section-title {
  margin-bottom: 18px;
  font-size: 20px;
}
.crm-process-section .crm-form-grid {
  gap: 16px;
}
.crm-process-section .field-label,
.crm-note-block .field-label {
  display: block;
  margin-bottom: 8px;
}
.crm-note-block textarea {
  padding: 18px 20px;
  line-height: 1.55;
}
.crm-note-block {
  margin-top: 4px;
}


/* v2.7 — CRM: poprawione światło i finalne nazwy pól */
.crm-process-section .crm-section-title {
  letter-spacing: -.01em;
}
.crm-process-section .field-label,
.crm-note-block .field-label {
  padding-left: 2px;
}
.crm-note-block textarea {
  min-height: 86px;
}

/* v2.14 — ukrycie scrollbarów w notatkach CRM/FLOW przy zachowaniu responsywnej wysokości */
.crm-note-block textarea.crm-auto-note,
.crm-note-block textarea.crm-flow-note {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}
.crm-note-block textarea.crm-auto-note::-webkit-scrollbar,
.crm-note-block textarea.crm-flow-note::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.crm-note-block textarea.crm-auto-note {
  max-height: none;
}


/* v6.0 — spójność Migawki Flow z wydrukiem */
.crm-summary-grid .crm-summary-full {
  grid-column: 1 / -1;
}
.crm-summary-description {
  margin-top: 2px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(115,214,79,.20);
  background: linear-gradient(135deg, rgba(45,127,255,.055), rgba(115,214,79,.045));
}
.crm-summary-description .field-label {
  display: block;
  margin-bottom: 8px;
  color: #bcd2ee;
}
.crm-summary-description textarea.crm-auto-note {
  resize: none;
  overflow-y: hidden;
  line-height: 1.54;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.crm-summary-description textarea.crm-auto-note::-webkit-scrollbar { display: none; width: 0; height: 0; }


/* CRM — zapisany panel AI Decide */
.crm-ai-decide-panel {
  border-color: rgba(110,228,111,.18);
  background:
    radial-gradient(circle at top left, rgba(110,228,111,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.022));
}

.crm-ai-panel-head {
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}

.crm-ai-panel-head .crm-section-title {
  margin-bottom:4px;
}

.crm-ai-synthesis {
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);
  border-radius:18px;
  padding:12px 14px;
  color:#e9f4ff;
  line-height:1.55;
  margin-bottom:12px;
}

.crm-ai-groups {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.crm-ai-group {
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:12px;
  background:rgba(255,255,255,.035);
  min-width:0;
}

.crm-ai-group-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.crm-ai-group-head strong {
  font-size:13px;
  letter-spacing:.04em;
}

.crm-ai-group-head span {
  min-width:28px;
  height:28px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-weight:900;
  background:rgba(255,255,255,.06);
}

.crm-ai-group-body {
  color:#c9d6e8;
  font-size:13px;
  line-height:1.45;
}

.crm-ai-group.tak {
  border-color:rgba(110,228,111,.28);
  box-shadow:0 0 0 1px rgba(110,228,111,.05) inset;
}

.crm-ai-group.tak .crm-ai-group-head {
  color:#bfffd1;
}

.crm-ai-group.opcjonalnie {
  border-color:rgba(245,200,75,.30);
}

.crm-ai-group.opcjonalnie .crm-ai-group-head {
  color:#ffe39a;
}

.crm-ai-group.odrzucone {
  border-color:rgba(255,122,122,.28);
}

.crm-ai-group.odrzucone .crm-ai-group-head {
  color:#ffd2d2;
}

.crm-ai-extras {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}

.crm-ai-extra {
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:12px;
  background:rgba(255,255,255,.025);
}

.crm-ai-extra strong {
  display:block;
  margin-bottom:6px;
  color:#eaf5ff;
}

.crm-ai-extra ul {
  margin:0;
  padding-left:18px;
  color:#b8c4d9;
  line-height:1.55;
  font-size:13px;
}

@media (max-width: 1100px) {
  .crm-ai-groups,
  .crm-ai-extras {
    grid-template-columns:1fr;
  }
}

/* HipoFlow summary — nazwa odróżniona od listy migawek */
.crm-flow-summary-section {
  border-color: rgba(86, 184, 255, .12);
}
