/* CRM DEMO 5.4.310 — SPÓJNY WYGLĄD (ładowany jako ostatni arkusz).
   Zasady kolorów przycisków:
   • granatowy  = główna akcja w danym miejscu (np. „Termin”, „Zapisz”, „Wykonano”),
   • szary      = zwykła akcja,
   • złoty      = wyróżnienie marki w nagłówkach (np. „Nowa karta klienta”); w wierszach tabel i kartach
                  złoty jest stonowany, żeby nie konkurował z główną akcją,
   • czerwony   = usuwanie / nieodwracalne, zawsze oddzielone od reszty. */

:root {
  --ui-ink: #122033;
  --ui-muted: #64748b;
  --ui-line: #e3e8ef;
  --ui-gold: #d5a542;
  --ui-gold-ink: #7a5710;
  --ui-gold-soft: #fbf3df;
  --ui-gold-line: #eedcae;
  --ui-focus: 0 0 0 3px rgba(213, 165, 66, .45);
  --ui-radius: 12px;
}

/* ---------- Dostępność: widoczny fokus z klawiatury ---------- */
html.crm-ui-spojnosc :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none !important;
  box-shadow: var(--ui-focus) !important;
}

/* ---------- Ikony liniowe ---------- */
.ui-ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }

/* =========================================================
   1. MENU BOCZNE (komputer) — grupy, przewijanie, użytkownik na dole
   ========================================================= */
html.crm-ui-spojnosc .shell > aside.side.ui-side {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 16px 12px 12px !important;
  height: 100vh !important;
  height: 100dvh !important;
}
html.crm-mobile-device.crm-ui-spojnosc .shell > aside.side.ui-side { display: none !important; }
html.crm-ui-spojnosc .side.ui-side .app-brand { flex: none; padding: 2px 6px 10px !important; }
html.crm-ui-spojnosc .side.ui-side .app-brand .logo { height: 64px !important; }
html.crm-ui-spojnosc .side.ui-side > .nav-section-title { display: none !important; }
html.crm-ui-spojnosc .side.ui-side nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  margin: 0 -4px !important;
  padding: 0 4px 8px !important;
  scrollbar-width: thin;
  scrollbar-color: #ffffff22 transparent;
}
html.crm-ui-spojnosc .side.ui-side nav::-webkit-scrollbar { width: 6px; }
html.crm-ui-spojnosc .side.ui-side nav::-webkit-scrollbar-thumb { background: #ffffff22; border-radius: 6px; }
html.crm-ui-spojnosc .side.ui-side nav > .nav-section-title { display: none !important; }
html.crm-ui-spojnosc .side.ui-side .ui-nav-title {
  margin: 16px 12px 5px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7f8fa6;
  flex: none;
}
html.crm-ui-spojnosc .side.ui-side .ui-nav-title[data-ui-group-title="work"] { margin-top: 6px; }
html.crm-ui-spojnosc .side.ui-side nav > .nav {
  flex: none;
  min-height: 40px !important;
  padding: 8px 12px !important;
  gap: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  color: #b9c5d6 !important;
  position: relative;
}
html.crm-ui-spojnosc .side.ui-side nav > .nav:hover { background: #ffffff0f !important; color: #fff !important; }
html.crm-ui-spojnosc .side.ui-side nav > .nav.active {
  background: #ffffff14 !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--ui-gold) !important;
}
html.crm-ui-spojnosc .side.ui-side nav > .nav.active .nav-icon { color: var(--ui-gold); }
html.crm-ui-spojnosc .side.ui-side .nav-icon {
  width: 22px !important;
  min-width: 22px;
  height: 22px;
  display: inline-grid !important;
  place-items: center;
  font-size: 18px !important;
  color: #93a3b8;
}
html.crm-ui-spojnosc .side.ui-side .nav:hover .nav-icon { color: #fff; }
html.crm-ui-spojnosc .side.ui-side .nav-icon .ui-ico { width: 20px; height: 20px; }
html.crm-ui-spojnosc .side.ui-side .nav .messages-unread-badge { margin-left: auto !important; }
html.crm-ui-spojnosc .side.ui-side .salon-tablet-nav-btn.is-active { color: #fff !important; background: #16a34a26 !important; }
html.crm-ui-spojnosc .side.ui-side .side-user {
  position: static !important;
  flex: none !important;
  margin-top: 8px !important;
  inset: auto !important;
  width: auto !important;
}
html.crm-ui-spojnosc .side.ui-side .side-user .icon-btn .ui-ico { width: 18px; height: 18px; }

/* =========================================================
   2. PASEK GÓRNY
   ========================================================= */
html.crm-ui-spojnosc .top .notif-btn { display: inline-flex !important; align-items: center; gap: 6px; }
html.crm-ui-spojnosc .top .notif-btn .ui-ico { width: 20px; height: 20px; color: inherit; }

/* =========================================================
   3. PRZYCISKI — jedna skala i jedna logika kolorów
   ========================================================= */
html.crm-ui-spojnosc .btn { border-radius: var(--ui-radius); letter-spacing: 0; }
html.crm-ui-spojnosc .btn.gold:hover { filter: brightness(.97); }
/* stonowany złoty w wierszach i kartach (główna akcja zostaje granatowa) */
html.crm-ui-spojnosc :is(.table td, .row-actions, .workflow-actions, .today-plan-actions, .customer-actions, .material-actions, .employee-actions, .contract-row-actions) .btn.gold {
  background: var(--ui-gold-soft) !important;
  color: var(--ui-gold-ink) !important;
  border: 1px solid var(--ui-gold-line) !important;
  box-shadow: none !important;
}
html.crm-ui-spojnosc :is(.table td, .row-actions, .workflow-actions, .today-plan-actions, .customer-actions, .material-actions, .employee-actions) .btn.gold:hover {
  background: #f7e8c2 !important;
}
/* przycisk „Zadzwoń” — spójny z resztą, tylko zielony akcent */
html.crm-ui-spojnosc .btn.btn-call { background: #ecfdf5 !important; color: #047857 !important; border: 1px solid #bbf0d9 !important; }
/* czerwony: zawsze obrys, bez pełnego wypełnienia — wyraźny, ale nie krzyczy */
html.crm-ui-spojnosc .btn.danger { background: #fff5f5; color: #b42318; border-color: #fbd0d0; }
html.crm-ui-spojnosc .btn.danger:hover { background: #fee4e2; }

/* =========================================================
   4. POLA FORMULARZY I WYSZUKIWARKI — jeden wygląd
   ========================================================= */
html.crm-ui-spojnosc :is(.toolbar, .page-actions, .customer-toolbar) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]), select),
html.crm-ui-spojnosc #content input#search,
html.crm-ui-spojnosc #content input[type=search] {
  min-height: 42px;
  border: 1px solid #d6dee8 !important;
  border-radius: var(--ui-radius) !important;
  padding: 0 14px !important;
  background: #fff !important;
  color: var(--ui-ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
html.crm-ui-spojnosc :is(.toolbar, .customer-toolbar) input:focus,
html.crm-ui-spojnosc #content input#search:focus,
html.crm-ui-spojnosc .field :is(input, select, textarea):focus {
  border-color: var(--ui-gold) !important;
  box-shadow: var(--ui-focus) !important;
}
html.crm-ui-spojnosc #content input#search {
  padding-left: 40px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") no-repeat 13px 50% / 18px 18px !important;
}
html.crm-ui-spojnosc .customer-toolbar input#search { flex: 1 1 280px; min-width: 220px; }
html.crm-ui-spojnosc .customer-sort-field { margin: 0 !important; display: flex !important; align-items: center; gap: 8px; }
html.crm-ui-spojnosc .customer-sort-field label { font-size: 12px !important; color: var(--ui-muted); font-weight: 700; }

/* =========================================================
   5. STATUSY — kolor = etap pracy
   ========================================================= */
html.crm-ui-spojnosc .badge.ui-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 4px 10px 4px 8px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4;
  border: 1px solid transparent;
}
html.crm-ui-spojnosc .badge.ui-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
html.crm-ui-spojnosc .badge[data-ui-tone="blue"]   { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #dbe7fe; }
html.crm-ui-spojnosc .badge[data-ui-tone="amber"]  { background: #fff7e6 !important; color: #a15c07 !important; border-color: #fde7bd; }
html.crm-ui-spojnosc .badge[data-ui-tone="violet"] { background: #f5f0ff !important; color: #6d28d9 !important; border-color: #e7dcfd; }
html.crm-ui-spojnosc .badge[data-ui-tone="green"]  { background: #ecfdf3 !important; color: #047857 !important; border-color: #c9f2dc; }
html.crm-ui-spojnosc .badge[data-ui-tone="red"]    { background: #fef3f2 !important; color: #b42318 !important; border-color: #fcd9d6; }
html.crm-ui-spojnosc .badge[data-ui-tone="gray"]   { background: #f2f4f7 !important; color: #475467 !important; border-color: #e4e7ec; }

/* =========================================================
   6. KLIENCI — 3 główne przyciski + „Więcej”
   ========================================================= */
html.crm-ui-spojnosc .customer-actions[data-ui-actions="1"] {
  display: block !important;
  min-width: 0 !important;
  width: auto !important;
}
html.crm-ui-spojnosc .ui-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
html.crm-ui-spojnosc .ui-row-actions > .btn.ui-act {
  min-width: 0 !important;
  width: auto !important;
  min-height: 38px !important;
  padding: 7px 13px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  gap: 7px !important;
  white-space: nowrap !important;
  margin: 0 !important;
  border-radius: 10px !important;
}
html.crm-ui-spojnosc .ui-row-actions > .btn.ui-act .ui-ico { width: 17px; height: 17px; }
html.crm-ui-spojnosc .ui-row-actions > .btn.ui-act-locked {
  background: #ecfdf3 !important;
  color: #047857 !important;
  border: 1px solid #c9f2dc !important;
  opacity: 1 !important;
  cursor: default !important;
}
html.crm-ui-spojnosc .ui-row-actions > .ui-more-btn .ui-ico { width: 15px; height: 15px; transition: transform .15s; }
html.crm-ui-spojnosc .ui-row-actions > .ui-more-btn[aria-expanded="true"] { background: #e8edf4 !important; }
html.crm-ui-spojnosc .ui-row-actions > .ui-more-btn[aria-expanded="true"] .ui-ico { transform: rotate(180deg); }

/* menu „Więcej” (przenoszone do <body> na czas otwarcia) */
.ui-more-menu {
  position: fixed;
  z-index: 2147483000;
  min-width: 240px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
  padding: 6px;
  display: flex;
  flex-direction: column;
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #122033;
  animation: uiMenuIn .12s ease-out;
}
.ui-more-menu[hidden] { display: none !important; }
/* 5.4.324: na niskim ekranie lista przewija się w środku, zamiast wychodzić poza okno */
.ui-more-menu:not(.is-sheet) { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.ui-more-menu > button.ui-menu-item > span { min-width: 0; }
/* 5.4.324: pusty „NIP: —” nie zaśmieca listy klientów */
html.crm-ui-spojnosc #content tr[data-customer-id] .small.ui-empty-nip { display: none !important; }
@keyframes uiMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-more-menu .ui-more-head {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a96a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-more-menu > button.ui-menu-item {
  all: unset;
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  gap: 11px;
  width: 100% !important;
  min-height: 42px;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #122033 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  text-align: left;
  transform: none !important;
}
.ui-more-menu > button.ui-menu-item .ui-ico { width: 18px; height: 18px; color: #64748b; }
.ui-more-menu > button.ui-menu-item:hover,
.ui-more-menu > button.ui-menu-item:focus-visible { background: #f2f5f9 !important; outline: none; }
.ui-more-menu > button.ui-menu-item[disabled] { opacity: .5; cursor: not-allowed; }
.ui-more-menu > button.ui-menu-danger { color: #b42318 !important; }
.ui-more-menu > button.ui-menu-danger .ui-ico { color: #d92d20; }
.ui-more-menu > button.ui-menu-danger:hover { background: #fef3f2 !important; }
.ui-more-menu .ui-menu-sep { height: 1px; background: #e9edf2; margin: 6px 4px; }
/* telefon: menu jako dolny arkusz */
.ui-menu-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 2147482999; animation: uiFade .15s ease-out; }
@keyframes uiFade { from { opacity: 0; } to { opacity: 1; } }
.ui-more-menu.is-sheet {
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  border-radius: 20px 20px 0 0 !important;
  padding: 10px 10px calc(14px + env(safe-area-inset-bottom)) !important;
  max-height: 80vh;
  overflow-y: auto;
  animation: uiSheetIn .18s ease-out;
}
@keyframes uiSheetIn { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.ui-more-menu.is-sheet .ui-more-head { font-size: 13px; padding: 6px 12px 10px; text-align: center; }
.ui-more-menu.is-sheet .ui-more-head::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d0d7e2; margin: 0 auto 10px; }
.ui-more-menu.is-sheet > button.ui-menu-item { min-height: 50px; font-size: 15px !important; }

/* tabela klientów: rozsądne szerokości kolumn */
html.crm-ui-spojnosc.crm-desktop-device #content .table tr[data-customer-id] > td:nth-child(1) { min-width: 190px; }
html.crm-ui-spojnosc.crm-desktop-device #content .table tr[data-customer-id] > td:nth-child(2) { min-width: 190px; }
html.crm-ui-spojnosc.crm-desktop-device #content .table tr[data-customer-id] > td { vertical-align: middle; }

/* telefon/tablet: akcje klienta w siatce (Notatka, Kontakt / Umowa, Termin / Więcej na całą szerokość) — 5.4.324 */
html.crm-mobile-device.crm-ui-spojnosc .ui-row-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}
html.crm-mobile-device.crm-ui-spojnosc .ui-row-actions > .btn.ui-act { width: 100% !important; min-height: 44px !important; justify-content: center; }

/* =========================================================
   7. PULPIT — data zamiast emoji
   ========================================================= */
html.crm-ui-spojnosc .ui-date-tile {
  width: 52px !important;
  height: 54px !important;
  flex: none;
  display: inline-grid !important;
  grid-template-rows: 18px 1fr;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e8ef;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
  text-align: center;
  font-size: 0 !important;
}
html.crm-ui-spojnosc .ui-date-tile small { display: block; background: var(--ui-gold); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .08em; line-height: 18px; }
html.crm-ui-spojnosc .ui-date-tile b { display: grid; place-items: center; font-size: 22px; font-weight: 800; color: var(--ui-ink); line-height: 1; }

/* =========================================================
   8. PRACOWNICY — liczniki (etykieta nad liczbą, nie sklejone)
   ========================================================= */
html.crm-ui-spojnosc .mini-stats > .card { display: flex !important; flex-direction: column !important; gap: 2px; align-items: flex-start !important; }
html.crm-ui-spojnosc .mini-stats > .card small { color: var(--ui-muted); font-weight: 650; font-size: 13px; }
html.crm-ui-spojnosc .mini-stats > .card strong { font-size: 28px; line-height: 1.1; margin: 0 !important; }

/* =========================================================
   9. TELEFON — dolny pasek i menu „Więcej”
   ========================================================= */
html.crm-ui-spojnosc nav.mobilebar button > div .ui-ico { width: 23px; height: 23px; }
html.crm-ui-spojnosc nav.mobilebar button > div { display: grid; place-items: center; position: relative; line-height: 1; }
html.crm-ui-spojnosc .crm-mobile-more-grid.ui-more-grouped { grid-auto-rows: auto !important; align-content: start !important; }
html.crm-ui-spojnosc .crm-mobile-more-grid.ui-more-grouped .ui-more-title {
  grid-column: 1 / -1;
  margin: 10px 4px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7f8fa6;
}
html.crm-ui-spojnosc .crm-mobile-more-grid.ui-more-grouped .ui-more-title[data-ui-group-title="work"],
html.crm-ui-spojnosc .crm-mobile-more-grid.ui-more-grouped > .ui-more-title:first-of-type { margin-top: 0; }
html.crm-ui-spojnosc .crm-mobile-more-item b {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  font-size: 13.5px !important;
  line-height: 1.25 !important;
  min-width: 0;
}
html.crm-ui-spojnosc .crm-mobile-more-icon .ui-ico { width: 21px; height: 21px; }
html.crm-ui-spojnosc .crm-mobile-more-logout { grid-column: 1 / -1; order: 999 !important; }

/* Plan na dziś (kalendarz, telefon): bez samotnych przycisków w rzędzie */
html.crm-mobile-device.crm-ui-spojnosc #content .today-plan-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}
html.crm-mobile-device.crm-ui-spojnosc #content .today-plan-actions > .btn { flex: 1 1 28% !important; width: auto !important; min-width: 0 !important; }
html.crm-mobile-device.crm-ui-spojnosc #content .today-plan-actions > .btn:is(.gold, .primary) { flex-basis: 100% !important; }

/* Sprawy (telefon): „Ustal termin” na całą szerokość, „Zadzwoń” i „Podgląd” obok siebie */
html.crm-mobile-device.crm-ui-spojnosc #content .workflow-card .workflow-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}
html.crm-mobile-device.crm-ui-spojnosc #content .workflow-card .workflow-actions > .btn { flex: 1 1 40% !important; width: auto !important; min-width: 0 !important; }
html.crm-mobile-device.crm-ui-spojnosc #content .workflow-card .workflow-actions > .btn:first-child { flex-basis: 100% !important; }

/* Klienci (telefon): pole wyszukiwania przed przyciskami */
html.crm-mobile-device.crm-ui-spojnosc .customer-toolbar input#search { order: -1; width: 100% !important; flex: 1 1 100% !important; min-width: 0; grid-column: 1 / -1; }

/* Starsze Androidy (WebView ≤ 7) — bez animacji */
html.crm-android7-legacy .ui-more-menu, html.crm-android7-legacy .ui-menu-backdrop { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .ui-more-menu, .ui-menu-backdrop { animation: none !important; } }

/* komputer: akcje klienta w jednej linii */
html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions { flex-wrap: nowrap; }
html.crm-desktop-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td:last-child { width: 1%; white-space: nowrap; }
html.crm-desktop-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td:nth-child(2) { min-width: 150px; }
@media (max-width: 1280px) {
  html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions > .btn.ui-act:not(.primary):not(.ui-more-btn):not(.ui-act-locked) { padding: 7px 10px !important; }
}

/* nagłówki stron: przyciski bez łamania, linki wyglądające jak przyciski bez podkreślenia */
html.crm-ui-spojnosc .page-head { flex-wrap: wrap; }
html.crm-ui-spojnosc .page-actions { flex-wrap: wrap; justify-content: flex-end; }
html.crm-ui-spojnosc.crm-desktop-device .page-actions > .btn { white-space: nowrap; }
html.crm-ui-spojnosc a.btn, html.crm-ui-spojnosc a.btn:hover { text-decoration: none !important; }

/* kafelki: liniowe ikony w kolorze akcentu */
html.crm-ui-spojnosc .ui-tile-ico { color: #475467; }
html.crm-ui-spojnosc .ui-tile-ico .ui-ico { width: 21px; height: 21px; }
html.crm-ui-spojnosc .accent-blue .ui-tile-ico { color: #2563eb; }
html.crm-ui-spojnosc .accent-amber .ui-tile-ico { color: #b7791f; }
html.crm-ui-spojnosc .accent-violet .ui-tile-ico { color: #7c3aed; }
html.crm-ui-spojnosc .accent-green .ui-tile-ico { color: #0f9f6e; }
html.crm-ui-spojnosc .accent-red .ui-tile-ico { color: #dc2626; }
html.crm-ui-spojnosc .action-icon.ui-tile-ico .ui-ico { width: 23px; height: 23px; }

/* status klienta nie dotyka przycisków */
html.crm-ui-spojnosc #content .table tr[data-customer-id] > td:nth-child(3) { padding-right: 16px; }

/* 5.4.311 — TABLET: status klienta pod nazwiskiem zamiast osobnej kolumny (wcześniej np. „Pomiar do ustalenia”
   wchodził pod przycisk „Termin”). Komputer i telefon bez zmian. */
html.crm-ui-spojnosc .badge.ui-status-inline { display: none !important; }
html.crm-tablet-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td:nth-child(3),
html.crm-tablet-device.crm-ui-spojnosc #content .table:has(tr[data-customer-id]) thead th:nth-child(3) { display: none !important; }
html.crm-tablet-device.crm-ui-spojnosc #content .table tr[data-customer-id] .badge.ui-status-inline {
  display: inline-flex !important; margin-top: 6px; white-space: normal !important; max-width: 100%;
}
html.crm-tablet-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td { vertical-align: top; }
html.crm-tablet-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td:last-child { min-width: 300px; }
/* na wszelki wypadek (urządzenia bez klasy tabletu): status może się zawinąć zamiast wchodzić pod przyciski */
html.crm-mobile-device.crm-ui-spojnosc #content .table tr[data-customer-id] > td:nth-child(3) .badge.ui-status { white-space: normal !important; }

/* =========================================================
   5.4.311 — OKNA (formularze) — jednakowy układ
   ========================================================= */
/* mniej pustego miejsca między polami */
html.crm-ui-spojnosc #modal .modal-card .field { margin: 10px 0 !important; }
html.crm-ui-spojnosc #modal .modal-card .grid2 { row-gap: 2px; column-gap: 14px; }
html.crm-ui-spojnosc #modal .modal-head h3 { font-size: 18px; }
/* pojedynczy przycisk „Zapisz” na końcu formularza — po prawej, jak w pozostałych oknach */
html.crm-ui-spojnosc.crm-desktop-device #modalBody form > button.btn.primary:last-child {
  display: flex; margin: 16px 0 0 auto; min-width: 170px;
}
/* komputer: pasek przycisków okna zawsze widoczny przy długich formularzach */
html.crm-ui-spojnosc.crm-desktop-device #modal .modal-card .modal-actions {
  position: sticky; bottom: -21px; z-index: 3;
  background: #fff; margin-bottom: -21px; padding-bottom: 16px;
  box-shadow: 0 -10px 16px -14px rgba(15, 23, 42, .35);
}
/* przycisk zamknięcia: subtelny fokus (CRM ustawia na nim fokus przy otwarciu okna) */
html.crm-ui-spojnosc #modal .modal-head .icon-btn:focus-visible { box-shadow: 0 0 0 2px #e3e8ef !important; }

/* =========================================================
   5.4.313 — POZOSTAŁE PODSTRONY I OKNA
   ========================================================= */
/* pola wyboru pliku — jak przyciski CRM */
html.crm-ui-spojnosc #content input[type=file], html.crm-ui-spojnosc #modal input[type=file] { font: inherit; font-size: 13px; color: #475467; max-width: 100%; }
html.crm-ui-spojnosc #content input[type=file]::file-selector-button, html.crm-ui-spojnosc #modal input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; color: #122033; background: #f1f4f8; border: 1px solid #e3e8ef; border-radius: 10px; padding: 8px 14px; margin-right: 10px; cursor: pointer;
}
html.crm-ui-spojnosc #content input[type=file]::file-selector-button:hover, html.crm-ui-spojnosc #modal input[type=file]::file-selector-button:hover { background: #e8edf4; }
/* pola zaznaczenia — jeden kolor i rozmiar */
html.crm-ui-spojnosc #content input[type=checkbox], html.crm-ui-spojnosc #modal input[type=checkbox],
html.crm-ui-spojnosc #content input[type=radio], html.crm-ui-spojnosc #modal input[type=radio] { accent-color: #122033; width: 18px; height: 18px; }
/* zwykłe listy i pola na podstronach (np. Automatyzacje, Aktualizacje) — jak w formularzach */
html.crm-ui-spojnosc #content .card :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea) { border-radius: 12px; border-color: #d6dee8; }
html.crm-ui-spojnosc #content .card :is(input, select, textarea):focus { border-color: var(--ui-gold) !important; box-shadow: var(--ui-focus) !important; outline: none; }
/* karty i nagłówki kart — jedna skala */
html.crm-ui-spojnosc #content .card > h3 { font-size: 16.5px; line-height: 1.3; }
html.crm-ui-spojnosc #content .page-head h3 { letter-spacing: -.01em; }
/* podgląd klienta: nazwisko nie jest ściśnięte przez przyciski */
html.crm-ui-spojnosc #modal .customer-preview-head { flex-wrap: wrap !important; gap: 12px !important; }
html.crm-ui-spojnosc #modal .customer-preview-head > div:first-child { flex: 1 1 240px; min-width: 220px; }
html.crm-ui-spojnosc #modal .customer-preview-actions { flex-wrap: wrap; justify-content: flex-end; }
/* „Umowa podpisana” wszędzie jako zielony znacznik (nie wyszarzony złoty przycisk) */
html.crm-ui-spojnosc button.btn[disabled]:is([title*="podpisana" i], [title*="podpisan" i]) {
  background: #ecfdf3 !important; color: #047857 !important; border: 1px solid #c9f2dc !important; opacity: 1 !important; box-shadow: none !important; cursor: default !important;
}
/* puste stany — spokojniejsze */
html.crm-ui-spojnosc #content .empty-state h3 { color: #344054; font-size: 16px; margin: 4px 0 0; }
html.crm-ui-spojnosc #content .empty-state > div:first-child { font-size: 28px; opacity: .55; }
/* powiadomienia: jednolite karty */
html.crm-ui-spojnosc #content .notif { border-radius: 12px; }
html.crm-ui-spojnosc #content .notif.unread { border-left-color: var(--ui-gold); }

/* 5.4.324: „Podpowiedzi produktów” — opis samouczącej się listy */
.crm-suggest-learn { display: grid; gap: 4px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #f4f7fb; border: 1px solid #e3e8ef; font-size: 13px; line-height: 1.45; color: #475467; }
.crm-suggest-learn b { color: #122033; font-size: 14px; }
.crm-suggest-learn em { font-style: normal; font-size: 12.5px; color: #64748b; }

/* 5.4.324: 4 przyciski + „Więcej” — na telefonie „Więcej” na całą szerokość, na węższym laptopie same ikony przy Notatce i Kontakcie */
html.crm-mobile-device.crm-ui-spojnosc .ui-row-actions > .ui-more-btn { grid-column: 1 / -1; }
@media (max-width: 1440px) {
  html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions { gap: 6px; }
  html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions > .btn.ui-act { padding: 7px 10px !important; }
}
@media (max-width: 1360px) {
  html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions > .btn.ui-act .ui-lbl { display: none; }
  html.crm-desktop-device.crm-ui-spojnosc .ui-row-actions > .btn.ui-act:has(.ui-lbl) { padding: 7px 10px !important; min-width: 40px !important; justify-content: center; }
}
