/* Cleaned CRM CSS (latest wins, deduplicated) */
:root {
  --gutter: 3px;
  --color-main: #2b70c9;
  --color-hover: #2158a3;
  --color-bg: #f7f7f7;
  --color-border: #ccc;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --header-height: 75px;
  --sidebar-width: 60px;
  --tabbar-height: 32px;
  --canvas-width: 400px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
  background: #f5f6f8;
}

body {
  display: flex;
  flex-direction: column;
}

.crm-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: auto;
}

.crm-main {
  height: 100%;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}

.crm-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#view-crm {
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#crm-root {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #ccc;
  z-index: 1000;
}

.crm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #ccc;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-row-split {
  position: fixed;
  top: 64px; 
  left: 0;
  right: 0;
  height: 55px;
  background: #f9f9f9;
  z-index: 1000;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.crm-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 1fr auto; 
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.crm-grid.leads-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr 2fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  padding: 12px 12px 12px 12px; 
  height: 100%;
  box-sizing: border-box;
}

.crm-grid-custom {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;     
  gap: 16px;
  height: 100vh;
  overflow: hidden;
}

.col-1 {
  grid-column: 1;
}

.col-2 {
  grid-column: 2;
}

.col-3 {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.col-4 {
  grid-column: 4;
}

.col-1-dol {
  grid-column: 1;
  grid-row: 2;
}

.col-2-dol {
  grid-column: 2;
  grid-row: 2;
}

.section {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px var(--color-shadow);
  position: relative;
}

.crm-btn {
  background-color: #2563eb;
  color: white;
  padding: 6px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#admin-section-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f5f6f8;
}

#aliasy-editor input {
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

#asystent-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

#asystent-avatar, .asystent-avatar-inline {
  transition: transform 0.3s ease;
}

#asystent-avatar.talking img {
  animation: talking 0.4s infinite alternate;
}

#asystent-avatar.thinking img {
  animation: thinking 1.2s infinite ease-in-out;
}

#asystent-sugestie {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #ccc;
  border-top: none;
  z-index: 1000;
  display: none;
}

#canvas-container button, .canvas-content button {
  margin-top: 8px;
  margin-right: 8px;
}

#canvas-container textarea, .canvas-content textarea {
  width: 100%;
  height: 300px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  font-family: monospace;
  resize: vertical;
}

#chat-messages {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
}

#filtr-rodzaj, #filtr-zrodlo {
  min-width: 150px;
  width: 160px;
}

#filtry-operatora {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#generator-content {
  max-height: 470px;
  overflow-y: auto;
  padding-right: 4px;
}

#glownyWykres {
  height: 220px;
  max-height: 220px;
}

#image-modal {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

#image-modal img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  display: block;
}

#image-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 4px 8px;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
}

#image-modal-controls {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

#image-modal-controls button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

#image-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

#import-wizard {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 700px;
  margin: auto;
}

#kalkulator-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
  background: #fefefe;
}

#kalkulator-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#karuzele-ofert, #broker-lista {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-behavior: smooth;
}

#klient-content h4, #kontakty-content h4, #szczegoly-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #222;
}

#lista-adresow-ftth input:invalid {
  border-color: #dc2626; 
  outline: none;
}

#lista-promocji-blok, #lista-taryf {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 5px;
}

#loader-mailing div {
  font-style: italic;
  color: #555;
}

#logPopup {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-radius: 10px;
}

#mailing-user-chip-list .chip {
  background-color: #eff6ff;
  color: #1d4ed8;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#main-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#main-content, .crm-main, .crm-content, #view-crm, flex: 1 1 auto !important; min-height: 0 !important; height: 100% !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; } #main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#main-content.fade-transition {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#main-loader {
  background: white;
  padding: 16px;
  text-align: center;
  font-size: 16px;
  border-top: 1px solid #eee;
}

#manualny-numer {
  height: 28px;
  font-size: 13px;
}

#numer-suggestions .crm-suggestion-item {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

#numer-suggestions .crm-suggestion-item:hover {
  background: #f0f0f0;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); 
  display: none;  
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#panel-notatek {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 10000;
  padding: 16px;
}

#panel-notatek .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

#panel-notatek.open {
  transform: translateX(0);
}

#panel-rozwiniecie {
  background: #f9f9f9;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#panel-sprzedaz .sidebar, #panel-obsluga .sidebar, #panel-komunikacja .sidebar {
  display: none !important;
}

#panel-sprzedaz, #panel-obsluga, #panel-komunikacja {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

#panel-telefonu {
  display: none;
  background: #f0fdfa;
  border: 1px solid #22d3ee;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
  height: 32px;
  align-items: center;
}

#panel-telefonu.aktywny {
  display: flex;
}

#podkategorie button.selected {
  background-color: #1d4ed8 !important; 
  color: white !important;
  border-color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#popup-kontakt .popup-box {
  max-width: 480px;
  width: 100%;
  background: white;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

#popup-kontakt .popup-box input {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

#popup-kontakt label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
}

#popup-lista {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#popup-lista .crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
  min-width: 1200px;
}

#popup-lista .crm-table input[type="text"] {
  width: 100%;
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#popup-lista .crm-table th, #popup-lista .crm-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

#popup-lista .crm-table thead tr:nth-child(1) th {
  background-color: #f3f4f6;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#popup-lista .crm-table thead tr:nth-child(2) th {
  background-color: #f9f9f9;
  position: sticky;
  top: 32px;
  z-index: 19;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05);
}

#popup-lista .popup-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: #f9f9f9;
}

#popup-lista .popup-container {
  background: white;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

#popup-lista .popup-header {
  padding: 16px 24px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: sticky;
  top: 0;
  z-index: 20;
}

#porownanie {
  margin-top: 40px;
}

#porownanie .offer-card {
  background: #e9f5ff;
  border: 1px solid #bbe1fa;
}

#powiad-wiecej {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
}

#powiad-wiecej:hover {
  text-decoration: underline;
  background-color: #f3f4f6;
}

#preview-box {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #ccc;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
}

#progress {
  width: 0%;
  height: 100%;
  background-color: #4caf50;
  transition: width 0.2s ease;
}

#progress-bar {
  width: 100%;
  height: 10px;
  background-color: #eee;
  margin-top: 10px;
  border-radius: 5px;
  overflow: hidden;
}

#progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  font-size: 18px;
}

#project-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

#project-list li {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 13px;
}

#project-list li.active {
  background: #e6f0ff;
  font-weight: bold;
}

#project-list::-webkit-scrollbar {
  width: 6px;
}

#project-list::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

#quick-panel {
  width: 420px !important;
    max-width: 33vw;
    transition: all 0.3s ease;
}

#quick-panel [data-action="qp-pin"], #quick-panel [data-action="qp-close"] {
  cursor: pointer;
}

#quick-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

#quick-panel.is-pinned {
  
}

#rozliczenia-kafelki {
  display: flex;
  gap: 16px;
  overflow: hidden;
  scroll-behavior: smooth;
  padding: 0 40px;
  flex: 1;
}

#rozliczenia-kafelki-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 0;
  overflow: hidden;
  min-height: 180px;
  max-height: 180px;
}

#sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
}

#sidebar-buttons {
  position: fixed;
  top: 100px;
  right: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#status-filter-top {
  min-width: 240px;
}

#status-importu {
  margin-top: 30px;
  font-size: 18px;
  font-weight: bold;
}

#system-status {
  padding: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
}

#szczegoly-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#tab-informacje .crm-btn.plus-only {
  background: none !important;
    border: none !important;
    box-shadow: none !important;
}

#top-jednostki-container {
  height: 260px;
  max-height: 260px;
  overflow: hidden;
}

#view-mailing .section, #view-kontakty .section {
  max-width: 1000px;
  margin: 0 auto;
}

#vouchery-box.ukryj {
  display: none;
}

#zamowienia-tabela {
  height: 60vh;
  overflow-x: auto;
  overflow-y: auto;
}

#zamowienia-tabela .crm-list-table {
  display: block;
  table-layout: auto;
  min-width: max-content;
}

#zamowienia-tabela .crm-list-table th, #zamowienia-tabela .crm-list-table td {
  white-space: nowrap;
}

#zamowienia-tabela-scroll {
  overflow-x: auto;
  overflow-y: auto;
}

#zarzadzanie-glowne {
  display: flex !important;
  position: relative;
  z-index: 10;
  background: white;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
}

#zestawienie-zbiorcze-container {
  flex-shrink: 0;
  overflow: visible;
  margin-top: 12px;
  height: 260px;
  max-height: 260px;
}

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

.action-btn {
  background:none;
  border:none;
  cursor:pointer;
  font-size:16px;
  padding:6px;
}

.active-lead {
  background-color: #def7ff;
  border-left: 4px solid #00bfff;
}

.active-mail {
  border-left: 4px solid #2196f3;
  background: #d0ebff !important;
}

.admin-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-content, #admin-section-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-content, #admin-section-container, #moja-sprzedaz {
  height: 100%;
  flex: 1;
  overflow: hidden;
}

.adres-ftth-entry input {
  font-size: 13px;
}

.adres-tekst {
  font-size: 14px;
}

.assistant-box {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
}

.assistant-box h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asystent-avatar {
  margin-left: auto;
}

.asystent-avatar-header img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  background: white;
}

.asystent-avatar-inline {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-left: 8px;
}

.asystent-avatar-inline.idle {
  animation: blinkAvatar 2.5s infinite;
}

.asystent-avatar-inline.talking {
  animation: pulseAvatar 0.6s infinite;
}

.asystent-avatar-inline.thinking {
  animation: floatAvatar 1.5s infinite ease-in-out;
}

.asystent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.asystent-historia {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asystent-historia .ai {
  background: #f3f6ff;
  border-left: 3px solid var(--color-main);
  padding-left: 6px;
  color: #222;
}

.asystent-historia .user {
  font-weight: 500;
  color: #333;
}

.asystent-historia .wiadomosc {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.asystent-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-left: 6px;
}

.asystent-input {
  display: flex;
  gap: 6px;
  margin-top: auto; 
  padding-top: 6px;
}

.asystent-input button {
  background: var(--color-main);
  color: white;
  font-size: 13px;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.asystent-input button:hover {
  background: var(--color-hover);
}

.asystent-input input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
}

.attach-preview img {
  max-width:80px;
  max-height:80px;
  object-fit:cover;
  border:1px solid #ccc;
  border-radius:4px;
}

.attach-preview-img {
  max-width: 100px;
  max-height: 100px;
  margin-right: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.attach-preview-wrapper {
  position: relative;
  display: inline-block;
}

.attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
}

.attach-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 12px;
  cursor: pointer;
}

.attach-thumb {
  display: inline-block;
  position: relative;
  margin: 4px;
  vertical-align: middle;
}

.attach-thumb img {
  max-width: 80px;
  max-height: 80px;
  border-radius: 4px;
  display: block;
}

.attach-thumb span {
  font-size: 14px;
  margin-right: 4px;
}

.attachment-download {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  margin-left: 4px;
}

.attachment-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

.autocomplete-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  z-index: 10000;
}

.autocomplete-box div {
  padding: 4px 8px;
  cursor: pointer;
  color: #333;
}

.autocomplete-box div:hover {
  background: #f0f0f0;
}

.autocomplete-box.hidden {
  display: none !important;
}

.avatar {
  flex: 0 0 auto;
}

.avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.bazy-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 15px;
  height: calc(100vh - 140px);
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.bazy-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 15px;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.3s, transform 0.3s;
}

.bazy-tile-header {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

.bazy-tile:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.bg-light {
  background: #f9f9f9;
}

.blacklist-circle {
  width: 26px;
  height: 26px;
  background: #f3f3f3;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  cursor: pointer;
  border: 1px solid #aaa;
  font-size: 14px;
}

.blacklist-circle:hover {
  background: #e2e8f0;
}

.border {
  border: 1px solid #ccc;
}

.btn-icon {
  font-size: 13px;
  padding: 2px 6px;
  background: none;
  border: none;
  color: #444;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: #111;
}

.btn-mailing {
  width: 220px;
  padding: 6px 12px;
  font-size: 14px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.btn-przedzial {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 5px;
  background-color: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
  cursor: pointer;
  min-width: 50px;
}

.btn-przedzial.aktywny {
  background-color: #22c55e;
  border-color: #22c55e;
  font-weight: bold;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.4);
}

.btn-przedzial:hover {
  background-color: #2563eb;
}

.btn-status {
  background: #1e90ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  width: 250px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bubble {
  display: flex;
  margin: 6px 0;
  align-items: flex-end;
}

.bubble-content {
  max-width: 70%;
  background: #e1f5fe;
  padding: 8px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.bubble-in {
  justify-content: flex-start;
}

.bubble-in .bubble-content {
  background: #f0f0f0;
}

.bubble-meta {
  font-size: 12px;
  color: #666;
  text-align: right;
}

.bubble-note {
  font-size: 13px;
  color: #aa7700;
  margin-bottom: 4px;
}

.bubble-out {
  justify-content: flex-end;
}

.bubble-text {
  margin-bottom: 4px;
}

.canvas-panel {
  flex: 0 0 var(--canvas-width);
  height: 100%;
  overflow: auto;
}

.canvas-panel.collapsed {
  right: calc(-1 * var(--canvas-width) - 20px);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-content p {
  font-size: 14px;
  margin: 3px 0;
}

.centered-content {
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.chart-box {
  background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.chat-avatar {
  width:32px;
  height:32px;
  border-radius:50%;
  margin-right:8px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  box-sizing: border-box;
}

.chat-header, .chat-search-container, .chat-form {
  flex: none;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header__actions .action-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.chat-header__actions .action-btn:hover {
  opacity: 0.8;
}

.chat-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
}

.chat-header__info {
  display: flex;
  flex-direction: column;
}

.chat-header__left {
  display: flex;
  align-items: center;
}

.chat-header__participants {
  font-size: 0.875rem;
  color: #666;
  margin-top: 2px;
}

.chat-header__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.chat-image-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 4px;
  margin: 4px 0;
}

.chat-line {
  margin-bottom: 12px;
  background: #eef2f7;
  padding: 10px 12px;
  border-radius: 8px;
}

.chat-line.ai {
  background: #f5f5f5;
  padding: 6px;
  margin-bottom: 6px;
  border-radius: 4px;
}

.chat-line.ai[style*="opacity:0.6"], .chat-line.ai.unread {
  opacity: 0.6;
}

.chat-line.user {
  background: #eef7ff;
  border-left: 3px solid var(--color-main);
  padding: 6px;
  margin-bottom: 6px;
  border-radius: 4px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  position: relative;
}

.chat-list-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.chat-list-item-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #dc3545;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 12px;
}

.chat-list-item-content {
  flex: 1;
  margin-left: 12px;
  overflow: hidden;
}

.chat-list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-list-item-snippet {
  color: #555;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-list-item-time {
  font-size: 0.75rem;
  color: #888;
  flex-shrink: 0;
  margin-left: 8px;
}

.chat-list-item-title {
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item.active {
  background: #e8f0ff;
}

.chat-list-item.active .chat-list-item-title, .chat-list-item.active .chat-list-item-snippet, .chat-list-item.active .chat-list-item-time {
  color: #fff;
}

.chat-list-item.unread {
  background-color: #e0f7fa;
}

.chat-list-item:hover {
  background: #f0f0f0;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  margin: 8px 0;
}

.chat-message--mine {
  justify-content: flex-end;
}

.chat-message--mine .chat-msg-avatar {
  margin-left: 8px;
}

.chat-message--mine .message-bubble {
  background: #0084ff;
  color: #fff;
  border-top-right-radius: 2px;
}

.chat-message--mine .message-meta, .chat-message--other .message-meta {
  color: #fff;
}

.chat-message--other {
  justify-content: flex-start;
}

.chat-message--other .chat-msg-avatar {
  margin-right: 8px;
}

.chat-message--other .message-bubble {
  background: #f0f0f0;
  color: #000;
  border-top-left-radius: 2px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}

.chat-mode-switch {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.chat-mode-switch .mode-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid #ccc;
  cursor: pointer;
  font-weight: 500;
}

.chat-mode-switch .mode-btn.active {
  background-color: #fff;
  border-color: #aaa;
}

.chat-mode-switch .mode-btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border-right: none;
}

.chat-mode-switch .mode-btn:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 8px;
}

.chat-title {
  font-weight:600;
  font-size:16px;
}

.chat-type-switch {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
}

.chat-type-switch label {
  cursor: pointer;
}

.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
  padding-top: 6px;
}

.checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 14px;
}

.chip button {
  font-weight: bold;
  color: red;
  background: transparent;
  border: none;
  cursor: pointer;
}

.chip button:hover {
  background: transparent;
  color: red;
}

.clock {
  font-weight: bold;
  font-size: 16px;
}

.clock-wrapper {
  text-align: center;
  font-size: 12px;
}

.clock-wrapper .clock {
  font-size: 18px;
  font-weight: bold;
}

.clock-wrapper .date {
  font-size: 11px;
  color: #666;
}

.col-1 > .section, .col-2 > .section, .col-3 > .section, .col-4 > .section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-1, .col-2, .col-3, .col-4 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.col-1-gora, .col-1-dol, .col-2-gora, .col-2-dol {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.col-2-dol > .section > div:first-child {
  background: transparent !important;
    border-bottom: none !important;
}

.col-3 .lead-summary-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.col-3 .section {
  flex: 1 !important;
  display: flex;
  flex-direction: column;
}

.col-3 > .section, .col-4 > .section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.col-3, .col-3 .section, .col-3 .lead-summary-box, #szczegoly-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.col-3, .col-4 {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.col-4 .section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.col-4 .tab-content {
  flex: 1;
  overflow-y: auto;
}

.col-4 .tab-menu {
  margin-bottom: var(--gutter);
}

.col-full {
  grid-column: span 4;
}

.col-klient {
  grid-column: 1 / 3;   
  grid-row:    1 / 2;   
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-klient .client-contacts {
  flex: 1;
  overflow-y: auto;
  border-left: 1px solid #ddd;  
  padding-left: 8px;
}

.col-klient .client-details {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.col-klient .inner-client {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.col-left {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  gap: var(--gutter);
}

.col-left .section {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.col-main {
  grid-column: 2 / 4;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.counter {
  text-align: center;
  font-size: 11px;
  color: #777;
  flex: 1;
}

.crm-box, .lead-summary-box {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.crm-btn.active-zakladka {
  background:#16a34a !important; color:#fff !important; font-weight:700 !important;
}

.crm-btn.blue {
  background: #3b82f6;
}

.crm-btn.danger {
  background-color: #dc2626;
  color: white;
}

.crm-btn.filtr-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: #3b82f6;  
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.crm-btn.filtr-btn.active {
  background: #22c55e;
}

.crm-btn.full {
  width: 260px;
  justify-content: space-between;
  display: flex;
}

.crm-btn.gray {
  background: #6b7280;
}

.crm-btn.green {
  background: #22c55e;
}

.crm-btn.icon-only {
  padding: 6px 8px;
  min-width: 36px;
  font-size: 18px;
  text-align: center;
  background: #2563eb;
  color: white;
  border-radius: 6px;
  border: none;
}

.crm-btn.icon-only.plus-only {
  font-weight: bold;
  color: #fff;
  background-color: #10b981;
}

.crm-btn.icon-only.plus-only:hover {
  background-color: #059669;
}

.crm-btn.icon-only:hover {
  background: #1e40af;
}

.crm-btn.icon-only:where(:not(:has(*))):where(:not(:empty)):has-text("➕") {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

.crm-btn.icon-only:where(:not(:has(*))):where(:not(:empty)):has-text("➕"):hover {
  background-color: #1e40af !important;
}

.crm-btn.mini {
  padding: 4px 8px;
  font-size: 13px;
}

.crm-btn.mini.active-filtr {
  background-color: #16a34a;
  color: white;
  font-weight: bold;
  border: 1px solid #15803d;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.4);
}

.crm-btn.mini.danger {
  background-color: #d9534f;
}

.crm-btn.mini.danger:hover {
  background-color: #c9302c;
}

.crm-btn.mt-2 {
  margin-top: 12px;
}

.crm-btn.orange {
  background: #f97316;
}

.crm-btn.plus-only, .mini-btn.plus-only, .icon-only.plus-only {
  background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.crm-btn.plus-only, .mini-btn.plus-only, .icon-only.plus-only, #attach-btn, #dodaj-komentarz-btn {
  background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.crm-btn.purple {
  background: #8b5cf6;
}

.crm-btn.secondary-btn {
  background: #eee;
  color: #333;
}

.crm-btn.secondary-btn:hover {
  background: #ddd;
}

.crm-btn.w-full {
  width: 100%;
  margin-bottom: 12px;
}

.crm-btn:hover {
  background-color: #1e40af;
}

.crm-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.crm-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.crm-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.crm-input.mb-2 {
  margin-bottom: 8px;
}

.crm-layout, .crm-main, .topbar {
  width: 100vw !important;
  max-width: 100vw !important;
  box-sizing: border-box;
}

.crm-line {
  line-height: 1.2;
}

.crm-line-bold {
  font-weight: bold;
}

.crm-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.crm-list-table td {
  font-size: 13px;
}

.crm-list-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  color: #555;
  background: #f9fafb;
  border-bottom: 1px solid #ddd;
}

.crm-list-table th, .crm-list-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  white-space: nowrap;
}

.crm-list-table thead {
  background-color: #f7f7f9;
  font-weight: 600;
}

.crm-list-table.table-fixed {
  table-layout: fixed;
}

.crm-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #666;
  font-family: sans-serif;
}

.crm-logo-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
}

.crm-logo-top .logo-img {
  width: 28px;
  height: auto;
}

.crm-logo-top .logo-text {
  font-size: 10px;
  line-height: 1.1;
}

.crm-logo-top img {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}

.crm-main, .admin-content, #admin-section-container, #mojasprzedaz {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.crm-main, .crm-content, #view-crm {
  height: 100%;
flex: 1 1 auto;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}

.crm-search {
  display: flex;
  align-items: center;
  background: #f3f6fa;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 8px;
}

.crm-search button {
  background: var(--color-main);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.crm-search button:hover {
  background: var(--color-hover);
}

.crm-search input {
  border: none;
  outline: none;
  background: transparent;
  padding: 6px;
  font-size: 14px;
  width: 180px;
}

.crm-search input[type="text"] {
  border: none;
  outline: none;
  background: transparent;
  padding: 6px;
  font-size: 14px;
  width: 220px;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
  min-width: 1000px;
}

.crm-table button {
  font-size: 12px;
  padding: 2px 6px;
  border: none;
  background: none;
  cursor: pointer;
}

.crm-table button:hover {
  text-decoration: underline;
}

.crm-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: #111827;
}

.crm-table th, .crm-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.crm-table tr:hover {
  background: #eef2ff;
}

.crm-table tr:nth-child(even) {
  background: #f9f9f9;
}

.crm-table-wrapper {
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.czasowe-wrapper {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #f9f9f9;
  border-top: 1px solid #ddd;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  width: 100%;
  margin-top: auto;
}

.czasowy-blok {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px; 
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-width: 120px;
}

.czasowy-blok button {
  flex: 1;
  text-align: right;
  background-color: var(--color-main);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.czasowy-blok button:hover {
  background-color: var(--color-hover);
}

.czasowy-naglowek {
  font-weight: 600;
  color: #333;
  text-align: left;
  flex: 1;
  font-size: 13px;
}

.czat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #fff;
}

.czat-content {
  margin-top: 4px;
}

.czat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #ccc;
  background: #f9f9f9;
}

.czat-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ccc;
  background: #f9f9f9;
  font-weight: bold;
}

.czat-header .czat-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.czat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.czat-item-avatar, .chat-avatar, .chat-msg-avatar, .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.czat-item.active {
  background: #e0f3ff;
  border-left: 4px solid #2196f3;
  padding-left: 6px;
}

.czat-lista {
  flex: 1;
  overflow-y: auto;
}

.czat-loader {
  text-align: center;
  padding: 12px;
  color: #888;
  display: none;
}

.czat-meta {
  font-size: 13px;
  font-weight: bold;
}

.czat-status {
  font-size: 12px;
  color: #888;
}

.czat-subheader {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

.czat-tools {
  margin-top: 6px;
}

.czaty-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.czaty-input {
  padding-top: 6px;
}

.czaty-input button {
  padding: 8px 14px;
  background: var(--color-main);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.czaty-input form {
  display: flex;
  gap: 8px;
}

.czaty-input input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.czaty-input-box {
  display: flex;
  border-top: 1px solid #ccc;
  padding: 10px;
  background: #f7f7f7;
}

.czaty-input-box button {
  margin-left: 8px;
  padding: 8px 14px;
  background: var(--color-main);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.czaty-input-box button:hover {
  background: var(--color-hover);
}

.czaty-input-box input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 14px;
}

.czaty-konta {
  border-right: 1px solid #ccc;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 12px;
}

.czaty-konta, .czaty-podglady {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
}

.czaty-konto {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease;
  text-align: center;
}

.czaty-konto img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.czaty-konto.active {
  background-color: #dceeff;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.czaty-konto:hover {
  background-color: #eef2f6;
}

.czaty-layout {
  display: flex;
  height: 100%;
}

.czaty-main {
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 100%;
}

.czaty-main-frame {
  grid-column: 1;
  grid-row: 1 / span 2;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px;
}

.czaty-message {
  margin-bottom: 12px;
  font-size: 14px;
}

.czaty-message .text {
  background: #eef7ff;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
  max-width: 70%;
}

.czaty-message .user {
  font-weight: bold;
  margin-bottom: 4px;
}

.czaty-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.czaty-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.czaty-podglad {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.czaty-podglad .label {
  font-size: 13px;
}

.czaty-podglad img {
  width: 24px;
  height: 24px;
}

.czaty-podglad:hover {
  background: #e6f2ff;
}

.czaty-podglady {
  border-left: 1px solid #ccc;
  background: #f9f9f9;
  padding: 10px;
  overflow-y: auto;
}

.czaty-podglady-scroll {
  overflow-y: auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.czaty-sidebar {
  width: 320px;
  border-right: 1px solid #e0e0e0;
  padding: 16px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
}

.czaty-sidebar .czat-lista {
  flex: 1 1 auto;
  overflow-y: auto;
}

.czaty-wrapper {
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: 1fr auto;
  gap: 10px;
  height: calc(100vh - 112px);
  padding: 10px;
}

.dashboard-grid {
  display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-grid-4x2 {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
}

.dashboard-tile {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-tile canvas {
  flex: 1;
  max-height: 180px;
}

.dashboard-tile h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #333;
}

.dashboard-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.date {
  font-size: 12px;
  color: #555;
}

.drop-overlay {
  display:flex;
}

.drop-zone {
  border:2px dashed #ccc;
  border-radius:6px;
}

.drop-zone.drag-over {
  border-color:#007bff;
}

.drop-zone.drag-over .drop-overlay {
  display:flex !important;
}

.dzwoniacy-kontakt {
  animation: miganieKontakt 0.8s infinite alternate;
  border: 2px solid orange !important;
}

.emoji-kategoria span {
  font-size: 20px;
    margin: 4px;
    cursor: pointer;
}

.emoji-popup {
  background: #fff;
  border: 1px solid #ccc;
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 9999;
}

.emoji-popup span {
  font-size: 20px;
  margin: 4px;
  cursor: pointer;
}

.etykieta-btn.active {
  background: #2563eb;
  color: white;
  border-color: #1e40af;
}

.filter-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.filter-grid-2, .filter-grid-4 {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.filter-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.filter-input {
  border: 1px solid #ccc;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

.firma-nazwa {
  display: block;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.flex.gap-2 > .crm-btn {
  margin-right: 6px;
}

.folder-tile {
  background: #f2f2f2;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
  border: 1px solid #ddd;
}

.folder-tile.active {
  background: #d0eaff;
  font-weight: 700;
  color: #004a8f;
  border-color: #89c3ff;
}

.folder-tile:hover {
  background: #e0f4ff;
}

.form-col {
  display: flex;
  flex-direction: column;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.form-grid input, .form-grid select {
  width: 100%;
}

.form-grid label {
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-row {
  margin-bottom: 12px;
}

.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="password"], .form-row input[type="file"] {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
}

.form-row label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}

.form-row.full-width {
  margin-top: 12px;
}

.gap-1 {
  gap: 4px;
}

.general-chats {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.general-chats__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.general-chats__item {
  border-bottom: 1px solid #eee;
  padding: 12px 0;
}

.general-chats__item:last-child {
  border-bottom: none;
}

.general-chats__message {
  margin: 0;
  color: #555;
  line-height: 1.4;
}

.general-chats__time {
  font-size: 0.875rem;
  color: #999;
}

.general-chats__title {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: #333;
}

.general-chats__user {
  font-weight: 600;
  color: #222;
}

.gpt-builder-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
}

.gpt-builder-grid {
  display: grid;
  grid-template-columns: 280px 1fr 500px;
  gap: 10px;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.gpt-builder-row {
  flex-shrink: 0;
}

.gpt-builder-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.gpt-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gpt-chat-actions {
  display: flex;
  gap: 8px;
}

.gpt-chat-form {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: #fafafa;
  border-top: 1px solid #ddd;
}

.gpt-chat-form textarea {
  resize: vertical;
  min-height: 60px;
  margin-bottom: 8px;
  padding: 8px;
}

.gpt-chat-header {
  flex-shrink: 0;
  padding: 10px;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
}

.gpt-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.gpt-main-tab {
  padding: 6px 12px;
  background: #f2f2f2;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
}

.gpt-main-tab.active {
  background: #fff;
  border-bottom: 2px solid #000;
}

.gpt-main-tabs {
  position: relative;
  z-index: 10;
  left: unset;
  right: unset;
  height: var(--tabbar-height);
  background: #fafafa;
  z-index: 1;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #ddd;
}

.gpt-main.canvas-visible {
  display: flex;
  flex-direction: row;
}

.gpt-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  box-sizing: border-box;
}

.gpt-messages::-webkit-scrollbar {
  width: 6px;
}

.gpt-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.gpt-projects {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  background: #fdfdfd;
  border-right: 1px solid #ddd;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
  background: #fafafa;
}

.gpt-projects-header {
  flex-shrink: 0;
  padding: 10px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.gpt-tab {
  background: #f4f4f4;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  border: 1px solid #ccc;
  transition: all 0.2s ease;
}

.gpt-tab.active {
  background: #333;
  color: #fff;
  font-weight: bold;
  border-color: #222;
}

.gpt-tab:hover {
  background: #eaeaea;
}

.gpt-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.gpt-tabs-container {
  position: relative;
  z-index: 10;
  left: unset;
  right: unset;
  height: var(--tabbar-height);
  background: #fff;
  border-bottom: 1px solid #ddd;
  margin-bottom: 10px; 
  z-index: 1;
  padding: 5px 10px;
  display: flex;
  gap: 10px;
}

.gpt-tabs.active {
  display: flex;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.grid-4.kolumny {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.header-left-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.header-left-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  text-decoration: none;
  font-size: 12px;
  width: 60px;
  padding: 6px 0;          
  margin: 2px 0;
}

.header-left-menu a img {
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  object-fit: contain;
  margin-bottom: 4px;
}

.header-left-menu a span {
  color: #333;
  text-align: center;
}

.header-right-panel {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hidden {
  display: none;
}

.historia-filters .crm-btn {
  background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #6b7280;
}

.historia-filters .crm-btn.is-active {
  color: #22c55e !important; 
    font-weight: 700;
}

.historia-klienta {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.historia-komentarzy-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  border-top: 1px solid #ddd;
  padding-top: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.icon-btn img {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: #f0f0f0;
}

.icon-only {
  padding: 6px 8px;
  min-width: 36px;
  font-size: 18px;
  text-align: center;
}

.ilosc-btn {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  background-color: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
  cursor: pointer;
  font-weight: normal;
  min-width: 50px;
}

.ilosc-btn.aktywny {
  background-color: #22c55e;
  border-color: #22c55e;
  font-weight: bold;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.4);
}

.ilosc-btn:hover {
  background-color: #2563eb;
}

.input {
  padding: 6px 8px; font-size: 13px;
}

.input-mini {
  width: 100%;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.kafelek {
  min-width: 260px;
  max-width: 260px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kafelek canvas {
  max-height: 120px;
}

.kafelka-strzalka {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
}

.kafelka-strzalka.left {
  left: 4px;
}

.kafelka-strzalka.right {
  right: 4px;
}

.kafelka-strzalka:hover {
  background: #f3f4f6;
}

.kalkulator-box {
  max-width: 980px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.kalkulator-box-full {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.kalkulator-container {
  max-width: 100%;
  padding: 20px;
  box-sizing: border-box;
  background: #fff;
}

.kalkulator-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: end;
}

.kalkulator-panel {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
}

.kalkulator-row-2 {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 20px;
}

.kalkulator-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.kanban-view-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.kolumny-modal {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 0 10px #0002;
  border-radius: 10px;
}

.kolumny-modal .flex {
  display: flex;
  align-items: center;
}

.kolumny-modal .gap-2 {
  gap: 0.5rem;
}

.kolumny-modal .mt-2 {
  margin-top: 0.5rem;
}

.kolumny-modal button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.kolumny-modal button:hover {
  background: #e2e8f0;
}

.kolumny-modal h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.kolumny-sortowalne {
  list-style: none;
  padding: 0;
}

.kolumny-sortowalne li {
  padding: 5px;
  background: #eee;
  margin-bottom: 4px;
  cursor: grab;
}

.komentarz-box {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.komentarz-box textarea {
  flex: 1;
  height: 60px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px;
  resize: none;
}

.kontakt-dane {
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kontakt-edytuj {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-main);
}

.kontakt-edytuj:hover {
  text-decoration: underline;
}

.kontakt-input {
  flex: 1;
  min-width: 80px;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.kontakt-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  position: relative;
  transition: background 0.2s, box-shadow 0.2s;
}

.kontakt-item:hover {
  background-color: #f0f6ff;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.kontakt-licznik-tip pre {
  margin: 0; font-size: 11px; white-space: pre-wrap;
}

.kontakt-nazwa {
  font-weight: bold;
  font-size: 14px;
}

.kontakt-search-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.kontakt-search-wrapper .crm-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  min-width: 32px;
  font-size: 13px;
}

.kontakt-toolbar {
  position: sticky; top: 0; z-index: 2; background: #fff; padding: 6px;
}

.kontakt-toolbar .crm-btn.active-zakladka {
  background: #16a34a !important; 
  color: #fff !important; font-weight: 700 !important;
}

.kontakt-toolbar .crm-btn.icon-only {
  padding: 2px 6px;
  min-width: 30px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.kontakt-toolbar .crm-btn.icon-only.active-filtr {
  background-color: #22c55e !important;
  color: white !important;
  font-weight: bold;
  border: none;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3);
}

.kontakt-toolbar .crm-btn.icon-only:hover {
  background: #1e40af;
}

.kontakt-toolbar .toolbar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); 
  gap: 6px;
}

.kontakt-toolbar .toolbar-grid .crm-btn {
  width: 100%; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}

.konto-item {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.konto-item, .podglad-konto {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
}

.konto-item.active {
  background: #eef7ff;
  border-radius: 6px;
  padding: 6px;
}

.konto-item:hover {
  background: #f0f4ff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.krok {
  background: #fff;
  padding: 16px 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.krok h3 {
  margin-bottom: 10px;
}

.lead-actions-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-aktywny {
  background-color: #fef9c3 !important;
  border-left: 4px solid #facc15;
}

.lead-input {
  flex: 1;
  min-width: 80px;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.lead-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  min-height: 90px;
  box-sizing: border-box;
}

.lead-item.active-lead {
  background-color: #e0f2fe;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.lead-item:hover {
  background-color: #f0f6ff;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.lead-middle {
  font-size: 14px;
  font-weight: bold;
  color: #2b2b2b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-search-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.lead-search-wrapper .crm-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  min-width: 32px;
  font-size: 13px;
}

.lead-tags-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.lead-time-bold {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-main);
}

.lead-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

.lista-komentarzy {
  flex: 1;
  overflow-y: auto;
}

.lista-leadow {
  flex: 1;
  overflow-y: auto;
  padding-right: 24px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lista-mini {
  list-style: none;
  font-size: 13px;
  color: #444;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  max-height: 160px;
}

.lista-mini li {
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

.logo-img {
  height: 32px;
}

.logo-label {
  font-size: 11px;
  line-height: 1.2;
}

.logo-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: right;
}

.logo-mini img {
  width: 32px;
  height: auto;
}

.logo-text {
  font-size: 12px;
  line-height: 1.1;
  text-align: right;
}

.logo-top-text {
  font-size: 12px;
  color: #333;
  line-height: 1.2;
  font-weight: normal;
  white-space: nowrap;
}

.mail-item.selected {
  border: 2px solid #1976d2;
}

.mail-list-container {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.mail-read {
  background: #fff;
}

.mail-unread {
  background: #e6f2ff;
}

.mailing-buttons {
  margin-top: 1em;
}

.mailing-kategoria {
  font-weight: bold;
  width: 100px;
  flex-shrink: 0;
}

.mailing-label {
  display: inline-block;
  width: 90px;
  font-weight: bold;
}

.mailing-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding: 10px 16px;
}

.mailing-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5em;
}

.mailing-row .crm-btn {
  margin-right: 0.5em;
}

.mailing-sekcja {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mailing-statusy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mailing-wiersz {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mailing-wiersze {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.mb-2 {
  margin-bottom: 8px;
}

.message {
  max-width: 60%;
  margin: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #f1f1f1;
  font-size: 14px;
  line-height: 1.4;
}

.message-bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 18px;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.3;
}

.message-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.message-time {
  float: right;
  font-weight: normal;
  font-size: 11px;
}

.message.mine {
  background: #d2f4ff;
  margin-left: auto;
}

.message.theirs {
  background: #eaeaea;
}

.mini-btn {
  padding: 3px 8px;
  font-size: 12px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.mini-btn.danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.mini-btn:hover {
  background: #ddd;
}

.modal-kolumna-entry {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.modal-kolumna-entry .nazwa-techniczna {
  width: 140px;
  font-size: 12px;
  color: #666;
}

.modal-kolumna-entry input.alias-input {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #0005;
  z-index: 999;
}

.msg-badge {
  font-size: 11px;
  color: #f00;
  text-align: right;
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.multiline-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.notatka-tekstowa {
  width: 100%;
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  resize: vertical;
  min-height: 100px;
}

.oferty-grid {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 0;
}

.oferty-karuzela {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 8px;
}

.oferty-karuzela::-webkit-scrollbar {
  height: 6px;
}

.oferty-karuzela::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.oferty-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 10px;
}

.offer-card {
  border: 2px solid #ccc;
  border-radius: 10px;
  margin: 10px;
  padding: 12px;
  background: #f9f9f9;
  display: inline-block;
  min-width: 200px;
}

.offer-card .card-content p {
  margin: 6px 0;
  font-size: 14px;
}

.offer-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.operator-box {
  width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    user-select: none;
}

.operator-btn {
  padding: 6px 12px;
  font-weight: bold;
  background: #f0f8ff;
  border: 1px solid #007bff;
  color: #007bff;
  border-radius: 5px;
  cursor: pointer;
}

.operator-btn.active {
  background: #007bff;
  color: white;
}

.operator-grid {
  display: flex;
    gap: 8px;
    margin-top: 12px;
}

.operator-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.operator-select {
  
}

.p-12 {
  padding: 12px;
}

.p-16 {
  padding: 16px;
}

.panel-lewo, .panel-prawo {
  display: flex;
  gap: 10px;
}

.panel-loading {
  padding: 12px;
  font-style: italic;
  color: #888;
  font-size: 14px;
}

.panel-prawo {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.panel-telefonu-top {
  background: #f3f4f6;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-left: 12px;
}

.panel-telefonu-top button {
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.panel-telefonu-top.aktywny {
  background: #d1fae5;
}

.panel-telefonu-top.nieodebrane {
  animation: migaj 1s infinite alternate;
}

.panel-toggle img {
  transform: rotate(180deg); 
  cursor: pointer;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.panel-toggle img:hover {
  opacity: 1;
  transform: rotate(180deg) scale(1.1);
}

.panel-wrapper-telefonu {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
}

.panel-zarzadzania-icons {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  padding: 0 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-zarzadzania-icons .mailing-row {
  display: flex;
  align-items: center;
  clear: both;             
  margin-bottom: 0.5em;
}

.panel-zarzadzania-icons .mailing-row:nth-of-type(3) {
  margin-top: 1em;
}

.popup-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.popup-backdrop {
  position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.popup-box {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-box .crm-btn {
  padding: 6px 16px;
  font-weight: 500;
  border-radius: 6px;
}

.popup-box .crm-btn.danger {
  background: #e74c3c;
  color: white;
}

.popup-box .crm-btn.danger:hover {
  background: #c0392b;
}

.popup-box .crm-input {
  margin-bottom: 4px !important;
}

.popup-box input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.popup-box input, .popup-box select {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.popup-box input[type="file"] {
  margin: 10px 0;
}

.popup-box label {
  margin-top: 6px !important;
  margin-bottom: 2px !important;
}

.popup-box textarea {
  resize: vertical;
  min-height: 140px;
  padding: 8px;
  border: 1px solid #ccc;
  font-size: 13px;
  border-radius: 6px;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.powiad-alert {
  animation: fadeInOut 3s ease-in-out;
}

.powiadomienie-item {
  transition: background 0.2s;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.powiadomienie-item .bg-blue-50 {
  background-color: #eff6ff;
}

.powiadomienie-item .bg-white {
  background-color: white;
}

.powiadomienie-item .font-semibold {
  font-weight: 600;
  color: #1f2937;
}

.powiadomienie-item .text-blue-600 {
  color: #2563eb;
}

.powiadomienie-item .text-blue-600:hover {
  text-decoration: underline;
}

.powiadomienie-item .text-gray-400 {
  font-size: 11px;
  color: #9ca3af;
}

.powiadomienie-item .text-red-400 {
  color: #f87171;
}

.powiadomienie-item .text-red-400:hover {
  color: #dc2626;
}

.powiadomienie-item .text-sm {
  font-size: 13px;
  line-height: 1.25rem;
}

.powiadomienie-item img {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  object-fit: cover;
  margin-top: 4px;
}

.powiadomienie-item:hover {
  background-color: #e0f2fe;
}

.profile-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-container .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.profile-container img.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.profile-text {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.progress-bar-wrapper {
  width: 100%;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
  height: 20px;
}

.progress-info {
  font-size: 12px;
  color: #555;
  margin-top: 5px;
  text-align: center;
}

.przyciski-mailingowe {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.quick-panel {
  position: fixed;
  top: 64px;
  right: 0;
  width: 280px;
  height: calc(100% - 64px);
  background: #fff;
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
  transform: translateX(100%); 
  transition: transform 0.3s ease;
  z-index: 998;
  display: flex;
  flex-direction: column;
}

.quick-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.quick-panel-content p {
  margin-bottom: 12px;
  font-size: 13px;
  color: #555;
}

.quick-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  font-weight: bold;
  border-bottom: 1px solid var(--color-border);
}

.quick-panel-header .panel-toggle img {
  width: 18px;
  height: 18px;
  filter: invert(40%);
  opacity: 0.6;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.quick-panel-header .panel-toggle img:hover {
  opacity: 1;
  transform: scale(1.1);
}

.quick-panel:not(.collapsed) {
  transform: translateX(-60px);
}

.radio-row {
  display: flex;
  gap: 20px;
  margin-top: 6px;
}

.readonly-label {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f7f7f7;
  font-size: 13px;
  white-space: nowrap;
}

.right-panel-icons {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 999; 
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

.right-panel-icons .icon {
  width: 42px;
  height: 42px;
  background-color: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.right-panel-icons .icon .badge {
  background: red;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 4px;
}

.right-panel-icons .icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.right-panel-icons .icon, .right-panel-icons .quick-icon {
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.right-panel-icons .icon:hover {
  background-color: #f0f4ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.right-panel-icons .icon:hover, .right-panel-icons .quick-icon:hover {
  background-color: #f0f0f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rodo-box {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.rodo-box-boxed {
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
}

.rodo-box-boxed.gray {
  background: #e5e7eb;
  color: #374151;
  border-color: #d1d5db;
}

.rodo-box-boxed.green {
  background: #d1fae5;
  color: #065f46;
  border-color: #34d399;
}

.rodo-box-boxed.orange {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.rodo-box.active {
  outline: 2px solid black;
}

.rodo-box.gray {
  background-color: #f3f4f6;
  color: #6b7280;
}

.rodo-box.green {
  background-color: #dcfce7;
  color: #14532d;
}

.rodo-box.orange {
  background-color: #fef3c7;
  color: #92400e;
}

.rounded {
  border-radius: 4px;
}

.rozliczenia-wrapper {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f4f6f8;
  padding: 12px 16px;
}

.rozliczenia-wrapper h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  padding-bottom: 6px;
}

.section .flex.items-center.justify-between {
  min-height: 36px;
  align-items: center;
}

.section .flex.items-center.justify-between .text-lg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sekcja-naglowek {
  background: white;
  z-index: 10;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 600;
}

.statusy-mailing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 5px;
}

.subfilters .mini-btn {
  font-size: 12px;
  padding: 4px 8px;
  margin-right: 6px;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #ccc;
}

.subfilters .mini-btn.active {
  background: #d0eaff;
  border-color: #005699;
  color: #005699;
}

.subtab-zakladka.active-zakladka {
  background-color: #16a34a !important;
  color: white !important;
  font-weight: bold !important;
}

.suggestion {
  padding: 6px 10px;
  cursor: pointer;
}

.suggestion-box {
  border: 1px solid #ccc;
  background: white;
  position: absolute;
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
}

.szczegoly-rozliczen {
  max-height: 220px;
  overflow-y: auto;
}

.szczegoly-rozliczen table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.szczegoly-rozliczen td, .szczegoly-rozliczen th {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
}

.szczegoly-rozliczen th {
  background: #f9fafb;
  font-weight: 600;
  text-align: left;
}

.tab-menu .crm-btn, .sub-tab-menu .crm-btn {
  margin-right: 8px;
  margin-bottom: 4px;
}

.tab-zakladka.active-zakladka {
  background-color: #16a34a !important; 
  color: white !important;
  font-weight: bold !important;
}

.tablica-content {
  padding: 20px;
}

.tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

.tag-rodzaj {
  background: #28a745;
}

.tag-zrodlo {
  background: #007bff;
}

.taryfy-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.taryfy-box, .operator-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.taryfy-grid, .promocje-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.text-lg {
  font-size: 16px;
}

.text-small {
  font-size: 13px;
}

.tile-buttons {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.tile-buttons button {
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.tile-buttons button.active {
  background: #4caf50;
  color: white;
  border: 1px solid #4caf50;
}

.tile-buttons button:hover {
  background: #4caf50;
  color: white;
  transform: scale(1.05);
}

.time-date {
  text-align: right;
}

.time-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 12px;
  text-align: center;
}

.topbar-dropdown {
  position: relative;
  display: inline-block;
}

.topbar-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 8px 0;
  z-index: 100;
}

.topbar-dropdown .dropdown-menu a {
  display: block;
  padding: 6px 16px;
  white-space: nowrap;
  color: #333;
  text-decoration: none;
}

.topbar-dropdown .dropdown-menu a:hover {
  background-color: #f5f5f5;
}

.topbar-dropdown:hover .dropdown-menu {
  display: block;
}

.topbar-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  min-width: 60px; 
  transition: transform 0.2s ease;
  padding: 2px;
}

.topbar-icon img {
  width: 32px;
  height: 32px;
}

.topbar-icon span {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
}

.topbar-icon.active {
  background: #e6f0ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.topbar-icon:hover {
  background: #eef2ff;
  box-shadow: 0 0 0 2px #cbdafe;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-nav {
  display: flex;
  align-items: flex-end;
  gap: 28px; 
  margin-left: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-left: auto;
}

.topbar-search {
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 220px;
}

.tryb-btn, .ilosc-btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 4px;
}

.ukryj {
  display: none !important;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-form .form-row {
  display: flex;
  flex-direction: column;
}

.user-form .form-row input {
  padding: 6px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.user-form .form-row label {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
}

.user-form .form-row.full-width {
  margin-top: 16px;
}

.user-popup {
  position: fixed;
  top: 64px;
  right: 0;
  width: 360px;
  background: #fff;
  padding: 24px;
  border-left: 1px solid #ccc;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  display: none;
}

.user-popup .close-button {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  align-self: flex-end;
}

.user-popup-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.uslugi-btn {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  background-color: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
  cursor: pointer;
  font-weight: normal;
  min-width: 50px;
  box-shadow: none;
}

.uslugi-btn.aktywny {
  background-color: #22c55e;
  border-color: #22c55e;
  font-weight: bold;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.4);
}

.uslugi-btn:hover {
  background-color: #2563eb;
}

.zgoda-btn {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
}

.zgoda-czerwona.active {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

.zgoda-nieaktywna.active {
  background: #e2e8f0;
  color: #333;
  border-color: #cbd5e1;
}

.zgoda-zielona.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

body > .crm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body, main.crm-main, section.crm-content, .crm-grid, .col-main, #main-content, #admin-section-container {
  background: #fff !important;
}

body.canvas-open .crm-grid {
  grid-template-columns: 320px 1fr 400px;
}

body.canvas-open .gpt-builder-grid {
  grid-template-columns: 280px 1fr 500px;
}

body.gpt-builder {
  overflow: hidden;
}

body.panel-open .canvas-panel.pinned {
  right: var(--canvas-width);
}

body.panel-open .canvas-panel:not(.pinned) {
  right: 0;
}

body.panel-open .gpt-main-tabs, body.panel-open .gpt-tabs-container, body.panel-open .crm-main, body.panel-open .gpt-main {
  right: var(--canvas-width);
}

button.crm-btn.icon-only.plus-only {
  background-color: #2563eb !important;
  color: #fff !important;
  font-weight: bold;
  font-size: 18px;
  padding: 6px 10px;
  min-width: 36px;
  text-align: center;
  border-radius: 6px;
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

button.crm-btn.icon-only.plus-only * {
  color: #fff !important;
  fill: #fff !important;
}

button.crm-btn.icon-only.plus-only:hover {
  background-color: #1e40af !important;
}

button.text-blue-600 {
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
}

button.text-blue-600:hover {
  text-decoration: underline;
}

h4.text-base {
  font-size: 16px;
  margin: 0;
}

html, body, .crm-layout {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

section.admin-panel {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes talking {
  0%   { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes thinking {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@keyframes blinkAvatar {
  0%, 90%, 100% { filter: brightness(1); }
  92%, 94% { filter: brightness(0.4); }
}

@keyframes floatAvatar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pulseAvatar {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes migaj {
  from { background: #fef2f2; }
  to { background: #fee2e2; }
}

@keyframes miganieKontakt {
  from { box-shadow: 0 0 6px orange; }
  to { box-shadow: 0 0 12px orange; }
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes przesun-w-lewo {
  0% { left: -100%; }
  50% { left: 10px; }
  100% { left: -100%; }
}

@keyframes banerWprawo {
  0% { left: -100%; opacity: 0; }
  10% { opacity: 1; }
  50% { left: 10px; opacity: 1; }
  90% { opacity: 1; }
  100% { left: -100%; opacity: 0; }
}

@keyframes banerMrugaj {
  0%   { left: -100%; opacity: 0; }
  10%  { opacity: 1; }
  20%  { background-color: #10b981; color: #dc2626; }
  30%  { background-color: #dc2626; color: #10b981; }
  40%  { background-color: #10b981; color: #dc2626; }
  50%  { left: 10px; opacity: 1; }
  90%  { opacity: 1; }
  100% { left: -100%; opacity: 0; }
}

#zamowienia-tabela {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
}

#zamowienia-tabela table {
  min-width: max-content;
}


/* wspólne style tabel CRM */
.crm-table-firma {
  max-width: 220px;       /* szerokość kolumny – można dostosować */
  white-space: normal;    /* zawijanie wierszy */
  word-break: break-word; /* łamanie długich słów */
}
/* === CRM: wspólne style tabel (spójne z Zamówieniami i Magazynem kart SIM) === */
:root{
  --crm-table-font-size: 13px;
  --crm-table-cell-px: 8px;
  --crm-table-border: #eee;
  --crm-table-head-bg: #fff;
  --crm-table-head2-bg: #fafafa;
  --crm-table-hover: #f7f7f7;
  --crm-table-zebra: #fcfcfc;
  --crm-table-head-height: 36px;    /* 1. wiersz nagłówka */
}

/* Kontener ze scrollami (jak w Zamówieniach) */
.crm-table-wrap{
  overflow-x:auto; overflow-y:auto;
  border:1px solid #e5e7eb; border-radius:4px;
  background:#fff;
  max-height: calc(100vh - 180px);   /* dostosuj w razie potrzeby */
}

/* Sama tabela (jak w Magazynie: min-width + collapse) */
.crm-list-table{
  width:max(1200px,100%);
  min-width:1200px;
  border-collapse:collapse;
  font-size:var(--crm-table-font-size);
  background:#fff;
}

/* Komórki */
.crm-list-table th,
.crm-list-table td{
  padding:var(--crm-table-cell-px);
  white-space:nowrap;
  border-bottom:1px solid var(--crm-table-border);
}

/* Sticky head – wiersz 1 i 2 (jak w Magazynie) */
.crm-list-table thead tr.head-row-1 th{
  position:sticky; top:0; z-index:3;
  background:var(--crm-table-head-bg);
}
.crm-list-table thead tr.head-row-2 th{
  position:sticky; top:var(--crm-table-head-height); z-index:2;
  background:var(--crm-table-head2-bg);
}

/* Strzałka sortowania */
.crm-th-sort{ cursor:pointer; user-select:none; }
.crm-th-sort .th-arrow{ opacity:.5; margin-left:6px; }

/* Filtry w nagłówku 2 */
.crm-table-filter,
.crm-table-select{
  width:100%; box-sizing:border-box;
  font-size:12px; padding:4px;
  border:1px solid #ddd; border-radius:4px;
  background:#fff;
}

/* Zebra + hover */
.crm-list-table tbody tr:nth-child(even){ background:var(--crm-table-zebra); }
.crm-list-table tbody tr:hover{ background:var(--crm-table-hover); }

/* Kolumna z checkboxami przy selekcji */
.crm-table--selectable th:first-child,
.crm-table--selectable td:first-child{
  text-align:center; width:42px;
}

/* Drobne ułatwienia */
.crm-table-sm th,.crm-table-sm td{ padding:6px; }

/* ===== Duży czat – skin spójny z QuickChat ===== */
.chat-message.chat-message--mine .message-bubble {
  background: #2563eb !important; border: 1px solid #1d4ed8 !important; color: #fff !important;
  border-radius: 14px 14px 4px 14px;
  margin-left:auto;
}
.chat-message.chat-message--other .message-bubble {
  background: #16a34a !important; border: 1px solid #15803d !important; color: #fff !important;
  border-radius: 14px 14px 14px 4px;
  margin-right:auto;
}

/* Cytaty */
.chat-message .quoted-card {
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #eef2f7 !important;
  border-left: 3px solid #cbd5e1 !important;
  color: #0f172a !important;
}
.chat-message.chat-message--mine .quoted-card {
  background: rgba(147,197,253,0.22) !important;
  border-left-color: #93c5fd !important;
}
.chat-message.chat-message--other .quoted-card {
  background: rgba(187,247,208,0.24) !important;
  border-left-color: #86efac !important;
}
/* ========= DUŻY CZAT: poprawione cytowanie + avatar ========= */

/* Twoje wiadomości (mine) */
.chat-message.chat-message--mine {
  display: flex;
  flex-direction: row-reverse; /* avatar po prawej */
  align-items: flex-end;
  margin-left: auto;
}
.chat-message.chat-message--mine .chat-msg-avatar {
  margin-left: 8px; /* odstęp od bąbla */
  margin-right: 0;
}

/* Wiadomości innych (other) */
.chat-message.chat-message--other {
  display: flex;
  flex-direction: row; /* avatar po lewej */
  align-items: flex-end;
  margin-right: auto;
}
.chat-message.chat-message--other .chat-msg-avatar {
  margin-right: 8px;
  margin-left: 0;
}

/* Cytaty (quoted-card) */
.chat-message.chat-message--mine .quoted-card {
  background: rgba(147,197,253,0.22) !important; /* jasnoniebieski */
  border-left: 3px solid #93c5fd !important;
  color: #0f172a !important;
}
.chat-message.chat-message--other .quoted-card {
  background: rgba(187,247,208,0.24) !important; /* jasnozielony */
  border-left: 3px solid #86efac !important;
  color: #0f172a !important;
}
/* Kontenery wiadomości → flex */
#chat-messages .chat-message,
#mini-chat-messages .chat-message {
  display: flex !important;
  align-items: flex-end !important;
  gap: 10px !important;
}

/* Moje: avatar i bąbel po PRAWEJ (bez row-reverse) */
#chat-messages .chat-message.chat-message--mine,
#mini-chat-messages .chat-message.chat-message--mine {
  justify-content: flex-end !important;
  margin-left: auto !important;
}
#chat-messages .chat-message.chat-message--mine .chat-msg-avatar,
#mini-chat-messages .chat-message.chat-message--mine .chat-msg-avatar {
  margin-left: 8px !important; margin-right: 0 !important;
}

/* Cudze: avatar i bąbel po LEWEJ */
#chat-messages .chat-message.chat-message--other,
#mini-chat-messages .chat-message.chat-message--other {
  justify-content: flex-start !important;
  margin-right: auto !important;
}
#chat-messages .chat-message.chat-message--other .chat-msg-avatar,
#mini-chat-messages .chat-message.chat-message--other .chat-msg-avatar {
  margin-right: 8px !important; margin-left: 0 !important;
}

/* Upewnij rozmiar avatara */
#chat-messages .chat-msg-avatar,
#mini-chat-messages .chat-msg-avatar {
  width: 28px !important; height: 28px !important;
  border-radius: 50% !important; object-fit: cover !important;
}

/* Kolory bąbli */
#chat-messages .chat-message.chat-message--mine .message-bubble,
#mini-chat-messages .chat-message.chat-message--mine .message-bubble {
  background: #2563eb !important; border: 1px solid #1d4ed8 !important; color: #fff !important;
  border-radius: 14px 14px 4px 14px !important; margin-left: auto !important; max-width: 72ch !important;
}
#chat-messages .chat-message.chat-message--other .message-bubble,
#mini-chat-messages .chat-message.chat-message--other .message-bubble {
  background: #16a34a !important; border: 1px solid #15803d !important; color: #fff !important;
  border-radius: 14px 14px 14px 4px !important; margin-right: auto !important; max-width: 72ch !important;
}

/* QUOTED-CARD (z reply markerów) – jasne warianty */
#chat-messages .chat-message .quoted-card,
#mini-chat-messages .chat-message .quoted-card {
  border-radius: 8px !important; padding: 8px 10px !important; margin-bottom: 8px !important;
  color: #0f172a !important; background: #eef2f7 !important; border-left: 3px solid #cbd5e1 !important;
}
#chat-messages .chat-message.chat-message--mine .quoted-card,
#mini-chat-messages .chat-message.chat-message--mine .quoted-card {
  background: rgba(147,197,253,0.22) !important; border-left-color: #93c5fd !important;
}
#chat-messages .chat-message.chat-message--other .quoted-card,
#mini-chat-messages .chat-message.chat-message--other .quoted-card {
  background: rgba(187,247,208,0.24) !important; border-left-color: #86efac !important;
}

/* QC-QUOTE (Markdown '> ...') – te same jasne warianty */
#chat-messages .chat-message .qc-quote,
#mini-chat-messages .chat-message .qc-quote {
  margin: 6px 0 !important; padding: 6px 8px !important; border-left: 3px solid #cbd5e1 !important;
  border-radius: 6px !important; background: #f6f8fb !important; color:#0f172a !important;
}
#chat-messages .chat-message.chat-message--mine .qc-quote,
#mini-chat-messages .chat-message.chat-message--mine .qc-quote {
  background: rgba(147,197,253,0.22) !important; border-left-color:#93c5fd !important;
}
#chat-messages .chat-message.chat-message--other .qc-quote,
#mini-chat-messages .chat-message.chat-message--other .qc-quote {
  background: rgba(187,247,208,0.24) !important; border-left-color:#86efac !important;
}

/* Linki – czytelność */
#chat-messages .message-bubble a,
#mini-chat-messages .message-bubble a { color:#fff !important; text-decoration: underline; }
#chat-messages .chat-message .quoted-card a,
#mini-chat-messages .chat-message .quoted-card a,
#chat-messages .chat-message .qc-quote a,
#mini-chat-messages .chat-message .qc-quote a { color:#0f172a !important; }
/* --- MOJE WIADOMOŚCI: avatar po PRAWEJ, bąbel po lewej od avatara --- */
#chat-messages .chat-message.chat-message--mine,
#mini-chat-messages .chat-message.chat-message--mine {
  display:flex !important;
  justify-content:flex-end !important;   /* cała wiadomość doklejona do prawej */
  gap:10px !important;
  margin-left:auto !important;
}
#chat-messages .chat-message.chat-message--mine .message-bubble,
#mini-chat-messages .chat-message.chat-message--mine .message-bubble { order:1; }
#chat-messages .chat-message.chat-message--mine .chat-msg-avatar,
#mini-chat-messages .chat-message.chat-message--mine .chat-msg-avatar {
  order:2;                    /* avatar NA PRAWO od bąbla */
  margin-left:8px !important; /* odstęp od bąbla */
  margin-right:0 !important;
}

/* --- CYTATY: biały tekst + białe linki, jasne tła jak wcześniej --- */
#chat-messages .chat-message .quoted-card,
#mini-chat-messages .chat-message .quoted-card,
#chat-messages .chat-message .qc-quote,
#mini-chat-messages .chat-message .qc-quote {
  color:#fff !important;                          /* BIAŁY TEKST */
}
#chat-messages .chat-message .quoted-card a,
#mini-chat-messages .chat-message .quoted-card a,
#chat-messages .chat-message .qc-quote a,
#mini-chat-messages .chat-message .qc-quote a {
  color:#fff !important; text-decoration:underline;
}

/* Jasnoniebieski cytat w moich bąblach */
#chat-messages .chat-message.chat-message--mine .quoted-card,
#mini-chat-messages .chat-message.chat-message--mine .quoted-card,
#chat-messages .chat-message.chat-message--mine .qc-quote,
#mini-chat-messages .chat-message.chat-message--mine .qc-quote {
  background: rgba(147,197,253,0.22) !important;
  border-left-color:#93c5fd !important;
}

/* Jasnozielony cytat w cudzych bąblach */
#chat-messages .chat-message.chat-message--other .quoted-card,
#mini-chat-messages .chat-message.chat-message--other .quoted-card,
#chat-messages .chat-message.chat-message--other .qc-quote,
#mini-chat-messages .chat-message.chat-message--other .qc-quote {
  background: rgba(187,247,208,0.24) !important;
  border-left-color:#86efac !important;
}
/* ==== QUOTES (global) – biały tekst ==== */
.quoted-card{
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
  color:#fff !important;                         /* ← biały tekst */
  background: rgba(100,116,139,0.35) !important; /* neutralny fallback */
  border-left:3px solid rgba(255,255,255,0.55) !important;
}
.quoted-card, .quoted-card * { color:#fff !important; }     /* linki itp. też białe */
.quoted-card a { text-decoration:underline; }

/* warianty (kontrast nieco ciemniejszy niż wcześniej) */
.quoted-card.mine{
  background: rgba(37, 99, 235, 0.38) !important; /* 🔵 nieco ciemniejsze */
  border-left: 3px solid rgba(147,197,253,0.95) !important;
}
.quoted-card.other{
  background: rgba(22, 163, 74, 0.38) !important; /* 🟢 nieco ciemniejsze */
  border-left: 3px solid rgba(134,239,172,0.95) !important;
}

/* fallback: jeśli kolor nadaje rodzic */
.msg--mine  .quoted-card,
.message.mine .quoted-card,
.bubble.mine .quoted-card { background: rgba(37,99,235,0.38) !important; border-left: 3px solid rgba(147,197,253,0.95) !important; }
.msg--other .quoted-card,
.message.other .quoted-card,
.bubble.other .quoted-card { background: rgba(22,163,74,0.38) !important; border-left: 3px solid rgba(134,239,172,0.95) !important; }

.chat-message.chat-message--mine {
  justify-content: flex-end;   /* moje wiadomości z prawej */
  margin-left: auto;
  gap: 10px;
}
.chat-message.chat-message--other {
  justify-content: flex-start; /* cudze z lewej */
  margin-right: auto;
  gap: 10px;
}
/* meta nad treścią */
.message-bubble .message-meta{
  display:inline-block;
  font-size:12px;
  line-height:1.2;
  opacity:.92;
  margin-bottom:6px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.18);
  color:#fff;
}

/* w zielonym bąblu też czytelne */
.chat-message--other .message-bubble .message-meta{
  background: rgba(255,255,255,.18);
  color:#fff;
}

/* reakcje */
.msg-reactions .mini-btn{
  border:1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.18);
  color:#fff;
  border-radius:999px;
  padding:2px 8px;
  font-size:12px;
}
.chat-message--other .msg-reactions .mini-btn{
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.18);
  color:#fff;
}
.quoted-card.mine{
  background: rgba(37,99,235,0.28) !important;
  border-left:3px solid rgba(147,197,253,0.90) !important;
}
.quoted-card.other{
  background: rgba(22,163,74,0.28) !important;
  border-left:3px solid rgba(134,239,172,0.90) !important;
}
/* Lista czatów – powiększona wysokość */
.chat-lista, #czat-lista {
  max-height: calc(100vh - 180px) !important; /* było ~100vh - 260px */
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.czasowy-filtry .chip {
  border:1px solid #cbd5e1;
  border-radius:20px;
  background:#fff;
  padding:5px 14px;
  font-size:13px;
  color:#1e40af;
  cursor:pointer;
  transition:all .2s;
}
.czasowy-filtry .chip:hover {
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}
.czasowy-filtry .chip.active {
  background:#1d4ed8;
  color:#fff;
  border-color:#1d4ed8;
  box-shadow:0 2px 6px rgba(0,0,0,.2) inset;
}