a {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* глобально */
* {
  box-sizing: border-box;
}

	body {
	margin: 0;
	font-family: 'Jost', sans-serif;
	background: #f5f7fb;
	}

.doc-entry .star {
  margin-left: 8px; /* отступ слева от названия */
}
.sort-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.sort-block label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.sort-block select {
  max-width: 150px;
}

.dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}

.lead-actions-menu {
  position: relative;
}

.lead-dropdown {
  position: absolute;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 1000;
}

.dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item.danger {
  color: #d33;
}

.dropdown-item.danger:hover {
  background: #fdeaea;
}

.input {
  height: 36px;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

.btn-loader {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mfa-card {
  background: #fff;
  padding: 24px;
  width: 360px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

.mfa-card input {
  width: 100%;
  font-size: 18px;
  padding: 10px;
  margin: 12px 0;
  text-align: center;
}

.mfa-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}


@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

.mfa-card h3 {
  margin-bottom: 6px;
}

.mfa-card p {
  font-size: 13px;
  color: #555;
}

#mfa-code-input {
  margin: 16px 0;
  width: 100%;
  padding: 10px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
}

.mfa-timer {
  font-size: 12px;
  margin-bottom: 12px;
}

#mfa-resend-btn {
  margin-top: 6px;
  font-size: 12px;
}

.mfa-actions {
  display: flex;
  gap: 10px;
}

.mfa-actions button {
  flex: 1;
}

.mfa-actions .primary {
  background: #10b981;
  color: #fff;
}

@media (max-width: 820px) {
  .sort-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .sort-block label {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-block select {
    width: 100%;
  }
}

	
	@media (min-width: 769px) {
	  header {
		z-index: 1200;
		position: relative;
	  }
	}

	.navbtn-wrapper {
	  padding-top: 20px;
	  padding-left: 4px;
	  padding-right: 4px;
	  display: flex;
	  flex-direction: column;
	}

  .nav-summary-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
    position: relative;
    top: -1px;
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  details[open] > summary .nav-summary-icon {
    transform: scale(1.1);
    opacity: 1;
  }

  /* Подкатегории в навигации */
  .nav-group summary {
    list-style: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
  }

  .nav-group summary::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.2s ease;
    vertical-align: middle;
  }

  .nav-group[open] > summary::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233B485A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'/%3E%3C/svg%3E");
    transform: rotate(180deg);
  }

  .nav-group:not([open]) > summary::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233B485A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    transform: rotate(270deg);
  }

/* Группы навигации (Surrogates, БИО, Крио) */
.nav-group {
  margin: 6px 0;               /* небольшой отступ сверху/снизу */
}

.nav-group summary {
  list-style: none;             /* убираем стандартный треугольник */
  cursor: pointer;
  padding: 6px 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.nav-group summary::-webkit-details-marker {
  display: none; /* скрыть дефолтный маркер */
}

.nav-subgroup {
  padding-left: 22px;           /* 🔹 смещение подгрупп вправо */
  display: flex;
  flex-direction: column;
  gap: 4px;                     /* 🔹 расстояние между пунктами */
  margin: 4px 0 6px 0;
}

.nav-subgroup .navbtn {
  font-size: 14px;
  padding: 4px 10px;
}

  .nav-subgroup {
    display: flex;
    flex-direction: column;
    padding-left: 12px;
    border-left: 2px dashed #ddd;
    margin-left: 6px;
    margin-top: 4px;
  }

  .nav-subgroup .navbtn {
    padding-left: 24px;
    font-size: 15px;
  }

	.navbtn {
	  font-family: 'Jost', sans-serif;
	  display: block;
	  width: 100%;
	  margin: 6px 0;        /* 👈 уменьшили вертикальный отступ */
	  padding: 10px 12px;
	  background: none;
	  border: none;
	  font-size: 16px;
	  text-align: left;
	  color: #333;
	  cursor: pointer;
	  transition: background 0.2s ease;
	}

	.navbtn:hover { 
	background-color: #f2f2f2;
	color: #333;	
	}

	.navbtn.active {
	  background-color: #e0f7f1;
	  font-weight: 600;
	  color: var(--primary-color);
	  border-left: none;
	  border-radius: 12px;
	  position: relative;
	  padding-left: 32px;
	}

	.navbtn.active::before {
	  content: '';
	  position: absolute;
	  left: 14px;
	  top: 50%;
	  transform: translateY(-50%);
	  width: 8px;
	  height: 8px;
	  background-color: var(--primary-color);
	  border-radius: 50%;
	}

  @media (max-width: 820px) {
    nav {
      position: fixed !important;
      top: 0;
      left: -300px !important; /* ✅ прячем полностью */
      width: 250px;
      height: 100%;
      transition: left 0.3s ease;
      z-index: 1100;
      background: white;
      box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    nav.open {
      left: 0 !important;
    }

    nav.closed {
      left: -300px !important;
    }

    .menu-toggle {
      display: block;
      position: relative;
      background: none;
      border: none;
      font-size: 26px;
      color: black;
      margin-right: auto;
      margin-left: 8px;
      z-index: 10001;
    }

    main {
      margin-left: 0 !important;
      padding: 20px;
    }

    .btn,
    .ack-btn:not(.red) {
      width: 100%;
      box-sizing: border-box;
      margin-top: 8px;
    }

    .ack-btn.red {
      width: auto;
      padding: 10px;
      border-radius: 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-top: 10px;
    }

    .upload-row {
      flex-direction: column;
      align-items: stretch;
    }

    body {
      font-size: 14px;
    }

    input,
    select {
      font-size: 14px;         /* 👈 уменьшен размер в select */
      padding: 10px 14px;      /* 👈 компактнее */
      box-sizing: border-box;
    }

    .section h2 {
      font-size: 20px;
      margin-bottom: 12px;
    }

    #auth-section {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 8px;
    }

    #auth-section span,
    #auth-section button {
      font-size: 14px;
      margin-top: 6px;
    }

    #login-form .btn {
      padding: 10px 20px;
      font-size: 14px;
      width: auto;
    }
  }

    #login-form { 
    text-align: center; 
    margin-top: 50px; 
    }
    
  /* Мобильная адаптация — в столбик */
  @media (max-width: 600px) {
    .login-form {
      flex-direction: column;
      align-items: stretch;
    }
  }

	main { 
	padding: 20px; 
	}

	.section { 
	background: white; 
	padding: 20px; 
	margin-bottom: 20px; 
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	}

	.section h2 { 
	margin-top: 0; 
	}
  
	.btn { 
	background-color: #1a2a6c; 
	color: white; 
	padding: 8px 16px; 
	border: none; 
	border-radius: 6px; 
	cursor: pointer; 
	}
	.btn:hover { 
	background-color: #233a94; 
	}
	.link { 
	color: #1a2a6c; 
	text-decoration: none; 
	font-weight: 500; 
	}

	button.ack-btn {
	background-color: #0a8754;
	color: white;
	padding: 6px 12px;
	border: none;
	border-radius: 6px;
	margin-top: 6px;
	cursor: pointer;
	}
	button.ack-btn:hover {
	background-color: #08794a;
	}
	.acknowledged {
	color: green;
	font-weight: bold;
	margin-left: 6px;
	}
	.doc-entry {
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e0e0e0;
	}

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

	.user-fullname {
	  font-size: 14px;
	  font-weight: 500;
	  color: white;
	}

/* ===== Цветовая палитра ===== */
:root {
  --primary-color: #28AF8B;
  --primary-hover: #219d7c;
  --primary-text: #ffffff;
  --input-border: #dcdcdc;
  --input-bg: #fff;
}

/* ====== Хедер ====== */
header {
  background-color: var(--primary-color);
  color: var(--primary-text);
  font-family: 'Jost', sans-serif;
  padding: 14px 20px;
  position: relative;
}


  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    flex-wrap: wrap;
  }

  .header-content {
    width: 100% !important;
    max-width: none !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

.header-content {
  display: flex;
  z-index: 1000;
  align-items: center;
  justify-content: space-between;
  max-width: 1420px;
  margin: 0 auto;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  flex-grow: 1;
  text-align: left;
}

  .header-title {
    font-size: 16px;
    flex-grow: 1;
  }

  .header-user {
    margin-left: auto;
  }

  
/* Общий стиль */
.header-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Иконка 👤 */
.user-icon {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: white;
}
.header-user .user-icon {
  background: none;
  border: none;
  padding: 0;
  color: white;
  border-radius: 0;
}
.header-user .user-icon:hover {
  background-color: transparent !important;
  box-shadow: none !important;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
}

.header-user span {
  font-size: 12px;
  color: #ffffff;
}

.header-user button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.header-user button:hover {
  background-color: #f1f1f1;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  padding-left: 12px;          /* выравниваем по отступу main */
  z-index: 9999;           /* ✅ поверх всего */
}

.menu-toggle:hover {
  background: none;      /* ⛔ убираем фон при наведении */
  box-shadow: none;      /* ⛔ если был тень — тоже убираем */
}

/* Базовый стиль выпадашки */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 12px 16px;
  z-index: 9999;
  min-width: 220px;
}

.user-dropdown.show {
  display: block !important;
}

.dewarModal.show {
  display:flex;
}
.user-dropdown span {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #333;
}

.user-dropdown button,
.user-dropdown a {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
  color: #333;
}

.user-dropdown button:hover,
.user-dropdown a:hover {
  background: #f6f6f6;
  border-radius: 6px;
  color:#333;
}
.user-info {
  color:#333;
}

/* 🖥 Десктоп — оставляем dropdown карточкой, 
   но добавляем бейдж с именем рядом с иконкой */
@media (min-width: 769px) {
  .header-user {
    gap: 8px;
  }

  .header-user .user-fullname {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
  }
}

	/* ====== Формы ====== */
	input[type="text"],
	input[type="email"],
	input[type="password"],
	select,
	input[type="file"] {
	  font-family: 'Jost', sans-serif;
	  padding: 10px 12px;
	  font-size: 15px;
	  border: 1px solid var(--input-border);
	  border-radius: 8px;
	  background-color: var(--input-bg);
	  width: auto;
	  max-width: 100%;
	  margin-right: 12px;
	  outline: none;
	}

	input {
	  font-family: 'Jost', sans-serif;
	  padding: 10px 12px;
	  font-size: 15px;
	  border: 1px solid var(--input-border);
	  border-radius: 8px;
	  background-color: var(--input-bg);
	  width: auto;
	  max-width: 100%;
	  margin-right: 12px;
	  outline: none;
	}

	input[type="file"] {
	  padding: 6px 0;
	}

	input[type="checkbox"] {
	  transform: scale(1.2);
	  margin-right: 6px;
	}

	/* ====== Кнопки ====== */
	button,
	.btn,
	.ack-btn {
	  font-family: 'Jost', sans-serif;
	  width: fit-content;
	  font-size: 15px;
	  font-weight: 600;
	  color: #3B485A;
	  background-color: transparent;
	  border: 2px solid #3B485A;
	  border-radius: 999px;
	  padding: 10px 20px;
	  cursor: pointer;
	  transition: all 0.2s ease;
	}

	button:hover,
	.btn:hover,
	.ack-btn:hover {
	  background-color: #3B485A;
	  color: white;
	}


	/* Красная кнопка удаления */
	.ack-btn.red {
    background-color: transparent;
	  color: #cc3333;
	  padding: 6px 10px;
	  border-radius: 8px;
	  font-size: 14px;
	  transition: all 0.2s ease;
	  display: inline-flex;
	  align-items: center;
	}


	.ack-btn.red:hover {
	  background-color: #cc3333;
	  color: white;
	}

	.file-upload {
	  display: inline-block;
	  position: relative;
	  overflow: hidden;
	  background-color: var(--primary-color);
	  color: white;
	  font-weight: 500;
	  border-radius: 8px;
	  padding: 10px 16px;
	  cursor: pointer;
	  font-family: 'Jost', sans-serif;
	  margin-bottom: 10px;
	}

	.file-upload input[type="file"] {
	  position: absolute;
	  left: 0;
	  top: 0;
	  opacity: 0;
	  cursor: pointer;
	  width: 100%;
	  height: 100%;
	}
	.custom-checkbox {
	  display: inline-flex;
	  align-items: center;
	  cursor: pointer;
	  font-family: 'Jost', sans-serif;
	  font-size: 15px;
	  margin-bottom: 12px;
	  user-select: none;
	  gap: 8px;
	}

	.custom-checkbox input[type="checkbox"] {
	  opacity: 0;
	  width: 0;
	  height: 0;
	  position: absolute;
	}

	.custom-checkbox .checkmark {
	  display: inline-block;
	  width: 20px;
	  height: 20px;
	  border: 2px solid var(--primary-color);
	  border-radius: 4px;
	  background-color: white;
	  position: relative;
	  transition: background-color 0.2s ease;
	}

	.custom-checkbox input:checked + .checkmark::after {
	  content: "";
	  position: absolute;
	  left: 5px;
	  top: 1px;
	  width: 6px;
	  height: 12px;
	  border: solid var(--primary-color);
	  border-width: 0 2px 2px 0;
	  transform: rotate(45deg);
	}

	.upload-row {
	  display: flex;
	  flex-wrap: wrap;
	  align-items: center;
	  gap: 12px;
	  margin-bottom: 16px;
	}

	.align-checkbox {
	  display: flex;
	  align-items: center;
	  margin-top: 6px;
	}

	/* Красивая светлая обёртка для file input */
	.file-upload.modern {
	  display: inline-block;
	  padding: 12px 20px;
	  background-color: #f5f7fb;
	  border: 2px dashed #cbd5e1;
	  border-radius: 12px;
	  font-size: 15px;
	  color: #3B485A;
	  font-weight: 500;
	  cursor: pointer;
	  transition: all 0.2s ease;
	}

	.file-upload.modern:hover {
	  background-color: #eef2f7;
	}

	.file-upload.modern input[type="file"] {
	  position: absolute;
	  left: 0;
	  top: 0;
	  opacity: 0;
	  width: 100%;
	  height: 100%;
	  cursor: pointer;
	}
	#uploadStatus {
	  margin-top: 10px;
	  font-size: 14px;
	  font-weight: 500;
	  font-family: 'Jost', sans-serif;
	}

	#uploadStatus.loading {
	  color: #3B485A;
	}

	#uploadStatus.success {
	  color: #0a8754;
	}

	#uploadStatus.error {
	  color: #cc3333;
	}
	

	.modal {
	  position: fixed;
	  top: 0; left: 0; right: 0; bottom: 0;
	  background: rgba(0,0,0,0.4);
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  z-index: 10000;
	}

	.modal-content {
	  background-color: white;
	  border-radius: 12px;
	  width: 90%;
	  max-width: 900px;
	  height: 80vh;
	  position: relative;
	  padding: 10px 32px;
	  overflow: hidden;
	  max-height: 90vh;
	  overflow-y: auto;
	  padding-bottom: 24px;
	}

	.modal-content iframe {
	  width: 100%;
	  height: calc(100% - 80px); /* ⬅️ освободим место для блока с версиями */
	  border: none;
	}

  #profileModal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4); /* затемнение фона */
  display: flex;
  justify-content: center;
  align-items: center;  /* 👈 выравнивание по центру */
  z-index: 9999;
}

/* Внутренняя карточка */
#profileModal .modal-content,
.profile-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: fadeInUp 0.25s ease;
}

/* Мягкая анимация появления */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Модалка просмотра документа (фикс для истории версий) === */
#previewModal .modal-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;      /* 🟢 теперь можно прокручивать всю модалку */
  max-height: 90vh;      /* ограничим высоту модалки */
  padding-bottom: 0;     /* чтобы не добавлялось пустое место снизу */
}

/* iframe — не растягиваем на 100%, чтобы оставался видимым блок версий */
#previewModal iframe {
  flex: 1 1 auto;
  min-height: 60vh;      /* нормальная высота для предпросмотра */
  max-height: 75vh;      /* чтобы история всегда влезала */
  border: none;
  border-radius: 8px;
}

/* История версий — теперь фиксировано внутри и скроллится вместе с модалкой */
#previewModal #versionHistory {
  position: relative;
  margin: 12px 16px 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #f5f5f5;
  border: 1px solid #eaeaea;
  font-size: 14px;
  color: #444;
  flex-shrink: 0;        /* 🧩 чтобы не сжимался при скролле */
}


	.modal-content .close {
    position: absolute;
    top: 10px;
    right: 16px;
    width: 30px;
    height: 30px;
    font-size: 20px;
    color: white;
    background: #333;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); */
    z-index: 1000;
    /* border: none; */
  }

  .close-doc-preview {
    position: static; 
    margin-left: 12px;
    width: 32px;
	  height: 32px;
	  font-size: 20px;
    cursor: pointer;
    font-size: 20px;
	  color: white;
	  background: var(--primary-color); /* или любой тёмный */
	  border-radius: 50%;
	  cursor: pointer;
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	  z-index: 1000;
	  border: none;
  }

	select {
	  appearance: none;
	  -webkit-appearance: none;
	  -moz-appearance: none;
	  background-color: #fff;
	  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%233B485A' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
	  background-repeat: no-repeat;
	  background-position: right 12px center;
	  background-size: 12px;
	  padding-right: 32px;
	  border: 1px solid var(--input-border);
	  border-radius: 8px;
	  font-family: 'Jost', sans-serif;
	  font-size: 15px;
	  height: 42px;
	}

	#changeLogList .doc-entry {
	  margin-bottom: 16px;
	  padding-bottom: 12px;
	  border-bottom: 1px dashed #ccc;
	}

	textarea {
	  font-family: inherit;
	  font-size: 16px;
	  padding: 8px 12px;
	  border: 1px solid #ccc;
	  border-radius: 10px;
	  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
	  resize: vertical;
	  transition: border-color 0.2s ease;
	  margin-top: 8px;
	  margin-right: 12px;
	}

	textarea:focus {
	  border-color: #28AF8B;
	  outline: none;
	}
#changeLogForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
}

#changeLogForm input,
#changeLogForm textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}

#changeLogForm button {
  align-self: flex-start;
}
.delete-log-btn {
  background: none;
  border: none;
  color: #cc3333;
  font-size: 13px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.delete-log-btn:hover {
  background-color: rgba(204, 51, 51, 0.1); /* мягкий красный фон */
}

/* 📱 Мобильная адаптация карточек анкет */
@media (max-width: 820px) {
  .status-and-curator {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .bottom-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
  }

  .bottom-row a.dropdown-toggle {
    align-self: flex-end;
  }
}

#admin-section,
#changeLogForm {
  display: none;
}
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  font-size: 13px;
  padding: 6px 10px;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-checkboxes label {
  background: #f3f3f3;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.tag-checkboxes input[type=checkbox] {
  accent-color: #007bff;
}

.tag-checkboxes label:hover {
  background: #eaeaea;
}

@media (min-width: 820px) {
  .sort-wrapper {
    display: flex;
  }
}

.sort-wrapper {
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.sort-wrapper label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.sort-wrapper select {
	padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
    height: 36px;
    width: 9vw;
}

@media (max-width: 820px) {
  .sort-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sort-wrapper label {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-wrapper select {
    width: 96%;
  }
}
.sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.sort-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-filter input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 820px) {
  #changeLogFilters {
    flex-direction: column !important;
    align-items: stretch;
  }

  #changeLogFilters > * {
    width: 100% !important;
  }

  #favoritesToggle {
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  #favoritesToggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 14px;
    white-space: nowrap;
  }

  #onlyFavorites {
    transform: scale(1.1);
    margin: 0;
  }
}

#changeLogFilters label#favoritesToggle {
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
}

@media (max-width: 820px) {
  #changeLogFilters label#favoritesToggle {
    justify-content: flex-start;
  }
}

.search-container {
  display: block;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.search-container input[type="text"] {
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-width: 35%;
  width: 100%;
}

.search-container button {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid #3B485A;
  background-color: transparent;
  color: #3B485A;
  cursor: pointer;
}

.search-container button:hover {
  background-color: #3B485A;
  color: white;
}
.hidden-during-search {
  display: none !important;
}
@media (max-width: 820px) {
  .search-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-container input[type="text"] {
    width: 100%;
	max-width: 100%;
    font-size: 16px;
  }

  .search-container button {
    width: 25%;
    font-size: 16px;
  }
}.changelog-card.two-column {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.changelog-left {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: #666;
}

.changelog-right {
  display: flex;
  flex-direction: column;
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.changelog-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.changelog-description {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 10px;
}

.changelog-link {
  font-size: 13px;
  margin-bottom: 8px;
}

.preview-link {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.change-comment {
  font-weight: 600;
  color: #1a2a6c;
  display: inline-block;
  margin-top: 6px;
}

.comment-text {
  font-weight: 500;
  color: #000;
}

.changelog-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 820px) {
  .changelog-card.two-column {
    display: block;
  }

  .changelog-left {
    display: none;
    margin-top: 12px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
  }

  .changelog-card.two-column.show-meta .changelog-left {
    display: flex;
  }

  .changelog-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.doc-entry {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-entry:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.doc-entry .link {
  font-size: 15px;
  font-weight: 500;
  color: #1a2a6c;
}
.doc-entry .link-oth-ver {
  font-size: 12px;
  font-weight: 500;
  color: #1a2a6c;
}

.doc-entry .doc-meta {
  font-size: 13px;
  color: #888;
}

.doc-entry .star {
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.doc-entry .star.active {
  color: gold;
}

.doc-entry .acknowledged {
  color: green;
  font-weight: bold;
}

.doc-entry details {
  margin-top: 8px;
  border-top: 1px dashed #ccc;
  padding-top: 8px;
}

.doc-entry details summary {
  cursor: pointer;
  font-size: 13px;
  color: #444;
  font-weight: 500;
}
@media (max-width: 820px) {
  .doc-entry {
    padding: 12px;
    font-size: 14px;
  }

  .doc-entry .link {
    font-size: 14px;
  }

  .doc-entry .doc-meta {
    font-size: 12px;
  }

  .doc-entry .star {
    font-size: 16px;
  }
}

/* CRM 👩‍🍼 Кандидатки из КР */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

/* Цветовые статусы */
.status-green {
  background-color: #28AF8B !important;
  color: white !important;
}
.status-red {
  background-color: #f8d7da !important;
  color: #721c24 !important;
}
.status-note {
  font-size: 13px;
  color: #444;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Форма добавления анкеты */
.surrogate-form-wrapper {
  max-width: 860px;
  margin: 0 auto 32px auto;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.surrogate-form-wrapper h3 {
  margin-bottom: 20px;
}
.surrogate-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.surrogate-form-wrapper textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  margin-bottom: 16px;
}

/* Карточка анкеты */
.surrogate-entry {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 220px; /* фиксированная высота */
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  background: #f5f7fb;
  transition: box-shadow 0.3s;
}

.surrogate-entry:hover {
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

 .surrogate-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 12px;
  cursor: pointer;
  border: 2px solid #ddd;
}

.surrogate-entry .entry-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.surrogate-entry img {
  width: 96px !important;
  height: 96px !important;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px auto;
}

.surrogate-entry .button-row {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  position: relative;
}

.surrogate-entry .edit-btn {
  border: none;
  background: transparent;
  color: #28a745;
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
}

.surrogate-entry .edit-btn:hover {
  background: none;
  color: #1e7e34;
}

.surrogate-entry .curator-label {
  font-size: 13px;
  font-weight: 500;
  color: #9f9f9f;
  text-align: right;
}


/* Выпадающий статус */
select.status-dropdown {
  background: #28AF8B;
  color: white;
  font-weight: 600;
  padding: 0 20px 0 8px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  height: 28px;
  line-height: 28px;
  vertical-align: middle;
  display: inline-block;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='30,50 70,90 110,50' stroke='white' stroke-width='15' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  margin-bottom: 0 !important;
}

/* Выпадающее меню — новые стили */
.dropdown-toggle {
  background: none;
  border: none;
  color: #28AF8B;
  font-weight: 600;
  font-size: 15px;
  padding: 6px 0;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
}
.dropdown-toggle svg {
  cursor: pointer;
  transition: fill 0.2s ease;
}

.dropdown-toggle svg:hover {
  fill: #28AF8B; /* цвет при наведении */
}

.dropdown-toggle:hover {
  color: #1e7c64;
}

.actions-dropdown {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  z-index: 20;
}
.actions-dropdown button {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 14px;
  text-align: left;
  color: #333;
  border-radius: 6px;
}
.actions-dropdown button:hover {
  background-color: #f4f4f4;
}

.dropdown-right {
  right: 0;
  left: auto;
}

.dropdown-left {
  left: 0;
  right: auto;
}


/* Современная загрузка файла */
.file-upload.modern {
  display: inline-block;
  padding: 12px 20px;
  background-color: #f5f7fb;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
  color: #3B485A;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.file-upload.modern input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Текстовая область */
#surrogate-form textarea {
  font-family: 'Jost', sans-serif;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  margin-bottom: 16px;
}

/* Кнопка маленькая круглая */
.btn-small {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background-color: transparent;
  color: #2F3A4A;
  border: 2px solid #2F3A4A;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background-color: #fff;
  color: #2F3A4A;;
}

/* Адаптив — фильтры, карточки */
@media (max-width: 820px) {
  #surrogateFilters {
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }

  #surrogateFilters label {
    width: 100%;
    display: flex;
    flex-direction: column;
    font-size: 14px;
  }

  #surrogateFilters select,
  #surrogateFilters button {
    width: 100%;
    font-size: 14px;
    padding: 6px 10px;
  }

  .btn-small {
    width: fit-content;
    box-sizing: border-box;
  }

  .grid-cards {
    grid-template-columns: 1fr !important;
  }

  .surrogate-entry {
    font-size: 14px;
    padding: 12px;
    min-height: auto;
  }

  .surrogate-entry img {
    width: 60px !important;
    height: 60px !important;
  }
  
  .surrogate-entry .btn,
  .surrogate-entry .ack-btn {
    width: 100%;
    margin-top: 8px;
  }

  .surrogate-entry .btn + .ack-btn,
  .surrogate-entry .ack-btn + .btn {
    margin-left: 0;
  }

  .surrogate-entry div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-overdue {
  background-color: #fff0f0 !important;
  border-left: 4px solid #e53935 !important;
}

.task-soon {
  background-color: #fffbe6 !important;
  border-left: 4px solid #f0ad4e;
}

.task-done {
  opacity: 0.5;
  text-decoration: line-through;
}
.task-done input[type="checkbox"] {
  accent-color: #28af8b;
}
.task-done-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}

.task-done-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.task-item {
  background: #28af8b12;
  padding: 10px;
  border-left: 4px solid #28AF8B;
  border-radius: 6px;
}

.new-task-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.new-task-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.new-task-row input {
  flex: 1;
  min-width: 120px;
}

.new-task-form textarea {
  width: 100%;
  height: 80px;
  resize: vertical;
}

.new-task-form button {
  align-self: flex-start; /* выравниваем кнопку по левому краю */
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #333;
  background: white;
  cursor: pointer;
}
.new-task-form input,
.new-task-form textarea {
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.new-task-row input[type="date"],
.new-task-row input[type="time"] {
  height: 44px; /* подровнять под text input */
  font-size: 16px;
}

.new-task-form textarea {
  margin-top: 4px;
  width: 100%;
  height: 80px;
  resize: vertical;
  box-sizing: border-box;
}
/* Кнопка добавления задач */
.btn-add-task {
  background-color: #28af8b;
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add-task:hover {
  background-color: #219b79;
}

/* Скрыто по умолчанию */
.task-item .task-actions {
  margin-top: 8px;
  display: none;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s ease, transform 0.4s ease; /* Увеличено с 0.2s до 0.4s */
}

/* При наведении на десктопе — показываем с анимацией */
@media (hover: hover) and (pointer: fine) {
  .task-item:hover .task-actions {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }
}

/* На мобиле всегда отображаем с плавной анимацией появления */
@media (hover: none), (pointer: coarse) {
  .task-item .task-actions {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }
}

.task-item .task-actions button {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 14px;
  cursor: pointer;
  color: #555;
  transition: color 0.8s ease;
}

.task-item .task-actions button:hover {
  color: #007bff;
}

.task-item .task-actions button.red:hover {
  color: #d9534f;
}


/* Список задач */

.task-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.task-title {
  font-weight: 600;
  font-size: 15px;
  color: #222;
  flex: 1;
}

.task-datetime-group {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: #777;
  white-space: nowrap;
}

.task-comment {
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  padding-left: 2px;
}
.task-delete-minimal {
  all: unset;
  font-size: 16px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
  border-radius: 5px;
  padding: 5px;
}

.task-delete-minimal:hover {
  color: #cc3333;
  background: white;
}



/* surrogate.html */

.surrogate-page {
  font-family: 'Jost', sans-serif;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  font-size: 16px;
  min-height: 100vh;
  box-sizing: border-box;
}


.surrogate-page p {
  margin: 6px 0;
  font-size: 14px;
}

.badge-status {
  display: flex;
  background: #888;
  color: white;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.inline-select {
  font-size: 14px;
  padding: 4px;
}


.surrogate-page {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* Десктоп: левая колонка — узкая, правая — широкая */
.surrogate-page > div:first-child {
  flex: 0 0 360px; /* фиксированная ширина левого блока */
}

.surrogate-page > div:last-child {
  flex: 1; /* правая колонка — занимает оставшееся пространство */
}

/* Мобильная версия: одна колонка */
@media (max-width: 820px) {
  .surrogate-page {
    flex-direction: column;
    padding: 24px 16px; /* добавим боковые отступы */
  }

  .surrogate-page > div {
    width: 100%;
  }

  .task-list,
  #taskForm {
    width: 100%;
    box-sizing: border-box;
  }
}

@keyframes rotateRefresh {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.refresh-icon.loading {
  animation: rotateRefresh 1s linear infinite;
}

.btn-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #28af8b;
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: 'Jost', sans-serif;
  position: relative;
}

.btn-photo:hover {
  background-color: #219b79;
}

.btn-photo input[type="file"] {
  position: absolute;
  opacity: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.btn-photo.red {
  background: white;
  border: 1px solid #cc3333;
  color: #cc3333;
}

.btn-photo.red:hover {
  background: #cc3333;
  color: white;
}
.task-done-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
/* Задачи по куратору */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.styled-table th,
.styled-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
}

.styled-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}
#commentsList > div {
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}
.task-comment {
  font-size: 13px;
  color: #444;
  margin-top: 6px;
  line-height: 1.4;
}
.card-pmc-old {
  border-left: 4px solid #cc3333 !important;
  border-radius: 12px;
  background-color: #fff4f4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.bio-section span:hover {
  background: #f0f0f0;
  cursor: pointer;
}

.history-button {
  background: none;
  border: none;
  color: #444;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.history-button:hover {
  background: none;
  color: #444 !important;
  text-decoration: none !important;
}

.inspect-button {
  background: none;
  border: none;
  color: #444;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.inspect-button:hover {
  background: none;
  color: #444 !important;
  text-decoration: none !important;
}

.inline-buttons {
  display: flex;
  align-items: center;
}
.action-wrapper {
  position: relative;
}

/* ПК: показываем inline-кнопки */
.inline-buttons {
  display: flex;
  align-items: center;
}

/* Мобильный бургер скрыт по умолчанию */
.mobile-burger {
  display: none;
  position: relative;
}

.mobile-burger button {
  background: none;
  border: none;
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
}
.mobile-burger button:hover {
  color: #333;
}

.burger-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 32px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 6px 0;
  min-width: 140px;
  flex-direction: column;
}

.burger-dropdown button {
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.burger-dropdown button:hover {
  background: #f3f3f3;
}

/* Мобильный режим: скрыть обычные кнопки, показать бургер */
@media (max-width: 600px) {
  .inline-buttons {
    display: none;
  }

  .mobile-burger {
    display: block;
  }
}

/* Для модалки редактирования / добавления жилья */
.edit-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.edit-form-group label {
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
  font-size: 14px;
}

.edit-form-group input,
.edit-form-group select,
.edit-form-group textarea {
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

.edit-form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.room-list .room-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.room-list .room-row input {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  flex: 1;
}
.room-row input[type="text"] {
  flex: 2;
}

.room-row input[type="number"] {
  flex: 1;
  min-width: 80px;
}
.room-row input[readonly] {
  background-color: #f8f8f8;
  cursor: not-allowed;
}


/* Конец */

/* Кнопка выселить начало */
.surrogate-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap; /* важно для мобилки */
}

.evict-btn {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}

.evict-btn:hover {
  color: #c00;
  background: none;
}

@media (max-width: 600px) {
  .evict-btn {
    font-size: 18px;
  }
}

/* Кнопка выселить конец */


.table-light {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
  min-width: 500px;
}

.table-light th, .table-light td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light tr:hover {
  background-color: #f3f3f3;
}

.table-light {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light th, .table-light td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;     /* 💥 ВАЖНО */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light th:nth-child(1),
.table-light td:nth-child(1) {
  width: 15%;
}

.table-light th:nth-child(2),
.table-light td:nth-child(2) {
  width: 40%;
}

.table-light th:nth-child(3),
.table-light td:nth-child(3) {
  width: 18%;
}

.table-light th:nth-child(4),
.table-light td:nth-child(4) {
  width: 18%;
}
.table-light th:nth-child(5),
.table-light td:nth-child(5) {
  width: 9%;
  text-align: center;
}


.table-light-utm {
  width: 100%;
  table-layout: fixed;   /* фиксируем ширину */
  border-collapse: collapse;
  font-size: 13px;
}

.table-light-utm th,
.table-light-utm td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-utm th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-utm tr:hover {
  background-color: #f3f3f3;
}

/* Ширины колонок */
.table-light-utm th:nth-child(1),
.table-light-utm td:nth-child(1) {
  width: 15%;   /* Источник */
}

.table-light-utm th:nth-child(2),
.table-light-utm td:nth-child(2) {
  width: 30%;   /* Кампания */
}

.table-light-utm th:nth-child(3),
.table-light-utm td:nth-child(3) {
  width: 12%;   /* Лидов */
  text-align: center;
}

.table-light-utm th:nth-child(4),
.table-light-utm td:nth-child(4) {
  width: 12%;   /* % */
  text-align: center;
}

.table-light-utm th:nth-child(5),
.table-light-utm td:nth-child(5),
.table-light-utm th:nth-child(6),
.table-light-utm td:nth-child(6) {
  width: 15%;   /* Конвертировано / Отклонено */
  text-align: center;
}

/* Исполнитель */ 

.table-light-contractor {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
  min-width: 500px;
}

.table-light-contractor th, .table-light-contractor td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light-contractorth {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-contractor tr:hover {
  background-color: #f3f3f3;
}

.table-light-contractor{
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light-contractor th, .table-light-contractor td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-contractor th:nth-child(1),
.table-light-contractor td:nth-child(1) {
  width: 10%; 
}

.table-light-contractor th:nth-child(2),
.table-light-contractor td:nth-child(2) {
  width: 20%;
}

.table-light-contractor th:nth-child(3),
.table-light-contractor td:nth-child(3) {
  width: 40%;
}
.table-light-contractor th:nth-child(4),
.table-light-contractor td:nth-child(4) {
  width: 30%;
}

/* Таблица жилья*/

.table-light-acc {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
  min-width: 500px;
}

.table-light-acc th, .table-light-acc td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light-acc th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-acc tr:hover {
  background-color: #f3f3f3;
}

.table-light-acc {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light-acc th, .table-light-acc td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;     /* 💥 ВАЖНО */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-acc th:nth-child(1),
.table-light-acc td:nth-child(1) {
  width: 10%;
}

.table-light-acc th:nth-child(2),
.table-light-acc td:nth-child(2) {
  width: 35%;
}

.table-light-acc th:nth-child(3),
.table-light-acc td:nth-child(3) {
  width: 35%;
}

.table-light-acc th:nth-child(4),
.table-light-acc td:nth-child(4) {
  width: 20%;
}
/* Таблицы офферы БИО */

.table-light-curator {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table-light-curator th, .table-light-curator td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light-curator th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-curator tr:hover {
  background-color: #f3f3f3;
}

.table-light-curator {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light-curator th, .table-light-curator td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;     /* 💥 ВАЖНО */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-curator th:nth-child(1),
.table-light-curator td:nth-child(1) {
  width: 15%;
}

.table-light-curator th:nth-child(2),
.table-light-curator td:nth-child(2) {
  width: 40%;
}

.table-light-curator th:nth-child(3),
.table-light-curator td:nth-child(3) {
  width: 18%;
}

.table-light-curator th:nth-child(4),
.table-light-curator td:nth-child(4) {
  width: 18%;
}
.table-light-curator th:nth-child(5),
.table-light-curator td:nth-child(5) {
  width: 9%;
}
.table-light-curator th:nth-child(6),
.table-light-curator td:nth-child(6) {
  width: 9%;
}
.table-light-curator th:nth-child(7),
.table-light-curator td:nth-child(7) {
  width: 9%;
}
.table-light-curator th:nth-child(8),
.table-light-curator td:nth-child(8) {
  width: 9%;
}
.table-light-curator th:nth-child(9),
.table-light-curator td:nth-child(9) {
  width: 9%;
}
.table-light-curator th:nth-child(10),
.table-light-curator td:nth-child(10) {
  width: 9%;
}
.doc-entry-acc {
  margin: 4px 0 10px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid #e3e3e3;
  font-size: 13.5px;
  max-width: 100%;
  transition: all 0.2s ease;
}

.doc-entry-acc:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  border-color: #d0d0d0;
}

.doc-entry-acc h4 {
  margin-bottom: 4px;
  font-size: 15px;
}

.doc-entry-acc table th,
.doc-entry-acc table td {
  padding: 4px 6px;
  font-size: 13px;
}

.textarea-wide {
  width: 95%;
  max-width: 95%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
}

.room-free {
  background-color: #f9fff4; /* нежно-зелёный фон */
}

.room-free td {
  color: #444;
  font-style: italic;
}

.city-filter-link {
  color: #333;
  text-decoration: none;
  margin-right: 8px;
  font-size: 14px;
}

.city-filter-link.active {
  font-weight: bold;
  color: #2065d1;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.surrogate-link {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #2065d1;
}
.inspection-history-wrapper summary {
  list-style: none;
  padding: 6px 0;
  font-weight: 500;
  border-top: 1px dashed #ccc;
}

.inspection-history-wrapper[open] summary {
  color: #333;
}
.doc-subitem {
  font-size: 13px;
  padding: 4px 12px;
}
.doc-subitem:hover {
  background-color: #f5f5f5;
}

/* Стилизация блока комнат */
.room-check-block {
  margin-top: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  background: #fcfcfc;
}

/* Расширенные textarea */
textarea.full-width {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  resize: vertical;
  margin-bottom: 8px;
}

.request-tab-btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #333;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-right: 8px;
}

.request-tab-btn:hover {
  background: #e0e0e0;
}

.request-tab-btn.active {
  background: #d6eaff;
  border-color: #2196f3;
  color: #0d47a1;
  font-weight: 500;
}

.delete-btn {
  background: none;
  border: none;
  color: #cc3333;
  font-size: 13px;
  cursor: pointer;
}
.delete-btn:hover {
  color: red;
  background: none;
}
/* Компактный вид */
.surrogate-card-new {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.surrogate-card-new:hover {
  background: #f9f9f9;
}

.surrogate-card-new .card-header {
  display: flex;
  justify-content: flex-start;
  font-weight: 600;
  color: #000;
}

.surrogate-card-new .surrogate-name {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

.surrogate-card-new .bio-ref {
  font-size: 12px;
  color: #555;
}

.surrogate-card-new .card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #555;
}

.surrogate-card-new .card-task {
  font-size: 12px;
  color: #333;
}

.surrogate-card-new .card-curator {
  font-size: 11px;
  color: #999;
}

.surrogate-card-new.active {
  border: 2px solid #007bff;
  background-color: #eef5ff;
}


.surrogates-layout {
  display: block;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.surrogates-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* Таблица сурмам */
.surrogates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.surrogates-table th,
.surrogates-table td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
}

.surrogates-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.surrogates-table th:hover {
  background: #f3f4f6;
}

/* Стрелочки сортировки (↑/↓ уже в JS, здесь просто выравниваем) */
.surrogates-table th::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #6b7280;
}

/* Чётные строки – серый фон (зебра) */
.surrogates-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.surrogates-table tbody tr:hover {
  background: #f1f5f9;
  transition: background 0.2s ease;
}

/* Ссылки (ФИО сурмам) */
.surrogates-table td a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}

.surrogates-table td a:hover {
  text-decoration: underline;
}

/* Статус */
.surrogates-table td:nth-child(2) {
  font-weight: 500;
  color: #374151;
}

/* Ближайшая задача */
.surrogates-table td:nth-child(5) {
  font-size: 13px;
  color: #555;
}


/* ======================= */
/* Попап анкеты суррогата  */
/* ======================= */

#surrogatePopup {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#surrogatePopup .popup-content {
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  font-family: 'Jost', sans-serif;
  animation: fadeIn 0.25s ease;
  overflow: hidden;
}

/* Хедер = зона перетаскивания */
#surrogatePopup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  cursor: move;
  user-select: none;
}

/* Левая часть (ФИО) */
#surrogatePopup .popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

/* Правая часть: чип статуса + крестик */
#surrogatePopup .popup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопка закрытия */
#surrogatePopup .popup-header .popup-close {
  position: static !important;
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#surrogatePopup .popup-header .popup-close:hover {
  background: #f3f4f6;
}

/* Контент */
#popupSurrogateContent {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
}

.popup-row strong {
  color: #333;
}

/* Статусные чипы */
.status-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 20px;
  font-weight: 500;
  color: white;
}
.status-chip.green { background-color: #28a745; }
.status-chip.orange { background-color: #ff9800; }
.status-chip.red { background-color: #e53935; }
.status-chip.gray { background-color: #999; }

/* Чип задачи */
.task-chip {
  display: inline-block;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #333;
}

/* Ссылка */
.link-anketa {
  margin-top: 12px;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #18a67b;
  border: 1px #18a67b solid;
  border-radius: 10px;
  padding: 4px 14px;
  text-decoration: unset;
  width: fit-content;
}

.signal {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
  font-weight: 500;
  margin-right: 6px;
}
.signal.red { background: #ffe5e5; color: #cc0000; }
.signal.yellow { background: #fff6e0; color: #cc7a00; }
.signal.green { background: #e5fbe5; color: #2e7d32; }
.signal.gray { background: #f0f0f0; color: #666; }


/*
.surrogate-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  max-width: 480px;
  width: 90%;
  padding: 20px;
}

.popup-content {
  position: relative;
}

.popup-close {
  position: absolute;
  right: 12px;
  top: -4px;
  font-size: 30px;
  cursor: pointer;
}
.popup-header {
  padding: 10px 0px;
  cursor: move;
  border-bottom: 1px solid #ddd;
  user-select: none;
}
*/
/* Для скрытия селектора сетки на мобильных */
.hidden-on-mobile {
  display: inline-block;
}
@media (max-width: 820px) {
  .hidden-on-mobile {
    display: none;
  }
}
/* Fieldset */
fieldset.view-settings {
  border: 1px dashed #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
}

fieldset.view-settings legend {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

fieldset.view-settings label {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

/* Радио — чуть больше и с плавностью */
fieldset.view-settings input[type="radio"] {
  accent-color: #2c7;
  transform: scale(1.1);
  transition: all 0.15s ease;
}

/* На мобилках: сделать в столбик */
@media (max-width: 600px) {
  fieldset.view-settings {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-inline {
  min-width: 130px;
  }
}



@media (max-width: 600px) {
  .finance-tabs {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-inline-fin {
  min-width: 130px;
  }
}

.btn-inline-fin {
  font-size: 14px;
  padding: 6px 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  background-color: #f0f0f0;
}
.btn-inline-fin:hover {
  background-color: #28af8b;
  color: #fff;
}
.btn-inline-fin:active {
  background-color: #fcc8c8;
  color: #3B485A;

}

.section-card {
  background: #f5f7fb;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.section-card h3 {
  margin-top: 0;
  font-size: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.group-block {
  margin-bottom: 16px;
}
.group-block h4 {
  margin-bottom: 6px;
  color: #55555563;
  font-size: 15px;
}
.residence-history {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
.assign-bio-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  color: #223344;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.assign-bio-link:hover {
  color: #0054a6;
}

.section-header {
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-body {
  display: block;
}

.arrow {
  font-size: 12px;
  transition: transform 0.2s ease;
}

details.section-card {
  background: #f5f7fb;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 20px;
  margin-bottom: 24px;
  font-size: 15px;
}

details.section-card summary {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  outline: none;
}

.group-block {
  margin-top: 20px;
  border-left: 3px solid #eee;
  padding-left: 12px;
}

.group-block h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-card p {
  margin: 4px 0;
}

.section-card strong {
  font-weight: 600;
}

.photo-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #f0f0f0;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  border: 2px dashed #ccc;
  margin-bottom: 12px;
  transition: background-color 0.3s, border-color 0.3s;
}

.photo-upload-placeholder:hover {
  background-color: #e8e8e8;
  border-color: #999;
}

.photo-upload-placeholder:active {
  background-color: #ddd;
}
.doc-tag {
  display: inline-block;
  background-color: #28af8b;
  color: white;
  border-radius: 6px;
  padding: 2px 3px;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}

.doc-tag-select {
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  outline: none;
  min-width: 160px;
}
.btn-outline {
  cursor: pointer;
}

.doc-actions-wrapper {
  position: relative;
}

.doc-actions-button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.doc-actions-button:hover {
    background: none;
}
.doc-actions-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  z-index: 30;
  min-width: 120px;
}

.doc-actions-dropdown a,
.doc-actions-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  text-decoration: none;
}

.doc-actions-dropdown a:hover,
.doc-actions-dropdown button:hover {
  background-color: #f2f2f2;
}
@media (max-width: 600px) {
  .doc-item {
    font-size: 15px;
  }

  .doc-actions-dropdown {
    right: 0;
    min-width: 100px;
  }

  .doc-actions-button svg {
    width: 22px;
    height: 22px;
  }
}
#allDocsTable table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

#allDocsTable th, #allDocsTable td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

#allDocsTable th {
  cursor: pointer;
  user-select: none;
}

.doc-actions-wrapper { position: relative; }

.doc-actions-button svg { pointer-events: none; }

.btn-upload-doc {
  display: inline-block;
  margin-top: 8px;
  color: #111;
  background: none;
  border: 1px solid #aaa;
  padding: 6px 16px;
  font-size: 14px;
  border-radius: 24px;
  transition: 0.2s ease;
  cursor: pointer;
}
.btn-upload-doc:hover {
  background-color: #f4f4f4;
  color: #111;
}

.btn-all-doc {
  display: inline-block;
  margin-top: 8px;
  color: #111;
  background: none;
  border: none;
  padding: 6px 0px;
  font-size: 14px;
  transition: 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 5px;
  cursor: pointer;
}
.btn-all-doc:hover {
  background-color: unset;
  color: #111;
}
.generate-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.generate-actions button {
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #333;
  background: white;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.generate-actions button:hover {
  background: #f3f3f3;
}

.kanban-board {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 16px 0;
  align-items: flex-start;
}

.kanban-column {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 12px;
  min-width: 280px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.kanban-title {
  font-weight: 100;
  font-size: 15px;
  margin-bottom: 12px;
  text-align: center;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}

.kanban-completeness-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.kanban-completeness-bar .bar-bg {
  width: 80px;
  height: 5px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.kanban-completeness-bar .bar-fill {
  height: 100%;
  border-radius: 4px;
}

.kanban-completeness-bar .bar-percent {
  font-size: 11px;
  font-weight: 600;
}

/* 🔴 подсветка карточки при < 90% */
.surrogate-card-new.low-completeness {
  box-shadow: inset 0 0 0 2px rgba(231, 76, 60, 0.25);
}


/* Цвета по статусам */
.status-Анкета       { background-color: rgba(91, 192, 222, 0.7); }
.status-Записана     { background-color: rgba(92, 184, 92, 0.7); }
.status-ПП           { background-color: rgba(240, 173, 78, 0.7); }
.status-ППЭ          { background-color: rgba(2, 117, 216, 0.7); }
.status-ПЭ           { background-color: rgba(2, 117, 216, 0.7); }
.status-СБ           { background-color: rgba(147, 112, 219, 0.7); }
.status-БЕР          { background-color: rgba(147, 112, 219, 0.7); }
.status-Роды         { background-color: rgba(255, 105, 180, 0.7); }
.status-Неучаствует  { background-color: rgba(153, 153, 153, 0.7); }
.status-Безстатуса   { background-color: rgba(204, 204, 204, 0.5); }
.status-РД           { background-color: rgba(100, 149, 237, 0.7); }
.status-Учет         { background-color: rgba(72, 201, 176, 0.7); }
.status-10-14        { background-color: rgba(135, 206, 235, 0.7); }
.status-скрининг1    { background-color: rgba(255, 182, 193, 0.7); }
.status-14-22        { background-color: rgba(255, 215, 0, 0.7); }
.status-скрининг2    { background-color: rgba(255, 160, 122, 0.7); }
.status-22-34        { background-color: rgba(60, 179, 113, 0.7); }
.status-скрининг3    { background-color: rgba(255, 140, 0, 0.7); }
.status-34plus       { background-color: rgba(199, 21, 133, 0.7); }
.status-ХГЧ          { background-color: rgba(255, 99, 71, 0.7); }

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.kanban-cards.kanban-drop-hover {
  background-color: rgba(0, 123, 255, 0.04);
  border: 2px dashed rgba(0, 123, 255, 0.25);
  transition: background-color 0.2s ease;
}

.kanban-cards .surrogate-card-new {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.kanban-cards .surrogate-card-new:hover {
  transform: scale(1.01);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  min-height: 48px;
}

.card-photo,
.photo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.photo-placeholder {
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #555;
}

.card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
}

.surrogate-name,
.card-task,
.card-curator {
  margin: 0;
}
/* Контейнер для таблицы: добавляем горизонтальную прокрутку */
#analytics-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Таблица */
.analytics-table {
  min-width: 720px; /* важное дополнение! */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  table-layout: auto;
}

/* Ячейки */
.analytics-table th,
.analytics-table td {
  border: none;
  border-bottom: 1px solid #eee;
  padding: 8px 12px;
  font-size: 14px;
  vertical-align: top;
  box-sizing: border-box;
  background: transparent;
}

/* Заголовки */
.analytics-table th {
  font-weight: 600;
  background-color: #fff;
  color: #444;
  border-bottom: 2px solid #ddd;
  text-align: left;
}

/* Строки категории */
.analytics-table tr.category-header td {
  background: #f6f6f6;
  border-top: 2px solid #ddd;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 0;
}

.analytics-table tr.category-header:hover td {
  background: #f0f0f0;
}

/* Строки с удалёнными */
.analytics-table tr.row-unassigned td {
  background-color: #fff5f5;
}

/* Элементы внутри ячейки */
.entry-wrapper {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 6px;
  margin-bottom: 6px;
}

/* Редактируемое поле */
.editable-entry {
  background-color: #fff9db;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}

.editable-entry:focus {
  outline: none;
  background: #fffff3;
  box-shadow: 0 0 0 2px #d0d0d0;
}

/* Номер записи */
.entry-number {
  font-weight: 100;
  margin-right: 4px;
  user-select: none;
  font-size: 13.5px;
}

/* Вертикальная граница между регионами */
.region-border-left {
  border-left: 1px solid #eee;
  padding-left: 12px;
}

/* Кнопки + */
.btn-small {
  font-size: 13px;
  padding: 2px 6px;
  background: #f3f3f3;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
}
.btn-small:hover {
  background-color: #e6e6e6;
}

/* Кнопки inline (копировать, удалить и т.д.) */
.btn-inline {
  font-size: 14px;
  padding: 6px 12px;
  height: 42px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f8f8f8;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-inline:hover {
  background-color: #28af8b1c;
  color: #3B485A;
}

.entry-wrapper[draggable="true"] {
  cursor: grab;
}

.entry-wrapper:active {
  cursor: grabbing;
}

.drop-zone {
  height: 0;
  margin: 0;
  border: none;
  transition: border 0.2s ease, height 0.2s ease;
}

.drop-zone.drag-over {
  height: 16px;
  border: 1px dashed #aaa;
  margin: 4px 0;
}
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: #f6f6f6;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
  height: 42px;
}

.dropdown-btn:hover {
  background: #fff;
  color: #3B485A;
}


.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 999;
  flex-direction: column;
  padding: 6px 0;
}

.dropdown-menu button {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background-color: #f0f0f0;
  color: #3B485A;
}

/* 📦 Обёртка таблицы */
.curator-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* плавная прокрутка на iOS */
}
.curator-table-wrapper table {
  min-width: 800px; /* можно больше/меньше в зависимости от колонок */
  border-collapse: collapse;
}
/* 📋 Базовая таблица */
.curator-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-family: 'Jost', sans-serif;
}

/* 🖱 Подсветка строки при наведении */
.curator-table tr:hover {
  background-color: #eaf6ff;
  transition: background-color 0.2s ease-in-out;
}

.curator-table th,
.curator-table td {
  padding: 8px;
  vertical-align: top;
}

/* 📐 Фикс ширины столбцов */
.curator-table th:nth-child(1),
.curator-table td:nth-child(1) {
  width: 50px;
}

.curator-table th:nth-child(2),
.curator-table td:nth-child(2) {
  width: 150px;
}

.curator-table th:nth-child(3),
.curator-table td:nth-child(3) {
  width: 140px;
  white-space: nowrap;
}

.curator-table th:nth-child(4),
.curator-table td:nth-child(4) {
  width: 180px;
  white-space: nowrap;
}

/* ✏️ Инпуты */
.curator-table td input {
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  font-family: 'Jost', sans-serif;
  transition: all 0.2s ease;
}

/* ✏️ Hover / Focus */
.curator-table td input:hover {
  border-color: #888;
  background-color: #fafafa;
}
.curator-table td input:focus {
  outline: none;
  border-color: #28AF8B;
  background-color: #f4fefc;
  box-shadow: 0 0 0 2px rgba(40, 175, 139, 0.2);
}

/* 💰 Спецстили для поля Гонорар — как в потребностях */
.curator-table td:nth-child(3) input,
.fee-cell input {
  background-color: #fff;
  text-align: right;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: 6px 12px;
  transition: all 0.2s ease;
}
.curator-table td:nth-child(3) input:hover,
.fee-cell input:hover {
  border-color: #bbb;
  background-color: #fafafa;
}
.curator-table td:nth-child(3) input:focus,
.fee-cell input:focus {
  border-color: #28AF8B;
  background-color: #f4fefc;
  box-shadow: 0 0 0 2px rgba(40, 175, 139, 0.25);
}

/* 🟩 Инлайн-редактирование */
.editable-cell {
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  line-height: 1.3;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editable-cell:focus {
  outline: 2px solid #28AF8B;
  background-color: #f4fefc;
}

/* 📝 Комментарий под БИО */
.bio-note {
  font-size: 13px;
  color: #666;
  display: block;
  margin-top: 2px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease;
}
.bio-note:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
  color: #000;
}
.bio-note-input {
  font-size: 13px;
  padding: 2px 4px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* 💳 Обёртка fee-cell */
.fee-cell {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}


.urgent-row {
  background: #fff3f3;
  border-left: 4px solid #e53935;
}

/* 📱 Мобильная версия — уменьшение шрифта для категорий и заголовков изменений */
@media (max-width: 820px) {
  .category-header,       /* Заголовки категорий */
  .analytics-changes {    /* "Изменения с предыдущей недели" */
    font-size: 13px !important;
  }
}

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

.dropdown-menu-fin {
  display: none;
  position: absolute;
  top: 100%; /* сразу под кнопкой */
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 160px;
  z-index: 999; /* поверх всего */
}

.dropdown-menu-fin button {
  display: block;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
}

.dropdown-menu-fin button:hover {
  background: #f4f4f4;
  color: #333;
}

.table-light-ops {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
  table-layout: fixed;
}

.table-light-ops td.type-cell {
  text-align: left;
  width: 40px;
}

.table-light-ops td.type-cell svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.table-light-ops th, 
.table-light-ops td {
  text-align: left;
  padding: 6px 8px;
  font-size: 13px;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap; /* 💥 важно */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-ops th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-ops tr:hover {
  background-color: #f3f3f3;
}

/* 📏 ширина колонок */
/*
.table-light-ops th:nth-child(1),
.table-light-ops td:nth-child(1) {
  width: 2%;
}
*/

.table-light-ops th:nth-child(2),
.table-light-ops td:nth-child(2) {
  width: 10%; /* Дата */
}

.table-light-ops th:nth-child(3),
.table-light-ops td:nth-child(3) {
  width: 10%; /* Счет */
}

.table-light-ops th:nth-child(4),
.table-light-ops td:nth-child(4) {
  width: 5%; /* Тип */
}

.table-light-ops th:nth-child(5),
.table-light-ops td:nth-child(5) {
  width: 15%; /* Контрагент */
}

.table-light-ops th:nth-child(6),
.table-light-ops td:nth-child(6) {
  width: 20%; /* Статья */
}

.table-light-ops th:nth-child(7),
.table-light-ops td:nth-child(7) {
  width: 13%; /* Проект */
}

.table-light-ops th:nth-child(8),
.table-light-ops td:nth-child(8) {
  width: 15%; /* Сумма */
  text-align: right;
}

/* =========================
   💰 FINANCE OPS TABLE ONLY
========================= */

/* 1. Сужаем чекбокс */
#finance-ops-table th:first-child,
#finance-ops-table td:first-child {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

/* чуть уменьшим сам чекбокс */
#finance-ops-table input[type="checkbox"] {
  transform: scale(1.1);
}

/* 2. Статья шире чем Проект */

/* Статья (6-й столбец) */
#finance-ops-table th:nth-child(6),
#finance-ops-table td:nth-child(6) {
  width: 280px;
  min-width: 220px;
}

/* Проект (7-й столбец) */
#finance-ops-table th:nth-child(7),
#finance-ops-table td:nth-child(7) {
  width: 160px;
  min-width: 140px;
  opacity: 0.85;
}

#finance-ops-table td:nth-child(6) {
  white-space: normal;
  line-height: 1.3;
}

/* Только для блока финансов */
#finance-section,
#bioFinanceOps {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

#finance-ops-table {
  min-width: 900px; /* подгони если надо */
}

#finance-section .section,
#finance-section .table-wrap,
#bioFinanceOps {
  overflow: visible;
}

/* 📦 Модалка для раздела Финансы */
.finance-modal {
  width: 80%; /* фиксированная ширина побольше */
  max-width: 90%; /* чтобы на маленьких экранах адаптировалась */
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 80vh;
  overflow-y: auto;
}


/* Заголовок + перетаскивание */
.finance-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 16px;
}
.finance-modal-header h3 {
  margin: 0;
}

/* Поля */
.finance-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fafafa;
}
.finance-input:focus {
  border-color: #999;
  outline: none;
  background: #fff;
}

/* Кнопки футера */
.finance-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Минималистичные кнопки */
.finance-btn {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: transparent;
  color: #333;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.finance-btn:hover {
  background: #f5f5f5;
  color: #333;
}
.finance-btn.danger {
  border-color: #e57373;
  color: #c62828;
}
.finance-btn.danger:hover {
  background: #fdecea;
}

.finance-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.left-buttons {
  flex-shrink: 0;
}

.right-buttons {
  display: flex;
  gap: 10px;
}

/* Кнопка Сохранить */
.finance-btn.save {
  background: #f5f5f5;
  border: 1px solid #ccc;
  color: #333;
  border-radius: 6px;
  padding: 6px 14px;
}
.finance-btn.save:hover {
  background: #e5e5e5;
}

/* Кнопка Отменить */
.finance-btn.cancel {
  background: none;
  border: none;
  color: #666;
  padding: 6px 10px;
  cursor: pointer;
}
.finance-btn.cancel:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Кнопка Удалить */
.finance-btn.delete {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #d9534f;
  border-radius: 6px;
  padding: 6px 14px;
}
.finance-btn.delete:hover {
  background: #ffe5e5;
}


.finance-form-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 10px; /* расстояние между label и полем */
}

.finance-form-row label {
  flex: 0 0 15%; /* фиксированная ширина label */
  font-weight: 500;
}

.finance-form-row .finance-input {
  flex: 1; /* поле растягивается на всю оставшуюся ширину */
}

/* растягиваем строки формы на всю ширину модалки */
#financeOpModal .finance-form-row {
  width: 100% !important;   /* перебиваем старый 640px */
  display: flex;
  align-items: center;
  gap: 10px;
}

/* label тянется, внутри — подпись + поле */
#financeOpModal .finance-form-row > label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* сами поля занимают остаток */
#financeOpModal .finance-input {
  width: 100%;
  min-width: 0;             /* чтобы не выталкивало */
  box-sizing: border-box;
}

.alert { background:#fff8e1; border:1px solid #ffd54f; color:#7a5d00; padding:10px 12px; border-radius:10px; margin-bottom:14px; }
.ack-btn.gray { background:#f3f4f6; color:#374151; }


@media (min-width: 990px) {
	#financeOpModal .finance-modal {
  max-width: 900px;
  width: 50vw;
}
}

.table-light-projects {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-family: 'Jost', sans-serif;
  font-size: small;
}

.table-light-projects th,
.table-light-projects td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f1f1;
}

.table-light-projects th {
  background: #fafafa;
  font-weight: 600;
}

.table-light-projects tr:last-child td {
  border-bottom: none;
}

.table-light-projects tr:hover {
  background-color: #f9f9f9;
  transition: background-color 0.2s ease-in-out;
}
.btn-edit-proj {border:none; padding:1px;}
.btn-edit-proj:hover {border:none; background-color:transparent;}

.btn-del-proj {border:none;padding:1px;}
.btn-del-proj:hover {border:none; background-color:transparent;}

.table-light-cat {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table-light-cat th, .table-light-cat td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light-cat th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-cat tr:hover {
  background-color: #f3f3f3;
}

.table-light-cat {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light-cat th, .table-light-cat td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;     /* 💥 ВАЖНО */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-cat th:nth-child(1),
.table-light-cat td:nth-child(1) {
  width: 60%;
}

.table-light-cat  th:nth-child(2),
.table-light-cat  td:nth-child(2) {
  width: 30%;
}

.table-light-cat  th:nth-child(3),
.table-light-cat  td:nth-child(3) {
  width: 10%;
}

/* Балансы */
.table-light-bal {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table-light-bal th, .table-light-bal td {
  text-align: left;
  padding: 4px 6px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.table-light-bal th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-bal tr:hover {
  background-color: #f3f3f3;
}

.table-light-bal {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

.table-light-bal th, .table-light-bal td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;     /* 💥 ВАЖНО */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-bal th:nth-child(1),
.table-light-bal td:nth-child(1) {
  width: 50%;
}

.table-light-bal  th:nth-child(2),
.table-light-bal  td:nth-child(2) {
  width: 50%;
  text-align: right;
}
/**/

.finance-operations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Кнопка "Создать" */
.btn-create-op {
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-create-op:hover {
  background: #e5e5e5;
}

/* Поле поиска */
#finance-operations-search {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 13px;
  width: 200px;
}
#finance-operations-search:focus {
  border-color: #999;
  outline: none;
}

.breadcrumbs {
  font-size: 13px;
  color: #888;
  margin-top: -4px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumbs .crumb {
  cursor: pointer;
}

.breadcrumbs .crumb:hover {
  text-decoration: underline;
}

.breadcrumbs .current {
  color: #555;
  cursor: default;
}

.breadcrumbs .crumb-sep {
  color: #aaa;
}

.dropdown-toggle-fin {
  background: none;
  border: none;
  font-weight: 600;
  font-size: 15px;
  padding: 6px 12px;
  text-align: left;
  cursor: pointer;
}

/* ↓ одинаковый размер для всех иконок в таблице */
.op-icon { width: 12px!important; height: 12px!important; stroke: currentColor; }
.op-income  { color: #28af8b; } /* зелёный */
.op-expense { color: #d9534f; } /* красный */
.op-transfer{ color: #e91e63; } /* нейтральный */


.table-light-req {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
  table-layout: fixed;
}

.table-light-req th, 
table-light-req td {
  text-align: left;
  padding: 6px 0px;
  font-size: 13px;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap; /* 💥 важно */
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-req th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-req tr:hover {
  background-color: #f3f3f3;
}

/* 📏 ширина колонок */
.table-light-req th:nth-child(1),
.table-light-req td:nth-child(1) {
  width: 8%; /* Дата */
}

.table-light-req th:nth-child(2),
.table-light-req td:nth-child(2) {
  width: 20%; /* Жилье */
}

.table-light-req th:nth-child(3),
table-light-req td:nth-child(3) {
  width: 10%; /* Зона */
}

.table-light-req th:nth-child(4),
.table-light-req td:nth-child(4) {
  width: 20%; /* Описание */
}

.table-light-req th:nth-child(5),
.table-light-req td:nth-child(5) {
  width: 8%; /* Сумма */
}

.table-light-req th:nth-child(6),
.table-light-req td:nth-child(6) {
  width: 15%; /* Виновный */
}

.table-light-req th:nth-child(7),
.table-light-req td:nth-child(7) {
  width: 10%; /* Статус */
}

/* Таблицы бонусов */
.table-light-bonuses {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
  table-layout: fixed;
}

.table-light-bonuses th, 
table-light-bonuses td {
  text-align: left;
  padding: 6px 0px;
  font-size: 14px;
  vertical-align: middle;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-light-bonuses th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.table-light-bonuses tr:hover {
  background-color: #f3f3f3;
}

/* 📏 ширина колонок */
.table-light-bonuses th:nth-child(1),
.table-light-bonuses td:nth-child(1) {
  width: 15%; /* Дата */
}

.table-light-bonuses th:nth-child(2),
.table-light-bonuses td:nth-child(2) {
  width: 30%; /* Куратор */
}

.table-light-bonuses th:nth-child(3),
table-light-req td:nth-child(3) {
  width: 30%; /* Причина */
}

.table-light-bonuses th:nth-child(4),
.table-light-bonuses td:nth-child(4) {
  width: 10%; /* Сумма */
}

.table-light-bonuses th:nth-child(5),
.table-light-bonuses td:nth-child(5) {
  width: 15%; /* Статус */
}

/* 💰 Финансовые операции */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  font-weight: 100;
}

.finance-table thead {
  background: #f7f9fb;
}

.finance-table th,
.finance-table td {
  padding: 4px 2px;
  text-align: left;
  border-bottom: 1px solid #eee;
  white-space: nowrap;       /* не переносить строки */
  text-overflow: ellipsis;   /* многоточие при длинном тексте */
  overflow: hidden;
}

.finance-table th {
  font-weight: 600;
  color: #444;
  font-size: 13px;
}

.finance-table td {
  font-size: 12px;
  color: #333;
}

.finance-table tbody tr:hover {
  background-color: #f0f8ff;
  transition: background 0.2s;
}

/* Последняя строка без границы */
.finance-table tbody tr:last-child td {
  border-bottom: none;
}

/* 💸 Сумма по умолчанию */
.amount { white-space: nowrap; }

/* ✅ Доход — зелёный*/
.amount.income { color: #0a8a3a;}

.amount.expense {
  color: #b30000; /* красный */
}

.settings-link {
  margin-left: 12px;
  font-size: 13px;
  color: #0077cc;
  text-decoration: underline;
  cursor: pointer;
}
.settings-link:hover {
  color: #005999;
}


/* 🎨 Стилизация Choices.js под модалку */
.choices {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  width: 100%;
  margin: 0;
}

.choices__inner {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-height: 40px;
  padding: 6px 10px;
  box-shadow: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.choices__inner:hover {
  border-color: #bbb;
}

.is-focused .choices__inner {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74,144,226,0.15);
}

/* Текст внутри */
.choices__list--single {
  padding: 0;
  margin: 0;
}

/* Список опций */
.choices__list--dropdown {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
}

.choices__list--dropdown .choices__item {
  padding: 10px 12px;
  font-size: 14px;
  transition: background 0.2s;
}

.choices__list--dropdown .choices__item--selectable:hover {
  background: #f5f9ff;
}

/* Плейсхолдер */
.choices__placeholder {
  opacity: 0.6;
  color: #777;
}

/* Стрелочка */
.choices[data-type*="select-one"]::after {
  border: none;
  content: "▾";
  font-size: 14px;
  color: #666;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Ограничение ширины под родителя */
.finance-form-row .choices {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* Список не должен выходить за форму */
.finance-form-row .choices__list--dropdown {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  left: 0 !important;
  right: 0 !important;
}

.opfilter {
  max-height: 40px;
  min-height: 40px;
  line-height: 1.1;
  font-size: small;
}

.view-tab-residence {
    display: flex;
    margin-bottom: 20px;
    justify-content: flex-start;
}

@media (max-width: 600px) {
  .view-tab-residence {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
  }
}
.fine-amount-input {
    font-family: 'Jost', sans-serif;
    padding: 4px 4px;
    padding-left: 10px;
    font-size: 12px;
    border-radius: 8px;
    background-color: var(--input-bg);
    width: auto;
    max-width: 100%;
    margin-right: 12px;
    outline: none;
    margin-bottom: 0;
}

/* 🔍 Аккордеон с проверками */
.inspection-accordion {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.inspection-accordion summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.inspection-accordion > div > div {
  font-size: 13px;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
}

/* Чередование фона */
.inspection-accordion > div > div:nth-child(odd) {
  background: #fafafa;
}
.inspection-accordion > div > div:nth-child(even) {
  background: #ffffff;
}

.inline-money-input {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 140px;
}
.money { cursor: text; }
.money:hover { background: #f3f3f3; border-radius: 4px; }

.copyable {
  border-bottom: 1px dashed #666;
  cursor: pointer;
}
.copyable:hover {
  color: #0077cc;
}
.copyable.copied {
  border-bottom-color: green;
  color: green;
}


.bio-result-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.bio-result-item:hover {
  background: #f7f7f7;
}

.cp-combobox { position: relative; width: 100%; }
.cp-display {
  width: 100%; height: 42px; border: 1px solid #cfd8dc; border-radius: 8px; font-size: 14px;
  background:#fff; padding: 6px 10px; text-align:left; cursor:pointer; font-weight: 300; color: #000;
}
.cp-display:hover {background:#fff; color:#000;}
.cp-caret { float: right; opacity: .6; }
.cp-dropdown {
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:1000;
  background:#fff; border:1px solid #ddd; border-radius:8px;
  box-shadow:0 4px 16px rgba(0,0,0,.08); padding:6px;
  max-height:240px; overflow:auto;
}
.cp-search { margin-bottom:6px; padding-left: 8px; padding-right: 20px;}
.cp-search input { width:100%; padding:6px; border:1px solid #ddd; border-radius:6px; }
.cp-item { padding:6px 8px; border-radius:4px; cursor:pointer; }
.cp-item:hover { background:#f1f5f9; }
.cp-empty { padding:6px; color:#999; }
.cp-create {
    width: 90%;
    margin-top: 6px;
    margin-left: 8px;
    padding: 6px 6px;
    border: 1px dashed #28af8b;
    background: #f6fffb;
    color: #28af8b;
    border-radius: 6px;
    cursor: pointer;
    font-size: small;
}

.cp-item-separator {
  padding: 6px 12px;
  font-weight: bold;
  background: #f3f3f3;
  color: #444;
  border-top: 1px solid #e6e6e6;
}

.searchable-select {
  width: 100%;
  margin-right: 10px;
  margin-bottom: 10px;
}

/* 🖼 Модалка профиля */
.profile-modal {
  max-width: 500px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  font-family: 'Jost', sans-serif;
}

.profile-block {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #ddd;
  object-fit: cover;
}

.profile-settings .btn {
  display: block;
  margin: 6px 0;
  width: 100%;
  text-align: left;
}

/* Только для модалки БИО */
.bio-modal {
  display: none !important; /* по умолчанию скрыта */
  align-items: center;
  justify-content: center;
}

.bio-modal.show {
  display: flex !important; /* показываем при открытии */
}

/* === БИО форма === */
.bio-form .form-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bio-form .form-group label {
  width: 130px;
  font-weight: 500;
  color: #333;
}

.bio-form .form-group input,
.bio-form .form-group select,
.bio-form .form-group textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.bio-form .form-group textarea {
  min-height: 70px;
  resize: vertical;
}

.bio-form .form-actions {
  text-align: right;
  margin-top: 24px;
}

.bio-form .btn-primary,
.bio-form .btn-secondary {
  border: 1px solid #2f4f4f;
  background: #fff;
  color: #2f4f4f;
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.bio-form .btn-primary {
  background: #18a67b;
  color: #fff;
  border: none;
}

.bio-form .btn-primary:hover {
  background: #15936e;
}

.bio-form .btn-secondary:hover {
  background: #f0f0f0;
}


/* 🎨 Центрированная модалка для статусов БИО */
.modal-bio-status {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-bio-status .modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
}

/* ❌ Кнопка-крестик */
.modal-bio-status .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}
.modal-bio-status .modal-close:hover {
  color: #000;
}

.file-del-btn {
  border: none;
  background: none;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}

.file-del-btn:hover {
  color: #c00;
  background: none;
}

.zone-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.inspection-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.inspection-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}

/* 📸 Стопка фото (как в iMessage) */
.photo-stack {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 80px;
  margin: 4px;
  cursor: pointer;
}

.photo-stack .stack-layer,
.photo-stack .stack-top {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.photo-stack .stack-layer {
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}


.photo-stack .stack-layer:nth-child(1) {
  transform: rotate(-4deg) translate(-4px, -4px);
  z-index: 1;
}
.photo-stack .stack-layer:nth-child(2) {
  transform: rotate(4deg) translate(4px, -4px);
  z-index: 2;
}

.photo-stack .stack-top {
  z-index: 3;
}
.photo-stack .stack-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-stack .stack-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 12px;
}

/* ✨ Анимация при наведении */
.photo-stack:hover .stack-layer:nth-child(1) {
  transform: rotate(-8deg) translate(-8px, -8px);
  opacity: 0.9;
}
.photo-stack:hover .stack-layer:nth-child(2) {
  transform: rotate(8deg) translate(8px, -8px);
  opacity: 0.9;
}
.photo-stack:hover .stack-top {
  transform: scale(1.05);
}

#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 10000; /* 🚀 поверх всех модалок */
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  z-index: 10001; /* ещё выше для надежности */
}

.bonuses-toolbar{
  display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-bottom:8px;
}
.bonuses-toolbar label{
  font-size: 14px; color:#3B485A;
}
.curator-cell{
  display:inline-flex; align-items:center; gap:6px; max-width:100%;
}
button.bonus-del{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border:none; background:transparent;
  padding:0; margin-left:4px; border-radius:6px; cursor:pointer;
  color:#6b778c; opacity:.7; transition:opacity .15s, background .15s, color .15s;
}
button.bonus-del:hover{
  opacity:1; background:#f2f4f7; color:#b00020;
}

.insp-card{
  border:1px solid #e6e8eb; border-radius:12px; padding:12px; margin-bottom:10px; background:#fff;
}
.insp-head{display:flex; justify-content:space-between; align-items:center;}
.insp-date{font-weight:600; color:#2b2f36;}
.insp-type{font-weight:600; color:#3B485A;}
.insp-type.danger{color:#b00020;}
.insp-meta{color:#6b778c; font-size:12px; margin-top:2px;}

.insp-chip-row{display:flex; gap:8px; flex-wrap:wrap; margin-top:8px;}
.insp-chip{
  font-size:12px; border:1px solid #e6e8eb; padding:3px 8px; border-radius:999px; background:#fafbfc; color:#3B485A;
}
.insp-chip.ok{background:#f1faf4; border-color:#d3f0dc; color:#1e7e34;}

.insp-details summary{
  cursor:pointer; font-size:13px; color:#2f6fda; margin-top:6px; list-style:none;
}
.insp-details summary::-webkit-details-marker{display:none;}
.insp-zones{list-style:none; padding:0; margin:6px 0 0;}
.insp-zone{padding:6px 0; border-top:1px dashed #eee; font-size:13px; line-height:1.35;}
.insp-zone .zone-name{font-weight:600;}

.insp-notes{margin-top:8px; font-style:italic; color:#3B485A; background:#f7f9fc; padding:8px; border-radius:8px;}

.insp-del{
  margin-top:8px; background:none; border:none; color:#b00020; font-size:12px; cursor:pointer; padding:0;
}
.insp-del:hover {
    text-decoration: underline;
    background-color: unset;
    text-underline-offset: 5px;
    color: #333;
}

.address-cell{
  display:inline-flex; align-items:center; gap:6px; max-width:100%;
}
button.fine-del{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border:none; background:transparent;
  padding:0; margin-left:4px; border-radius:6px; cursor:pointer;
  color:#6b778c; opacity:.7; transition:opacity .15s, background .15s, color .15s;
}
button.fine-del:hover{
  opacity:1; background:#f2f4f7; color:#b00020;
}

/* ===== Результат ремонта (модалка заявки) ===== */
.result-card {
  margin-top: 14px;
  background: #f7faf9;
  border: 1px solid #e3eee9;
  border-radius: 12px;
  padding: 14px;
}
.result-card .rc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #2a6b57;
  margin-bottom: 8px;
}
.result-card .rc-note {
  font-size: 12px;
  color: #6b7a76;
  margin-bottom: 8px;
}
.result-card textarea {
  width: 96%;
  min-height: 90px;
  border-radius: 10px;
  border: 1px solid #cfe1da;
  background: #fff;
  padding: 10px 12px;
  resize: vertical;
}
.result-photos {
  margin-top: 10px;
}
.result-photos .label {
  font-weight: 600;
  margin-bottom: 6px;
}
.result-photos .uploader {
  display: inline-block;
  padding: 10px 14px;
  background: #f1f6f4;
  border: 2px dashed #cfe1da;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  font-size: 14px;
}
.result-photos .uploader input[type=file]{
  position:absolute; inset:0; opacity:0; cursor:pointer;
}
.result-gallery{
  display:flex; flex-wrap:wrap; gap:8px; margin-top:8px;
}
.result-thumb{
  width:84px; height:84px; border-radius:8px;
  border:1px solid #d8e6e0; object-fit:cover; cursor:pointer;
}
.result-actions{
  display:flex; gap:10px; margin-top:12px;
}

.file-list {
  margin-top: 8px;
  font-size: 13px;
  color: #333;
}
.file-list .file-item {
  display: inline-block;
  align-items: center;
  gap: 6px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 8px;
  margin: 4px;
  width: fit-content;
}
.file-list .file-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-list .file-item .remove-btn {
  cursor: pointer;
  font-size: 14px;
  color: #b00;
}

.req-result-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
}
/* =========================
   🧊 CRYO CARDS — UPGRADE
   ========================= */

/* базовая карточка (усиленная, но совместимая) */
.cryo-card {
  background:#fff;
  border:1px solid #e6eaf0;
  border-radius:16px;
  padding:20px 22px;
  margin-bottom:16px;

  box-shadow:0 6px 18px rgba(0,0,0,.05);
  position: relative;

  transition: all 0.2s ease;
}

.cryo-card:hover {
  box-shadow:0 12px 28px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

/* цветовая полоска слева (статусы) */
.cryo-card:not(.is-archived) {
  border-left:4px solid #3b82f6;
}

.cryo-card[data-status="подготовка"] {
  border-left-color:#3b82f6;
}
.cryo-card[data-status="в пути"] {
  border-left-color:#f59e0b;
}
.cryo-card[data-status="доставлено"] {
  border-left-color:#22c55e;
}
.cryo-card[data-status="закрыто/архив"] {
  border-left-color:#9ca3af;
}

/* архив */
.cryo-card.is-archived {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.cryo-card.is-archived .cryo-status {
  color: #777;
  font-weight: 500;
}

/* =========================
   HEADER / ROUTE
   ========================= */

.cryo-route {
  font-weight:600;
  font-size:16px;
  color:#0f172a;
}

.cryo-route-compact {
  font-size:14px;
  color:#475569;
}

/* =========================
   STATUS
   ========================= */

.cryo-status-wrapper {
  margin-top:6px;
}

.cryo-status {
  border-radius:999px;
  padding:6px 12px;
  font-size:12px;
  font-weight:600;
  background:#eef2f7;
  color:#233;
}

.cryo-status[data-s="в пути"] { background:#fff6db; color:#7a5f00; }
.cryo-status[data-s="доставлено"] { background:#dcfce7; color:#0a8754; }
.cryo-status[data-s="архив"] { background:#f4f4f5; color:#6b7280; }

/* =========================
   EDIT (НЕ ЛОМАЕМ)
   ========================= */

.cryo-edit {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.cryo-edit:hover .cryo-status {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.08);
}

/* ✏️ НЕ занимает место */
.cryo-edit::after {
  content: "✏️";
  position: absolute;
  right: -14px;      /* регулируй */
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.cryo-edit:hover::after {
  opacity: 0.6;
}

.cryo-edit.editing .cryo-status {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

.cryo-edit select {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #3B82F6;
}

/* =========================
   MAIN BLOCK
   ========================= */

.cryo-main {
  margin-top:14px;
  display:grid;
  gap:8px;
}

.cryo-line {
  display: flex;
  align-items: center;   /* 🔥 ВОТ ЭТО ГЛАВНОЕ */
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.cryo-line strong {
  margin-right: 4px;
  font-weight: 600;
}

.cryo-line strong {
  color:#6b7280;
  font-weight:500;
  margin-right:6px;
}

/* =========================
   SECONDARY
   ========================= */

.cryo-secondary {
  margin-top:12px;
  color:#6b7280;
  font-size:13px;

  display:flex;
  flex-direction:column;
  gap:4px;
}

.cryo-secondary .item {
  display: flex;
  align-items: center;   /* 🔥 тоже сюда */
  gap: 6px;
}

/* =========================
   PROFIT
   ========================= */

.cryo-profit {
  font-weight:600;
}

/* =========================
   DIVIDER
   ========================= */

.cryo-divider {
  border-top:1px dashed #e5e7eb;
  margin:14px 0;
}

.cryo-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  opacity: 0.7;
}

/* =========================
   ACTIONS
   ========================= */

.cryo-actions {
  display:flex;
  gap:8px;
  margin-top:12px;
  flex-wrap:wrap;
}

.btn-small,
.btn-slim {
  border:1px solid #e5e7eb;
  background:#f8fafc;
  padding:6px 10px;
  border-radius:10px;
  font-weight:600;
  font-size:13px;
  color:#0f172a;
}

.btn-small:hover,
.btn-slim:hover {
  background:#eef2f7;
}


/* карточка дьюара: две колонки (контент + действия) */
.dewar-card {
  display: block;
  grid-template-columns: 1fr auto;
  align-items: flex-start; /* 👈 текст и кнопки в линию */
  gap: 14px 16px;
  padding: 16px 18px;
  border: 1px solid #eef1ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
  margin-bottom: 12px;
}

/* левый блок контента и правый блок кнопок */
.dewar-main{ grid-column: 1 / 2; }
.dewar-actions{ grid-column: 2 / 3; display:flex; gap:8px; align-items:flex-start; margin-top: 20px;}

.dewar-title{ font-weight:600; font-size:15px; color:#27323f; }
.dewar-title .sep{ color:#98a2ad; margin:0 6px; }

/* список броней */
.dewar-res-list{ margin-top:8px; display:flex; flex-direction:column; gap:6px; }
.dewar-res-item{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  font-size:13px;
  background:#f7faf8; border:1px dashed #dce6df; padding:6px 10px; border-radius:8px;
}
.dewar-res-dates{ font-weight:600; }
.dewar-res-route{ color:#55646f; }     /* НОВОЕ: строка маршрута */
.dewar-res-shid{ color:#80939f; font-size:12px; }
.dewar-res-empty{
  font-size:13px; color:#a2aeb7; background:#fafafa;
  border:1px dashed #eee; padding:8px 10px; border-radius:8px;
}

/* редактирование: форма становится ниже и на всю ширину */
.dewar-edit-row{
  grid-column: 1 / -1;               /* ВАЖНО: растягиваем на всю карточку */
  margin-top:4px; padding-top:12px; border-top:1px solid #eef1ee;
}
.dewar-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 160px; /* чуть уже */
  gap: 12px;
  margin-bottom: 10px;
  align-items: center; /* 👈 выравнивание по центру */
}
.dewar-edit-grid input,
.dewar-edit-grid select {
  height: 40px;          /* одинаковая высота */
  padding: 8px 10px;
  border: 1px solid #dfe7e2;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.dewar-edit-grid label{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:#6b7b86; }

.dewar-edit-actions {
  display: flex;
  gap: 10px;
  align-items: center;  /* 👈 центрируем */
}
.dewar-edit-actions button {
  height: 40px;          /* 👈 как у input */
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
}


/* мелочи */
.ack-btn.gray{ background:#f3f4f6; color:#333; }
.dewar-field{ cursor:default; }
.dewar-field[ondblclick]{ cursor:pointer; border-bottom:1px dashed transparent; }
.dewar-field[ondblclick]:hover{ border-bottom-color:#c7d2cc; }

/* =========================
   MISC
   ========================= */

.input-error {
  outline: 2px solid #e53935;
  border-radius:6px;
}

.kids-badge {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;

  background: #eef2ff;
  color: #3730a3;
}

.evict-badge {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;

  background: #fee2e2;   /* светло-красный */
  color: #991b1b;        /* насыщенный текст */

  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.evict-badge:hover {
  background: #fecaca;   /* чуть ярче при hover */
}

@media (max-width: 600px) {
  .surrogate-cell {
    gap: 4px;
  }

  .evict-badge,
  .kids-badge,
  .preg-badge {
    font-size: 10px;
    padding: 2px 5px;
  }
}

#bulkBar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 16px; z-index: 9999;
  background: #fff; border: 1px solid #e6e8eb; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 10px 14px; display: none;
}
#bulkBar.visible { display: block; }
#bulkBar .bulk-inner { display: flex; gap: 16px; align-items: center; }
#bulkBar .bulk-actions { display: flex; gap: 8px; }
#bulkBar .btn { padding: 6px 12px; border-radius: 8px; border: 1px solid #d9dde3; background: #f7f8fa; cursor: pointer; }
#bulkBar .btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }

#bulkEditModal { position: fixed; inset: 0; z-index: 10000; }
#bulkEditModal .bulk-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
#bulkEditModal .bulk-modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(720px, 92vw); background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
}
.bulk-modal__header, .bulk-modal__footer {
  padding: 14px 16px; border-bottom: 1px solid #eef1f4; display: flex; align-items: center; justify-content: space-between;
}
.bulk-modal__footer { border-top: 1px solid #eef1f4; border-bottom: none; }
.bulk-modal__body { padding: 16px; display: grid; gap: 12px; }
.bulk-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; align-items: center; }
.icon-btn { background: none; border: none; font-size: 16px; cursor: pointer; }
.muted { color: #667085; }
.small { font-size: 12px; }
.status-edit .input { height:42px; }
.status-chip { cursor: pointer; }
.card-bio {
  font-size: 12px;
  color: #555;
  margin-top: 2px;
  line-height: 1.3;
}
.card-bio .bio-label {
  font-weight: 500;
  margin-right: 4px;
}
.card-bio .bio-name {
  font-weight: 400;
}
.card-bio .bio-country {
  font-size: 11px;
  color: #777;
}
.bio-flag {
  display: inline-flex;
  width: 16px;
  height: 12px;
  line-height: 0;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}
.bio-flag svg { width: 100%; height: 100%; display: block; }
.popup-bio-block {
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #f9fafc;
  font-size: 13px;
  line-height: 1.4;
}
.popup-bio-block .popup-row {
  margin-bottom: 4px;
}
.popup-bio-block strong {
  color: #2a2a2a;
}
.mini-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.mini-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef5ff;
    color: #333;
    font-size: 10px;
    line-height: 1;
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-width: 100%;
}
.mini-chip .chip-ico { display:inline-flex; width:16px; height:16px; }
.mini-chip .chip-ico svg { width:16px; height:16px; display:block; stroke: currentColor; }
.mini-chip .chip-label { font-weight: 600; }
.mini-chip .chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Контейнер чипов в мини-карточке BIO */
.mini-chips {
  display: grid;
  grid-template-columns: repeat(2, max-content); /* 👈 не более 3 в строке */
  gap: 6px 8px;                                   /* row / col gaps */
  align-items: center;
}

/* адаптив: уже экран — меньше чипов в ряд */
@media (max-width: 1100px) {
  .mini-chips { grid-template-columns: repeat(2, max-content); }
}
@media (max-width: 640px) {
  .mini-chips { grid-template-columns: repeat(1, max-content); }
}

/* сами чипы — чтобы не распирали строку */
.mini-chip {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-chip:hover {
  background: #e0ebf5;
}
.mini-chip.copied {
  background: #28af8b !important;
  color: #fff !important;
}

/* превьюшки внутри зоны */
.zone-thumbs { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.uploader-thumb { width:96px; height:96px; position:relative; border-radius:10px; overflow:hidden; background:#f3f3f3; }
.uploader-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.uploader-thumb .state {
  position:absolute; left:6px; right:6px; bottom:6px;
  background:rgba(0,0,0,.5); color:#fff; font-size:11px;
  padding:2px 6px; border-radius:6px; text-align:center;
}
.uploader-thumb .retry-btn{
  position:absolute; right:6px; top:6px;
  background:#fff; border:none; border-radius:8px; padding:2px 6px; cursor:pointer; font-size:11px;
  display:none;
}
.uploader-thumb .del-btn{
  position:absolute; left:6px; top:6px;
  background:#fff; border:none; border-radius:8px; padding:2px 6px; cursor:pointer; font-size:11px;
}

/* === TRANSFER CHIPS — компактный SaaS стиль === */

.transfer-chips-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 30px;
}

/* Шапка */
.transfer-chips-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 10px;
}

.tch-title {
    font-weight: 500;
    color: #27323f87;
    font-size: 12px;
    text-transform: uppercase;
}

.add-transfer-btn {
  background: #18a67b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: 0.2s ease;
}

.add-transfer-btn:hover {
  background: #159a6f;
}

/* Список чипов */
#transferChips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* Старая кнопка — выключена */
.add-attempt-btn {
  display: none !important;
}

/* Чип */
.t-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: 0.15s;
}

.t-chip:hover {
  background: #f2f2f2;
  transform: translateY(-1px);
}

.t-chip .badge {
  font-weight: 600;
  font-size: 12px;
  color: #111;
}

.t-chip .meta {
  font-size: 12px;
  color: #666;
}

/* Статусы */
.t-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.t-chip.ongoing::before     { background: #f4cc00; }
.t-chip.positive::before    { background: #2ecc71; }
.t-chip.hcg_double::before  { background: #27ae60; }
.t-chip.hcg_neg::before     { background: #e74c3c; }
.t-chip.missed::before      { background: #bbbbbb; }
.t-chip.abortion::before    { background: #e67e22; }

/* Кнопка “Внести результат” */
.chip-btn {
  margin-left: auto;
  background: #18a67b;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.chip-btn:hover {
  background: #16946e;
}

/* === Адаптив: по одной в строке на узких экранах === */
@media (max-width: 700px) {
  #transferChips .t-chip {
    flex: 1 1 100%;
  }
}

/* === Заголовок блока Задач (SaaS) === */
.tasks-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 16px;
}

.tasks-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Кнопка "Добавить задачу" — такая же, как "Добавить перенос" */
.add-task-btn {
  background: #18a67b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.add-task-btn:hover {
  background: #159a6f;
}

.tasks-section {
  /* padding-top: 32px; */
  margin-top: 32px;
  border-top: 1px solid #e5e7eb; /* светлая SaaS-линия */
  background: #3b485a0a;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #f3f3f3;
}

.tasks-count {
  background: #e5f7ef;
  color: #18a67b;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}

select:invalid {
  color: #888;
}

/* Общая обертка */
.surrogate-avatar-wrap {
  position: relative;
  display: inline-block;
  border-radius: 50%;
}

.surrogate-avatar-wrap img {
  position: relative;
  border-radius: 50%;
  z-index: 2; /* фото всегда поверх */
}

/* универсальная заготовка под свечение */
.surrogate-avatar-wrap::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  z-index: 1; /* за фото */
  opacity: 0;
  pointer-events: none;
}

.surrogate-avatar-wrap.glow-ongoing::after {
  background: rgba(255, 200, 0, 0.20);
  animation: pulse-glow 2s ease-in-out infinite;
  opacity: 1;
}

.surrogate-avatar-wrap.glow-positive::after {
  background: rgba(40, 167, 69, 0.20);
  animation: pulse-glow 2s ease-in-out infinite;
  opacity: 1;
}

.surrogate-avatar-wrap.glow-hcg_double::after {
  background: rgba(40, 167, 69, 0.20);
  animation: pulse-glow 2s ease-in-out infinite;
  opacity: 1;
}
.surrogate-avatar-wrap.glow-neg::after {
  background: rgba(220, 53, 69, 0.20);
  animation: pulse-glow 2s ease-in-out infinite;
  opacity: 1;
}


@keyframes pulse-glow {
  0%   { transform: scale(1);   opacity: .7; filter: blur(10px); }
  50%  { transform: scale(1.18); opacity: .95; filter: blur(18px); }
  100% { transform: scale(1);   opacity: .7; filter: blur(10px); }
}

.avatar-hcg-badge {
  position: absolute;
  top: 10px;
  right: -155px;
  background: #fff6d5;
  /* border: 1px solid #ffca2c; */
  color: #856404;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  /* box-shadow: 0 2px 6px rgba(0,0,0,.1); */
}

.avatar-placeholder {
  width: 120px;  /* как у твоего .surrogate-avatar */
  height: 120px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  border: 2px dashed #ccc;
}

.avatar-placeholder:hover {
  background: #e9e9e9;
}

.transfer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 4px 0;
}

.transfer-item {
  display: flex;
  padding: 16px 20px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.transfer-date {
  font-size: 15px;
  font-weight: 600;
  width: 120px;
  color: #333;
}

.transfer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transfer-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.transfer-status {
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

/* Статусы */
.status-wait     { background: #fff7d6; color: #a58500; }
.status-pos      { background: #e5f8e8; color: #1c8b3c; }
.status-neg      { background: #ffe5e5; color: #c94b4b; }
.status-other    { background: #f0f0f0; color: #666; }

.transfer-bio {
  font-size: 13px;
  color: #6b6b6b;
}

/* === Attempt Modal (как surrogatePopup) === */
.amodal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center; z-index:9999;
}
.amodal-card{
  background: #e9e9e9; 
  border-radius:16px; 
  width:min(820px, 94vw);
  box-shadow:0 20px 60px rgba(0,0,0,.18); 
  padding:22px;
}
.amodal-header{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;
}
.amodal-title{ margin:0; font-size:18px; font-weight:600; color:#27323f; }
.amodal-close{ border:none; background:transparent; font-size:22px; cursor:pointer; line-height:1; color:#8a97a6; }
.amodal-close:hover{background:transparent; color:#8a97a6;}
.amodal-body{
  display:block;             /* больше не общая сетка */
  max-height:70vh;           /* ограничиваем высоту */
  overflow-y:auto;           /* прокрутка */
  padding-left: 10px;
}

.attempt-body .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}
.attempt-body .form-row .short {
  max-width: 160px; /* сузим поля до лейбла */
}
.attempt-body .form-row.first-row {
  grid-template-columns: 120px 1fr 120px 120px; /* №, дата, кол-во, качество */
}


.amodal-body label{ display:flex; flex-direction:column; gap:6px; font-size:13px; color:#44505c; }
.amodal-body input, .amodal-body select{
  border:1px solid #e4e9ee; border-radius:10px; padding:10px 12px; font-size:14px;
  outline:none;
}
.amodal-body input:focus, .amodal-body select:focus{ border-color:#a8c5ff; box-shadow:0 0 0 3px rgba(64,123,255,.12); }
.amodal-footer{
  display:flex; justify-content:flex-end; gap:10px; margin-top:16px;
}
.btn{ padding:10px 14px; border-radius:12px; border:1px solid #e4e9ee; background:#fff; cursor:pointer; }
.btn-primary{ background:#18a67b; color:#fff; border-color:#18a67b; }
.btn-primary:hover{ filter:brightness(.95); }
.btn-danger{ border-color:#ffb4b4; color:#b21; background:#fff; }
.btn-danger:hover{ background:#fff4f4; color:#b21;}
@media (max-width: 640px) {
  .attempt-body .form-row {
    grid-template-columns: 1fr; /* на мобиле по одному */
  }
  .attempt-body .form-row .short {
    max-width: 100%;
  }
  .attempt-body .form-row.first-row {
    grid-template-columns: 1fr; /* по одному в ряд */
  }
}

.add-attempt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--primary-color);
  background: none;
  padding: 0;
  cursor: pointer;
}
.add-attempt-btn:hover {
  background-color: #fff;
}

.icon-btn {
  border: 1px solid var(--primary-color);
  background: transparent;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  width: 18px;
}

.icon-btn:hover {
  stroke: #0e7d5d; /* чуть темнее зелёный при ховере */
  background-color: #fff;
}

/* Контейнер для стека */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

/* Общий стиль тоста */
.toast-msg {
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 400px;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  font-size: 14px;
}

/* Появление */
.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* Варианты */
.toast-msg.success { background: #18a67b; color: #fff; border: none; }
.toast-msg.error   { background: #f44336; color: #fff; border: none; }
.toast-msg.info    { background: #2196f3; color: #fff; border: none; }

/* Заголовок */
.toast-msg strong {
  font-weight: 600;
  font-size: 14px;
}

/* Кнопка внутри тоста */
.toast-btn {
  background: #fff;
  color: #18a67b;
  border: 1px solid #18a67b;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}
.toast-btn:hover {
  background: #e9f9f3;
}

.toast-msg.persistent {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Базовый фон */
#surrogateStatusModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  z-index: 9999;
}

/* Контент — фиксируем и центрируем */
#surrogateStatusModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  width: min(720px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fadeInUp .25s ease;
}

#surrogateStatusModal .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

#surrogateStatusModal .modal-close:hover {
  color: var(--primary-color);
}


/* Анимация */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

#bioStatusModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  z-index: 9999;
}

/* Контент — фиксируем и центрируем */
#bioStatusModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  width: min(720px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fadeInUp .25s ease;
}

/* Кнопка закрытия */
#bioStatusModal .modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

#bioStatusModal .modal-close:hover {
  color: var(--primary-color);
}

/* ===== Входящие заявки ===== */

/* Для карточек */
#leads-list.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (min-width: 1300px) {
  #leads-list.grid-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}



/* Карточка */
.lead-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* min-height: 260px;  ← оставь только если хочешь базовую высоту */
  height: auto; /* 👈 вместо height:100% */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
}

.lead-card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-name {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}

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

.lead-meta {
  font-size: 14px;
  color: #444;
  margin-top: 6px;
  line-height: 1.4;
}

.lead-source {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

/* Цвета для источников */
.lead-source.marquiz  { background: #e0f7f1; color: #18a67b; }
.lead-source.webform  { background: #e6f0ff; color: #1a56db; }
.lead-source.whatsapp { background: #e9fbea; color: #28a745; }
.lead-source.telegram { background: #e6f0ff; color: #0088cc; }
.lead-source.vk       { background: #f0f2ff; color: #4a76a8; }
.lead-source.max      { background: #eef2ff; color: #3b5bdb; }
.lead-source.other    { background: #f1f1f1; color: #555; }


.lead-answers {
  margin-top: 8px;
  background: #fafafa;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
}

.lead-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lead-source.quiz {
  background: #f0e6ff;
  color: #6b21a8;
}

.lead-source.utm {
  background: #e3f2fd;
  color: #1565c0;
}

.error-hint {
  color: #d32f2f;
  font-size: 12px;
  margin-left: 4px;
  cursor: help;
}

/* Сообщения bubles*/
.msg-bubble {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 18px;
  margin: 4px 0;
  max-width: 80%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.msg-client {
  background: #f1f0f0;
  color: #000;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-bot {
  background: #007aff;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-failed {
  color: #3b485a;
  background: #ffebee !important;
  border: 1px solid #f44336;
}

.msg-row {
  display: flex;
  flex-direction: column;
}

.msg-time {
  font-size: 10px;
  color: #777777a3;
  margin-top: 2px;
  text-align: right;
}

.status-icon {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-left: 4px;
}

/* Исправляем вид ссылок и иконок внутри исходящих сообщений */
.msg-bot a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msg-bot a:hover {
  color: #e0e0e0 !important;
}

/* Если в сообщении есть иконка 📎 — осветлим её */
.msg-bot a img {
  filter: brightness(0) invert(1);
}

/* 📸 Не перекрашиваем вложенные изображения */
.msg-bot img {
  filter: none !important; /* убираем инверсию */
  border-radius: 10px;
  max-width: 240px;
  height: auto;
  display: block;
}

.chart-sm {
  max-width: 350px;
  max-height: 220px;
  margin: 0 auto;
}

.dist-table th, .dist-table td {
  border: 1px solid #eee;
  padding: 6px 8px;
  font-size: 14px;
}
.dist-table th {
  background: #f7f7f7;
}

.inactive-row {
  background: #fff3f3;   /* розоватый фон */
}

.inactive-row td {
  color: #a33;
}

.warn-badge {
  font-size: 13px;
  margin-left: 6px;
  color: #d9534f;
}

/* Обёртка для таблицы */
.leads-table-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;   /* ✅ скролл по горизонтали на маленьких экранах */
}

/* Таблица */
.leads-table {
  width: 100%;
  min-width: 800px;   /* ✅ застрахуем, чтобы колонки не схлопывались */
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

/* Ячейки */
.leads-table th,
.leads-table td {
  border: 1px solid #eee;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

/* Заголовки */
.leads-table th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

/* Узкие ячейки: тип клиента + ответственный */
.leads-table td:nth-child(6),
.leads-table td:nth-child(7) {
  white-space: nowrap;
}

/* Канбан лиды */
/* ===== Канбан для лидов ===== */
.kanban-board-leads {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-board-leads .kanban-column {
  flex: 1;
  min-width: 260px;
  background: #fafafa;
  border-radius: 10px;
  padding: 8px;
}

.kanban-board-leads .kanban-header {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f1f3f5;
  color: #333;
}

.kanban-board-leads .kanban-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Мини-карточка лида */
.kanban-board-leads .kanban-card {
  position: relative;   /* 👈 нужно, чтобы source-badge цеплялся к карточке */
  background: #fff;
  border: 1px solid #e4e6eb;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s;
}

.kanban-card {
  transition: transform 0.35s ease, box-shadow 0.3s ease;
}
.kanban-card.has-unread {
  box-shadow: 0 0 6px rgba(229, 62, 62, 0.4);
}


.kanban-board-leads .kanban-card:active {
  cursor: grabbing;
  transform: scale(1.02);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.kanban-board-leads .kanban-card b {
  font-size: 15px;
  color: #222;
  display: block;
  margin-bottom: 2px;
}

.kanban-board-leads .kanban-card .contact {
  font-size: 13px;
  color: #555;
}

.kanban-board-leads .kanban-card .meta {
  font-size: 12px;
  color: #777;
  margin-top: 4px;
}

/* базовый стиль бейджа источника */
.source-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #fff;
  background: #607d8b;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  font-weight: 500;
}

/* позиционирование только для карточек */
.kanban-board-leads .source-badge {
  position: absolute;
  top: 6px;
  right: 6px;
}

.source-badge.max      { background: #586b82; }
.source-badge.whatsapp { background: #25d366; }
.source-badge.telegram { background: #0088cc; }
.source-badge.marquiz  { background: #ff9800; }
.source-badge.webform  { background: #3f51b5; }
.source-badge.google   { background: #4285f4; }
.source-badge.yandex   { background: #ffcc00; color:#000; }
.source-badge.vk       { background: #4a76a8; }
.source-badge.other    { background: #9e9e9e; }

/* Обертка под вкладки и контент */
.lead-modal-body {
    position: relative;
    min-height: 300px;
    border-radius: 6px;
    background: #fff;
    margin-top: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Панель вкладок теперь внутри body */
.lead-modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ddd;
  margin-top: 10px;
}

/* Кнопки вкладок */
.lead-modal-tabs button {
  padding: 8px 18px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: #f1f1f1;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover */
.lead-modal-tabs button:hover {
  background: #e0e0e0;
  color: #333;
}

/* Активная вкладка */
.lead-modal-tabs button.active {
  background: #fff;
  color: var(--primary-color);
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-top: 1px solid #ddd;
  margin-bottom: -1px;
  z-index: 2;
  position: relative;
}

#leadTasksTab {
  top: 0;
  background: #fff;
  z-index: 2;
}

/* Контент */

.tab-pane {
  padding: 16px;
  background: #fff;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: all 0.2s ease;
  position: absolute;
  width: 100%;
}

.tab-pane.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.lead-extra {
  margin-top: 12px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 6px;
  font-size: 13px;
}

.lead-extra h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.lead-extra ul {
  margin: 0;
  padding-left: 16px;
}

.lead-extra li {
  margin-bottom: 4px;
}

#rejectLeadModal {
  z-index: 10000 !important;
}

#leadCommentsTab {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#leadCommentsTab textarea {
  width: 98%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  resize: vertical;
  font-size: 14px;
}

#leadCommentsTab button {
  align-self: flex-start;
  background: #18a67b;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}

#leadCommentsTab button:hover {
  background: #148a65;
}

/* Лид Лента*/
.timeline {
  position: relative;
}

.tl-mode {
  font-size:10px;
  padding:2px 6px;
  border-radius:6px;
  background:#eee;
  color:#777;
  cursor:pointer;
  transition:0.15s;
}

.tl-mode.active {
  background:#e8f7f2;
  color:#18a67b;
}

/* по умолчанию скрыты */
.tl-card .task-actions {
  opacity: 0;
  transition: 0.15s;
}

/* desktop hover */
@media (hover: hover) {
  .tl-card:hover .task-actions {
    opacity: 1;
  }
}

/* 📱 мобила — всегда показываем */
@media (hover: none) {
  .tl-card .task-actions {
    opacity: 1;
  }
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #fafafa;
}

.tl-item {
  margin-bottom: 14px;
}

.tl-card {
  background:#fff;
  border:1px solid #eee;
  border-radius:10px;
  padding:10px 12px;
  font-size: 14px;
}

.tl-item {
  position: relative;
  margin-bottom: 16px;
}

.tl-dot {
  position: absolute;
  left: -22px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
}

.tl-task .tl-dot {
  background: #18a67b;
}

.tl-comment .tl-dot {
  background: #bbb;
}

.tl-log .tl-dot {
  background: #e0e0e0;
}

.tl-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.15s ease;
}

.tl-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tl-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

.tl-body {
  font-size: 14px;
}

.tl-task.active .tl-card {
  border-left: 3px solid #18a67b;
}

.tl-task.done .tl-card {
  opacity: 0.6;
}

/* Конец лид лента*/
.lead-info {
  display: block;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.info-card {
  background: #fafafa;
  border-radius: 8px;
  padding: 8px 14px;
}

.info-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #333;
  font-weight: 600;
}

.info-card div {
  margin: 6px 0;
  font-size: 14px;
  color: #444;
}

.notif-bell {
  position: relative;
  cursor: pointer;
  font-size: 20px;
  margin-left: 20px;
  display:none;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e53935;   /* красный кружок */
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  display: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.notif-tray {
  display: none;
  position: absolute;
  top: 40px;
  right: 10px;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2000;
  font-family: 'Jost', sans-serif;
}

.notif-tray.show {
  display: block;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  transition: background 0.2s;
}

.notif-item:hover {
  background: #f9f9f9;
}

.notif-item strong {
  display: block;
  font-size: 15px;
  color: #1a2a6c;       /* выделяем имя клиента */
  margin-bottom: 3px;
}

.notif-item small {
  color: #888;          /* серое время */
  font-size: 12px;
  display: block;
  margin-bottom: 5px;
}

.notif-item div {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.notif-item.unread {
  background: #eef6ff;       /* голубой фон */
  font-weight: 600;
}

.notif-item.read {
  background: #fff;
  color: #666;
}
/* Каналы */
#leadMessagesControls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  transition: border-color 0.2s;
}

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

.channel-btn.active {
  border-color: var(--primary-color); /* ❗ только рамка подсвечена */
  background: #fff; /* ❗ фон не меняем */
  color: inherit;   /* ❗ текст остаётся обычный */
}

/* Чекмарк в углу */
.channel-btn .checkmark {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  color: var(--primary-color); /* будет управлять цветом универсальной иконки */
}

.channel-btn.active .checkmark {
  display: block;
}


/* Подменю WA */
#waTemplateControls {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  margin-top: 4px;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 9999;
  min-width: 220px;
}

#waTemplateControls select {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 100%;
}

#waTemplateControls button.btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  width: fit-content;
}

#waTemplatePreview {
  font-size: 13px;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 8px;
  color: #333;
}

.msg-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
}

.modal-content {
  position: relative;
}

.modal-content > .btn.close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.btn-icon:hover {
  color: #000;
  background: none;
}

.msg-badge {
  background: #d33;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1;
  margin-left: 4px;
}

.task-entry {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-meta {
  font-size: 13px;
  color: #666;
}

.task-entry.overdue { border-left: 4px solid #d33; }
.task-entry.today   { border-left: 4px solid #28AF8B; }
.task-entry.future  { border-left: 4px solid #888; }

.btn-inline-convert {
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* Статус бар*/
.lead-status-timeline {
  display: flex;
  margin: 20px 0;
  width: 100%;
}

.status-step {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  background: #f1f1f1;
  position: relative;
  padding: 10px 20px;
  transition: all 0.3s ease;
}

/* форма стрелки */
.status-step::after {
  content: "";
  position: absolute;
  top: 0;
  right: -15px;
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 15px solid #f1f1f1;
  z-index: 2;
}

.status-step:first-child {
  border-radius: 6px 0 0 6px;
}
.status-step:last-child {
  border-radius: 0 6px 6px 0;
}

.status-step:hover {
  filter: brightness(0.95);
  cursor: pointer;
}

.status-step {
  transition: background-color 0.3s ease, color 0.3s ease;
}


.status-step:last-child::after {
  display: none;
}

/* активный */
.status-step.active {
  background: var(--primary-color);
  color: #fff;
}
.status-step.active::after {
  border-left-color: var(--primary-color);
}

/* завершённый */
.status-step.done {
  background: #28AF8B;
  color: #fff;
}
.status-step.done::after {
  border-left-color: #28AF8B;
}

/* внешний контейнер — радиус */
#leadModal {
  overflow: hidden;
}

#leadModal .modal-content {
  border-radius: 10px;
  overflow-y: auto;
}

.lead-modal-tabs .tab-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
  /* filter: invert(40%) sepia(10%) saturate(500%) hue-rotate(200deg);  лёгкая стилизация под общий стиль */
}

.icon-link {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.special-lead-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.special-lead-card:hover {
  background: #f9f9f9;
  border-color: #bbb;
}

.lead-flag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
  margin-left: 6px;
}

.flag-postponed {
  background: #fff6e0;
  color: #b26c00;
  border: 1px solid #f3d48a;
}

.flag-blacklisted {
  background: #ffe6e6;
  color: #b20000;
  border: 1px solid #ffb3b3;
}

.lead-status-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 8px;
}
.lead-status-badge strong {
  font-weight: 600;
}
.lead-status-badge .subtext {
  font-size: 12px;
  color: #555;
}

.lead-status-badge.converted {
  color: #216a3b;
  border: 1px solid #216a3b;
}
.lead-status-badge.rejected {
  color: #722;
  border: 1px solid #722;
}
.lead-status-badge.postponed {
  color: #6b4a00;
  border: 1px solid #6b4a00;
}
.lead-status-badge.blacklisted {
  color: #8b0000;
  border: 1px solid #8b0000;
}

.lead-status-timeline.disabled {
  opacity: 0.4;
  /* filter: grayscale(100%);*/
  pointer-events: none; /* гасим события внутри */
  position: relative;
}

.lead-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  border-radius: 6px;
  pointer-events: auto; /* ✅ но сам оверлей и его кнопка активны */
}

.lead-locked-overlay .overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-unlock {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-unlock:hover {
  background: #ececec;
}

.short-link {
  display: inline-block;
    max-width: 187px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: text-bottom;
    cursor: pointer;
}

.short-link:hover {
  color: #1e9073;
}

/* === iOS-style toggle === */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
  border: none;
  border-left: 1px solid #eee;
  height: 40px;
  padding-left: 8px;
}

label.toggle-wrapper:hover {
    background: #f7f8f8;
    border-radius: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #28AF8B; /* твой основной цвет Vita */
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 22px;
}

/* ==== iOS-style switch ==== */

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

.ios-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d1d6;
  transition: 0.25s;
  border-radius: 24px;
}

.ios-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.ios-switch input:checked + .slider {
  background-color: #34c759;
}

.ios-switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* подпись */
.task-switch-label {
  font-size: 13px;
  color: #ccc;
}

#taskModal .modal-content {
  max-width: 600px;
  padding: 32px 40px; /* 👈 одинаковые отступы */
}
#taskModal input, #taskModal textarea, #taskModal select {
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
}
#taskModal label {
  font-weight: 500;
  color: #333;
}

#taskModal input,
#taskModal textarea,
#taskModal select {
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  height: 42px; /* 👈 одинаковая высота */
}

#taskModal textarea {
  height: auto; /* чтобы текстовое поле растягивалось */
  min-height: 80px;
  resize: vertical;
}

#taskModal label {
  font-weight: 500;
  color: #333;
}

#taskModal .modal-content {
  max-width: 600px;
  padding: 32px 40px;
}

#taskModal input,
#taskModal select,
#taskModal textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 🔹 Подсветка при фокусе */
#taskModal input:focus,
#taskModal select:focus,
#taskModal textarea:focus {
  border-color: #28AF8B;               /* твой фирменный зелёный */
  box-shadow: 0 0 0 2px rgba(40, 175, 139, 0.25); /* мягкое свечение */
  outline: none;
}

.quick-title-tag {
  background: #f2f5f4;
  color: #28AF8B;
  border: 1px solid #cde6dd;
  border-radius: 10px;
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.quick-title-tag:hover {
  background: #28AF8B;
  color: #fff;
  border-color: #28AF8B;
}

/* Чтобы модалка результата всегда была поверх всех */
#taskResultModal {
  z-index: 9999 !important;
}

/* А обычные модалки (например, leadModal) можно оставить на уровне 1000–2000 */
#leadModal, .modal {
  z-index: 2000;
}

/* === Модалка задачи === */
.task-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
}

.task-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 6px;
}

.task-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

.task-entity-link {
  font-size: 14px;
  margin-top: 4px;
}

.entity-link {
  color: #28AF8B;
  text-decoration: none;
  font-weight: 500;
}

.entity-link:hover {
  text-decoration: underline;
}

.icon-link {
  vertical-align: middle;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  filter: brightness(0.4);
}

/* Быстрые названия */
.quick-task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Поля */
.task-modal-inner input,
.task-modal-inner textarea,
.task-modal-inner select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  height: 42px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.task-modal-inner input:focus,
.task-modal-inner textarea:focus,
.task-modal-inner select:focus {
  border-color: #28AF8B;
  box-shadow: 0 0 0 2px rgba(40, 175, 139, 0.25);
  outline: none;
}

.task-modal-inner textarea {
  min-height: 80px;
  height: auto;
  resize: vertical;
}

/* Дата и время рядом */
.date-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Кнопки */
.task-modal-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.task-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #222;
}

#editTaskTitle {
  margin-top: 4px;
}

#editTaskTitle::placeholder {
  color: #aaa;
  font-style: italic;
}

.task-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

/* Общий контейнер таймлайна */
.timeline-wrapper {
  position: relative;
  margin: 32px 0;
  padding-left: 60px;
  border-left: 3px solid #e6e6e6;
}

/* Иконка-шарик на линии */
.timeline-dot {
  position: absolute;
  left: -64px;
  top: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary-color, #2A8F88);
  background: var(--primary-color, #2A8F88);
  transition: transform 0.2s ease;
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.15);
}

/* Блок задачи */
.timeline-item-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.timeline-item-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* Заголовки секций ("Утро", "День" и т.д.) */
.timeline-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 12px 0;
  font-size: 24px;
  font-weight: 600;
  color: #444;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}
.timeline-header img {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
}

/* Метаданные под задачей */
.task-meta {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

/* Бейджи статусов */
.timeline-badge {
  display: inline-block;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  margin-left: 4px;
}

.task-meta img[alt="✓"],
.task-meta img[alt="ok"] {
  transform: translateY(-1px);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding-left: 28px;
  transition: all 0.2s ease;
  margin-bottom: 13px;
}

.search-box:focus-within {
  border-color: #18a67b;
  box-shadow: 0 0 0 2px rgba(24,166,123,0.15);
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  padding: 6px 28px 6px 10px; /* место под крестик справа */
  font-size: 13px;
  background: transparent;
  margin-bottom: 0px;
}

.search-icon {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  opacity: 0.7;
  pointer-events: none;
}

.clear-icon {
  position: absolute;
  right: 8px;
  width: 14px;
  height: 14px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.search-box.has-value .clear-icon {
  opacity: 0.6;
}
.search-box.has-value .clear-icon:hover {
  opacity: 1;
}

.wa-badge {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 5px;
}
.wa-badge.active {
  background: #e5f9f1;
  color: #08865a;
}
.wa-badge.expired {
  background: #ffe5e5;
  color: #c62828;
}

/* ========================================
   🔥 Lead modal header
======================================== */

.lead-modal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 3%;
  margin-bottom: 10px;
  margin-top: 10px;
}

.lead-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  position: relative;
  margin-right: 30px;
}

/* ========================================
   🔥 Lead modal compact header
======================================== */

.lead-modal-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lead-modal-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ========================================
   📱 MOBILE
======================================== */

@media (max-width: 640px) {

  .lead-modal-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .lead-modal-main {
    flex: 1;
    min-width: 0;
  }

  /* 🔥 имя + badge в линию */
  .lead-modal-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .lead-modal-title .editable {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
  }

  /* 🔥 ID + source compact */
  .lead-modal-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
  }

  /* 🔥 кнопки столбиком */
  .lead-modal-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 96px;
    width: 100%;
    flex-direction: row;
  }

  .lead-modal-actions .btn {
    flex: 1;
    justify-content: center;
  }

}

.logs-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tab-btn {
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: #f2f2f2;
  font-weight: 500;
  transition: background 0.2s;
}
.tab-btn.active {
  background: #18a67b;
  color: #fff;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.comment-add textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  font-family: 'Jost', sans-serif;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 8px;
  margin-bottom: 8px;
}

.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.file-chip {
  font-size: 12px;
  background: #f4f4f4;
  border-radius: 6px;
  padding: 4px 8px;
  text-decoration: none;
  color: #333;
}
.file-chip:hover {
  background: #e2e2e2;
}

/* 💬 Комментарии */
.comment-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-size: 14px;
}

.comment-meta {
  color: #777;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-text {
  white-space: pre-line;
}

/* === Стили системных логов по типам === */
.log-item.fieldUpdate,
.log-item.embryoDelete,
.log-item.embryoExtend,
.log-item.embryoCreate,
.log-item.embryoUtilize,
.log-item.statusChange,
.log-item.taskAdd,
.log-item.taskUpdate,
.log-item.taskDone,
.log-item.taskReopen,
.log-item.photoReplace,
.log-item.photoDelete,
.log-item.taskDelete {
  background: none;
  border-left: 3px solid #dcdcdc;
  border-radius: 0;
  padding: 4px 0 4px 10px;
  margin: 6px 0;
  font-size: 13px;
  color: #555;
}
.log-item.invoiceAdd,
.log-item.invoiceEdit,
.log-item.invoiceStatus,
.log-item.invoiceDelete,
.log-item.documentUpload,
.log-item.documentDelete,
.log-item.documentUpdate {
  border-left: 3px solid #6f42c133;
  border-radius: 0;
  padding: 4px 0 4px 10px;
  margin: 6px 0;
  font-size: 13px;
  color: #555;
}

.log-item.embryoCreate, .log-item.embryoExtend, .log-item.invoiceAdd, .log-item.invoiceStatus, .log-item.documentUpload { border-left-color: #28a745; } /* зелёный */
.log-item.invoiceEdit, .log-item.documentUpdate { border-left-color: #3498db; background: #f8fbff; } /* синий */
.log-item.embryoDelete, .log-item.embryoUtilize, .log-item.documentDelete, .log-item.invoiceDelete { border-left-color: #e74c3c; background: #fff5f5; } /* красный */


.log-item.fieldUpdate {
  border-color: #ffc10733;
}
.log-item.statusChange {
  border-color: #17a2b833;
}
.log-item.taskAdd {
  border-color: #28a74533;
}
.log-item.documentUpload {
  border-color: #6f42c133;
}
.log-item.taskAdd     { border-left-color: #2ecc71; } /* зелёный */
.log-item.taskUpdate  { border-left-color: #f1c40f; } /* жёлтый */
.log-item.taskDone    { border-left-color: #27ae60; } /* насыщенно-зелёный */
.log-item.taskReopen  { border-left-color: #e67e22; } /* оранжевый */
.log-item.taskDelete  { border-left-color: #e74c3c; background: #fff5f5; } /* красный */
.log-item.photoReplace { border-left-color: #3498db; } /* синий */
.log-item.photoDelete  { border-left-color: #e74c3c; background: #fff5f5; } /* красный */
.log-item.statusChange { border-left-color: #9b59b6; } /* фиолетовый */

/* === 🧬 Логи по переносам эмбрионов и беременности === */
.log-item.transferAdd,
.log-item.transferDelete,
.log-item.transferPositive {
  border-radius: 0;
  padding: 6px 0 6px 10px;
  margin: 6px 0;
  font-size: 13px;
  color: #444;
  background: #fff;
}

/* 🩵 Добавление ПЭ */
.log-item.transferAdd {
  border-left: 3px solid #18a67b; /* свежий зелёный */
  background: #f6fffb; /* нежный фон */
}

/* 🤰 Подтверждение СБ+ */
.log-item.transferPositive {
  border-left: 3px solid #ff69b4; /* розовый акцент */
  background: #fff7fa; /* мягкий фон */
}

/* 🗑 Удаление ПЭ */
.log-item.transferDelete {
  border-left: 3px solid #e74c3c;
  background: #fff5f5;
}

/* Для всех логов текст чуть плотнее */
.log-item.transferAdd p,
.log-item.transferDelete p,
.log-item.transferPositive p {
  margin: 2px 0;
  line-height: 1.3;
}

/* 💰 Назначение выплат */
.log-item.transferPayment {
  border-left: 3px solid #f0b429;  /* тёплый янтарный цвет */
  background: #fffaf0;             /* мягкий бежевый фон */
  border-radius: 0;
  padding: 6px 0 6px 10px;
  margin: 6px 0;
  font-size: 13px;
  color: #444;
}

#surrogateCommentDrafts .comment.pending {
  background: #f5f7fa;
  border-left: 2px solid #ccc;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  opacity: 0.85;
  font-size: 13px;
  transform: scale(0.98);
  transition: all 0.2s ease;
}
#surrogateCommentDrafts .comment-header {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  color: #333;
}
#surrogateCommentDrafts .comment-files-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#surrogateCommentDrafts .comment-files-preview > div {
  width: 55px;
  height: 55px;
  border-radius: 6px;
}
#surrogateCommentDrafts .upload-bar {
  height: 2px;
  background: #4caf50;
}

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


/* === ⚙️ Системные задачи === */
.task-auto {
  opacity: 0.85;
  background: #f9fafb;
  border-left: 3px solid #c0c0c0;
}

.task-auto .task-title img {
  vertical-align: middle;
  transform: translateY(-1px);
}


/* ✅ Анимация плавного появления для новых событий */
@keyframes fadeInHistory {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-item,
.comment-item {
  animation: fadeInHistory 0.25s ease-out;
}

/* 🌿 Мягкий зелёный фон для завершённых задач */
.log-item.taskDone {
  background: #f3f4f6;
  border-left: 3px solid #28af8b38;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  animation: fadeInHistory 0.3s ease-out;
}

.log-meta {
  color: #888;
  font-size: 12px;
  margin-bottom: 3px;
}

.log-text {
  line-height: 1.4;
}


.comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.thumb-wrap {
  width: 110px;
  height: 90px;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}
.thumb-wrap:hover {
  transform: scale(1.04);
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.search-result-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.search-result-item:hover {
  background: #f7faf9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.search-result-item b {
  display: block;
  font-size: 15px;
  color: #333;
}

.search-meta {
  font-size: 13px;
  color: #666;
  margin-top: 3px;
}

.search-meta .curator {
  color: #3b485a;
  font-weight: 500;
}

.lead-status {
  color: #18a67b;
  font-weight: 600;
}

.lead-source.surrogatene {
  background: #28af8b;
  color: #fff;
}

.profile-block {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

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

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

.profile-settings .btn-inline {
  margin-right: 8px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  opacity: 0.9;
}

.section-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 8px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 900px;
}

.payments-table th,
.payments-table td {
  border: 1px solid #e0e0e0;
  padding: 8px 10px;
  text-align: left;
}

.payments-table th {
  background: #f9fafb;
  font-weight: 600;
}

.payments-table tr:nth-child(even) {
  background: #fafafa;
}

.payments-table td.editable {
  cursor: pointer;
}
.payments-table td.editable:hover {
  background: #f4fff9;
}

.link-name {
  color: #1a2a6c;
  text-decoration: none;
  font-weight: 500;
}
.link-name:hover {
  text-decoration: underline;
}

.status-badge-pay {
  display: inline-block;
  color: white;
  font-size: 9px;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
  white-space: nowrap;
}

.paid-badge {
  background: #c6f6d5;
  color: #22543d;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
}

.upcoming-badge {
  background: #fff9c4;
  color: #7b5e00;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
}

.overdue-badge {
  background: #fed7d7;
  color: #742a2a;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
}

.btn-mini {
  background: #38a169;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.btn-mini:hover {
  background: #2f855a;
}

/* оплаченные строки */
.row-paid {
  opacity: 0.7;
  background: #f6fff6;
}
.paid-check {
  width: 18px;
  height: 18px;
  margin-left: 6px;
  vertical-align: middle;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}


/* === Выплаты: dropdown === */
.payments-dropdown {
  position: relative;
  display: inline-block;
}

.payments-dropdown-toggle {
  cursor: pointer;
}

.payments-dropdown-menu {
  position: fixed;               /* 👈 вместо absolute */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-width: 180px;
  padding: 6px 0;
  display: none;
  z-index: 9999;                 /* 👈 поверх всего */
}

.payments-dropdown-menu.show {
  display: block;
}

.payments-dropdown-menu button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
}

.payments-dropdown-menu button:hover {
  background: #f4f4f4;
}

/* зелёный бейдж "оплачено" */
.paid-badge {
  background: #def8e1;
  color: #208a33;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 10px;
}

#adjustmentModal .modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

#adjustmentModal h3 {
  margin-top: 0;
}

#adjustmentModal label {
  display: block;
  margin-top: 10px;
}

#adjustmentModal input, #adjustmentModal select {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  height: 40px;
}

#paymentsTableWrapper {
  overflow-x: auto;
  overflow-y: visible; /* 👈 добавляем */
}

.payments-dropdown-menu button[style*="color:#b00"] {
  color: #b00;
  font-weight: 500;
}

.payments-dropdown-menu button[style*="color:#b00"]:hover {
  background: #fee;
}

/* 🌿 Модалка добавления сурмамы */
.add-daily-modal {
  max-width: 520px;
  animation: fadeIn 0.2s ease-out;
}

/* Сетка формы */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  align-items: start;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #333;
}

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


.form-grid select,
.form-grid input,
.form-grid textarea {
  margin-top: 4px;
  border: 1px solid #d3dce6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: #18a67b;
  box-shadow: 0 0 0 2px rgba(24, 166, 123, 0.15);
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 🔮 Плавное появление модалки */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}


.icon-sm {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.9;
  position: relative;
  top: -1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.icon-sm:hover {
  transform: scale(1.1);
  opacity: 1;
}

.icon-payto {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  top: -1px;
}

/* Унификация всех полей */
.input-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  border-color: #18a67b;
  box-shadow: 0 0 0 3px rgba(24,166,123,0.15);
  outline: none;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.form-row {
  align-items: flex-end;
}

/* Кнопки */
.btn-primary {
  background-color: #18a67b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #149468;
}

.btn-outline {
  background: #fff;
  border: 1px solid #a4a4a4;
  color: #333;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: #f7f7f7;
  border-color: #666;
}

/* 📱 Мобильная версия: выравнивание по центру */
@media (max-width: 600px) {
  .adjustments-card-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: nowrap;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

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

.search-select-container {
  position: relative;
  display: inline-block;
  width: 240px;
}

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

.search-select-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
}

.option-clear {
  color: #d33;
  font-style: italic;
}
.option-clear:hover {
  background: #ffeaea;
}

.option-item {
  padding: 6px 8px;
  cursor: pointer;
}
.option-item:hover {
  background: #f0f0f0;
}
.no-results {
  padding: 6px 8px;
  color: #777;
  font-style: italic;
}

/* === 📊 Таблица переносов === */
.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.simple-table th,
.simple-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.simple-table thead {
  background: #f6f8fa;
  color: #2d2d2d;
  font-weight: 600;
}

.simple-table tbody tr:hover {
  background: #f9fcfb;
  transition: background 0.15s;
}

/* Ссылки на анкеты сурмам */
.simple-table a.link {
  color: #0b6e4f;
  font-weight: 500;
  text-decoration: none;
}
.simple-table a.link:hover {
  text-decoration: underline;
}

/* Итог (outcome) выделяем цветом */
.simple-table td:nth-child(6) {
  font-weight: 600;
}
.simple-table td:nth-child(6):contains("СБ+") {
  color: #007b55;
}
.simple-table td:nth-child(6):contains("ХГЧ++") {
  color: #1c7ed6;
}
.simple-table td:nth-child(6):contains("ХГЧ-") {
  color: #d6336c;
}
.simple-table td:nth-child(6):contains("Ожидаем") {
  color: #f08c00;
}

/* === 🎚 Фильтры в аналитике переносов === */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.filters label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  color: #444;
  white-space: nowrap;
}

.filters select,
.filters input[type="date"] {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Jost', sans-serif;
  color: #222;
  background-color: #fff;
  box-sizing: border-box;
}

/* ✖ Кнопка Сброс */
#resetFiltersBtn {
  background: none;
  border: none;
  color: #888;
}
#resetFiltersBtn:hover {
  color: #000;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .filters {
    flex-direction: column;
    align-items: stretch !important;
  }
  .filters label,
  .filters select,
  .filters input[type="date"],
  .filters button {
    width: 100%;
  }
  .filters button {
    justify-content: center;
  }
}

.sm-list-row td {
  background: #fafafa;
  padding: 6px 16px;
  font-size: 14px;
  border-top: 1px solid #eee;
}

.sm-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: small;
}

.sm-list li {
  position: relative;
  margin: 3px 0;
  padding-left: 20px;
  line-height: 1.4;
}

.sm-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 14px;
  height: 14px;
  background-image: url("/icons/check_green.svg");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.9;
}

.sm-list a {
  color: #0b6e4f;
  text-decoration: none;
}
.sm-list a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* === 🧾 Горизонтальный скролл для таблиц === */
.simple-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px; /* чтобы колонки не схлопывались */
}

.simple-table-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  padding-bottom: 6px;
}

/* эстетика скролл-бара */
.simple-table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.simple-table-wrapper::-webkit-scrollbar-thumb {
  background: #c0c7cc;
  border-radius: 4px;
}
.simple-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #9aa3a9;
}

.btn-mini-pdf {
    background: #888;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.comment-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.comment-file-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ddd;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.comment-file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.comment-file-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-file-item .file-icon {
  font-size: 30px;
  color: #666;
}

.comment-file-item .file-name {
  font-size: 11px;
  text-align: center;
  word-break: break-word;
  padding: 4px;
}

.comment-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: #18a67b;
  transition: width 0.3s ease;
}

.comment-remove-btn {
  color: crimson;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%; 
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.comment-remove-btn:hover {
  background: none;
  transform: scale(1.05);
  color: crimson;
}

.comment-remove-btn svg {
  width: 10px;
  height: 10px;
  stroke: #555;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.comment-remove-btn:hover svg {
  stroke: #d33;
}

@media (min-width: 800px) {
#leadModalHeader h3 {
  margin:0;
}
}

/* 📱 Оптимизация модалки лида под мобильные */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 14px;
    padding-top: 35px;
    margin: 0 auto;
  }

  /* Заголовок и кнопки */
  #leadModalHeader {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
    margin-bottom: 10px;
  }

  #leadModalHeader h3 {
    font-size: 18px;
    line-height: 1.2;
  }

  /* Кнопки "Сделка" и "Отказ" — в столбец */
  #leadModalHeader > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-left: 0 !important;
  }

  #leadModalHeader .btn-inline {
    width: 100%;
    font-size: 14px;
    justify-content: center;
  }

  /* Статусы */
  .lead-status-timeline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 12px 0;
    padding-right: 8px;
  }

  .lead-status-timeline .status-step {
    background: #f6f6f6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .lead-status-timeline .arrow {
    display: none;
  }

  /* Контейнеры */
  .lead-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 8px;
  }

  .info-card {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fafafa;
    box-shadow: 0 0 0 1px #e9e9e9;
  }

  .info-card h4 {
    margin-bottom: 6px;
    font-size: 15px;
  }

  .lead-extra ul {
    margin: 0;
    padding-left: 18px;
  }

  /* Вкладки */
  .lead-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-right: 8px;
  }

  .lead-modal-tabs button {
    flex: 1 1 auto;
    font-size: 13px;
    padding: 8px;
  }

  textarea#newComment {
    min-height: 80px;
    font-size: 14px;
  }

  .result-photos label.uploader {
    font-size: 13px;
    padding: 6px 10px;
  }

  /* Кнопка закрытия */
  .modal-content .close {
    position: absolute;
    top: 4px !important;
    right: 15px !important;
    font-size: 15px !important;
  }

  /* Прячем ID */
  #leadModalHeader div[style*="font-family:monospace"] {
    display: none !important;
  }
}

@media (max-width: 480px) {

  #leadModalHeader .btn-inline {
    font-size: 13px;
    padding: 8px;
  }
}

/* 📱 Адаптация статус-бара под мобильные */
@media (max-width: 768px) {
  .lead-status-timeline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 16px 0;
    gap: 8px;
    padding-right: 8px; /* 🔸 отступ справа */
  }

  .status-step {
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px 14px;
    position: relative;
    flex: none;
  }

  /* убираем стрелки */
  .status-step::after {
    display: none !important;
  }

  /* активный */
  .status-step.active {
    background: var(--primary-color);
    color: #fff;
  }

  /* завершённый */
  .status-step.done {
    background: #28AF8B;
    color: #fff;
  }

  /* 🔹 легкий эффект наведения */
  .status-step:hover {
    filter: brightness(0.97);
  }
}

.smart-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #28af8b;
  border-radius: 12px;
  padding: 6px 12px;
  margin-bottom: 30px;
  box-shadow: 0px 0px 3px 5px rgba(0, 0, 0, 0.05);
  flex-wrap: nowrap;
  justify-content: space-between;
}

/* 🔍 Поле поиска */
.smart-search-bar input:not([type="checkbox"]):not([type="radio"]) {
  flex: 1;
  min-width: 200px;
  outline: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 14px;
  margin-bottom: 0;
  transition: all 0.2s ease;
}

/* 📋 Фильтры */
.smart-search-bar select {
  appearance: none;
  border: none;
  border-left: 1px solid #eee;
  background: transparent;
  margin-left: 6px;
  cursor: pointer;
  height: 40px;
  font-weight: 500;
  padding: 6px 10px;
  font-size: 14px;
  min-width: 130px;
  border-radius: 0;
  color: #333;
  transition: background 0.2s ease, color 0.2s ease;
  margin-bottom: 0;
}

.smart-search-bar select:hover {
  background: #f7f8f8;
  border-radius:6px;

}

/* 👁️ Иконка лупы */
.smart-search-bar .icon {
  width: 18px;
  opacity: 0.6;
}

/* 🧭 Переключатель вида */
.smart-search-bar .view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  margin-left: auto;
  border-left: 1px solid #eee;
  height: 40px;
}

.smart-search-bar .view-toggle button {
  background: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-size: 0;
}

.smart-search-bar .view-toggle button:hover {
  background: #f5f6f7;
  border-color: #e2e2e2;
}

.smart-search-bar .view-toggle button.active {
  background: rgba(40, 175, 139, 0.12);
  border-color: #18a67b29;
  box-shadow: 0 0 9px 4px rgba(40, 175, 139, 0.2);
}

.smart-search-bar .view-toggle img {
  width: 20px;
  height: 20px;
  opacity: 0.75;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.smart-search-bar .view-toggle button.active img {
  opacity: 1;
  transform: scale(1.08);
  filter: brightness(0) saturate(100%) invert(47%) sepia(93%) saturate(359%) hue-rotate(115deg);
}

/* ❌ Крестик */
.smart-search-bar .clear-icon {
  position: absolute;
  right: 34%;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.smart-search-bar.has-value .clear-icon {
  opacity: 0.6;
}

.smart-search-bar.has-value .clear-icon:hover {
  opacity: 1;
}

/* ✨ Подсветка поля при фокусе или вводе */
.smart-search-bar input:focus,
.smart-search-bar.has-value input {
  border-radius: 8px;
  box-shadow: 0 0 0 2px #f3f3f3;
  background: #fcfffd;
}

/* 📱 Мобильная адаптация */
@media (max-width: 768px) {
  .smart-search-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 8px;
  }

  .smart-search-bar input {
    width: 100%;
    min-width: unset;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    font-size: 15px;
    order: 1;
  }

  .smart-search-bar select {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    padding: 8px;
    order: 2;
    margin-left: 0px;
  }

  .smart-search-bar .view-toggle {
    border-left: none;
    border-top: 1px solid #eee;
    margin-left: 0;
    padding-top: 6px;
    order: 3;
    justify-content: center;
  }

  .smart-search-bar .icon {
    display: none;
  }
}

/* === Обёртка вокруг поля поиска === */
.smart-search-bar .input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

/* 🔍 Сам input */
.smart-search-bar .input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 30px 10px 8px; /* добавляем правый отступ под крестик */
  font-size: 14px;
  height: 18px;
  transition: all 0.2s ease;
}

/* ❌ Крестик */
.smart-search-bar .input-wrapper .clear-icon {
  position: absolute;
  right: 20px; /* теперь фиксировано внутри поля */
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.smart-search-bar.has-value .input-wrapper .clear-icon {
  opacity: 0.6;
}

.smart-search-bar.has-value .input-wrapper .clear-icon:hover {
  opacity: 1;
}

/* ✨ Подсветка (остаётся как у тебя) */
.smart-search-bar input:focus,
.smart-search-bar.has-value input {
  border-radius: 8px;
  box-shadow: 0 0 0 2px #f3f3f3;
  background: #fcfffd;
}

/* 📱 Мобильная адаптация (чуть усилили визуальную структуру) */
@media (max-width: 768px) {
  .smart-search-bar .input-wrapper {
    width: 100%;
    order: 1;
    display: block;
  }

  .smart-search-bar .input-wrapper input {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    padding: 10px 36px 10px 10px;
    font-size: 14px;
    height: 40px;
  }

  .smart-search-bar .input-wrapper .clear-icon {
    right: 14px;
    width: 18px;
    height: 18px;
  }
}

.btn-upload svg {
  transition: all 0.2s ease;
}
.btn-upload:hover svg {
  stroke: #0d8055;
  transform: scale(1.1);
}

th.sorted-asc::after {
  content: " ▲";
  font-size: 12px;
  color: #18a67b;
}
th.sorted-desc::after {
  content: " ▼";
  font-size: 12px;
  color: #18a67b;
}

.adjustment-btns {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 10px;
}

.adj-btn {
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  padding: 2px 0px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.adj-btn:hover {
  background: none;
  border-color: #18a67b;
  color: #18a67b;
}

#paymentsAllModal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9995;
}

#paymentsAllModal .modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* === 🧭 Программа === */
.program-card {
  background: #f9fafc;
  border-radius: 14px;
  padding: 20px 28px;
}

.program-card summary h3 {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

/* Трёхколоночная сетка ближе к заголовку */
.program-grid.tight {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 32px;
  align-items: flex-start;
  margin-top: 0;      /* убираем отступ */
}

/* Вертикальные разделители между колонками */
.program-grid.tight > .group-block:not(:last-child) {
  border-right: 1px solid #e4e4e4;
  padding-right: 24px;
}

/* 💠 Сетка */
.program-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

/* === 📱 Мобильная версия === */
@media (max-width: 768px) {
  .program-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .program-grid .group-block {
    width: 100%;
  }
}
/* ✏️ Редактируемые поля */
.editable {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  transition: background 0.2s;
}

.editable:hover {
  background: #e7f3ef;
}

.editable.money {
  font-weight: 500;
  color: #18a67b;
}

/* 🟢 Кнопки */
.btn-small {
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: 0.2s ease;
}

.btn-small.green {
  background: #e7f8ef;
  color: #18a67b;
}

.btn-small.green:hover {
  background: #d1f1e1;
}

.btn-small.red {
  background: #fae5e5;
  color: #b30000;
}

.btn-small.red:hover {
  background: #f7cccc;
}

/* 📱 Адаптив */
@media (max-width: 1000px) {
  .program-grid {
    grid-template-columns: 1fr;
  }
}

/* === Реквизиты === */
.req-input {
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  transition: all 0.2s ease;
  outline: none;
  margin-bottom: 0;
  margin-right: 0;
  box-sizing: border-box;
  width: 100%;
}

.req-input:focus {
  border-color: #2684ff;
  box-shadow: 0 0 0 2px rgba(38,132,255,0.15);
}

.req-input.wide {
  min-width: 80%;
}
@media (max-width: 768px) {
  .req-input.wide {
    min-width: 60%;
  }
}
.req-input.mid {
  flex: 1;
  min-width: 120px;
  color: #555;
}

.btn-circle {
  background: #f3f4f6;
  border: 1px solid #d0d5dd;
  color: #333;
  border-radius: 50%;
  width: 15px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-circle:hover {
  background: #28af8b;
}

#docMetaModal .modal-content {
  animation: fadeInScale 0.25s ease;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.req-input {
  transition: border-color 0.2s ease;
}
.req-input:focus {
  border-color: #2684ff;
  box-shadow: 0 0 0 2px rgba(38,132,255,0.15);
}

/* Закрепы */
.pin-star {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.5;
  transition: 0.2s;
}

.pin-star.active {
  opacity: 1;
  filter: drop-shadow(0 0 2px gold);
}

.pin-star:hover {
  opacity: 0.8;
}

.comment-item.pinned,
.log-item.pinned {
  background: #fffbe6; /* мягкий жёлтый */
  border-left: 4px solid #f7d13d;
  border-radius: 8px;
  padding: 8px 12px;
}

.pin-star.active {
  filter: drop-shadow(0 0 4px gold);
}

.delete-comment-br {
  position: absolute;
  right: 12px;
  bottom: 10px;
  opacity: 0.7;
  transition: 0.2s;
}

.comment-item:hover .delete-comment-br {
  opacity: 1;
}

.cm-icon {
  width: 13px;
  height: 13px;
  cursor: pointer;
  transition: 0.15s;
}

.cm-icon:hover {
  transform: scale(1.1);
  opacity: 1;
}

.right-column-wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.transfers-tasks-container {
  display: flex;
  gap: 24px;
}

.transfers-block,
.tasks-block {
  flex: 1;
}

/* 📱 Mobile */
@media (max-width: 768px) {
  .transfers-tasks-container {
    flex-direction: column;
  }
}

.comment-input-fixed {
  position: sticky;  /* или fixed – см. ниже */
  bottom: 10px;
  left: 0;
  right: 0;

  background: #fff;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;

  display: flex;
  flex-direction: column;
  gap: 12px;

  z-index: 999; /* поверх контента */
  border-radius: 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

/* Обёртка */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

/* Само поле */
.textarea-wrapper textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 14px 60px 14px 14px; /* справа место под кнопки */
  font-size: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}

/* Иконки */
.textarea-wrapper img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Кнопка прикрепить */
.textarea-attach-btn {
  position: absolute;
  right: 52px;
  bottom: 12px;
  cursor: pointer;
  opacity: 0.85;
  display: flex;
  align-items: center;
}

.textarea-attach-btn:hover {
  opacity: 1;
}

/* Кнопка отправить */
.textarea-send-btn {
  position: absolute;
  right: 12px;
  bottom: 10px;

  width: 32px;
  height: 32px;

  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: none;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0.95;
  transition: background 0.2s, opacity 0.2s;
}

/* по умолчанию svg бледно-серое */
.textarea-send-btn img {
  filter: brightness(0) saturate(100%) invert(67%) sepia(9%) saturate(163%) hue-rotate(182deg) brightness(92%) contrast(88%);
  transition: filter 0.2s ease;
}

/* когда textarea НЕ пустая → svg зелёная */
.textarea-wrapper textarea:not(:placeholder-shown) ~ .textarea-send-btn img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(32%) saturate(950%) hue-rotate(109deg) brightness(92%) contrast(90%);
}

/* hover активной кнопки */
.textarea-wrapper textarea:not(:placeholder-shown) ~ .textarea-send-btn:hover img {
  filter: brightness(0) saturate(100%) invert(58%) sepia(32%) saturate(950%) hue-rotate(109deg) brightness(92%) contrast(90%);
}

.textarea-send-btn:hover {
  opacity: 1;
  background: none;
}

/* Когда textarea пустая — делаем иконки чуть тусклее */
.textarea-wrapper textarea:placeholder-shown ~ .textarea-attach-btn,
.textarea-wrapper textarea:placeholder-shown ~ .textarea-send-btn {
  opacity: 0.35;
}

/* === COMPACT TABLE (корректировки, выплаты) === */
.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #333;
}

.compact-table thead tr {
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
}

.compact-table th {
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  color: #444;
  white-space: nowrap;
}

.compact-table tbody tr {
  border-bottom: 1px solid #f1f1f1;
  transition: background 0.15s ease;
}

.compact-table tbody tr:hover {
  background: #f9fafb;
}

.compact-table td {
  padding: 9px 14px;
  vertical-align: middle;
  color: #333;
}

/* Числа справа */
.compact-table td.amount-cell {
  text-align: right;
  font-weight: 500;
}

/* Цвет для + и - */
.compact-positive {
  color: #18a67b;
}
.compact-negative {
  color: #d9534f;
}

/* Иконки действий */
.compact-table .row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compact-table .row-actions img {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.compact-table .row-actions img:hover {
  opacity: 1;
}

/* Секция итогов */
.compact-summary {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.compact-summary b {
  font-weight: 600;
}

/* Модалка добавления новых ключей-реквизитов */
.saas-field-block {
  margin-bottom: 12px;
}

.saas-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #f3f3f3;
  cursor: pointer;
}

.saas-btn:hover {
  background: #ececec;
}

.key-edit-input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.key-edit-input:focus {
  outline: 2px solid #18a67b;
}

.btn-loading {
  pointer-events: none;
  opacity: .8;
}

.spinner {
  border: 2px solid #fff;
  border-top: 2px solid #888;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Общий стиль */
.styled-select,
.styled-multiselect {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
  color: #333;
  outline: none;
  transition: 0.15s border-color ease, 0.15s box-shadow ease;
}

/* ---- SINGLE SELECT (signerType) ---- */

.styled-select {
  cursor: pointer;
  min-width: 220px;
}

.styled-select:hover {
  border-color: #bfbfbf;
}

.styled-select:focus {
  border-color: #6ca0ff;
  box-shadow: 0 0 0 3px rgba(100,140,255,0.25);
}


/* ---- MULTISELECT (sections) ---- */

.styled-multiselect {
  min-width: 220px;
  height: 100px;
  padding: 8px;
  overflow-y: auto;
}

.styled-multiselect option {
  padding: 6px 8px;
  border-radius: 6px;
  margin: 2px 0;
  cursor: pointer;
}

.styled-multiselect option:hover {
  background: #eef3ff;
}

.styled-multiselect option:checked {
  background: #d7e5ff !important;
  color: #0b3c8c;
  font-weight: 500;
}

.doc-actions-dropdown a,
.doc-actions-dropdown button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: 'Jost', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: #2c3e50;
}

.doc-actions-dropdown a:hover,
.doc-actions-dropdown button:hover {
  background: #f3f4f6;
}

.doc-action-icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}

.doc-action-btn {
  width: 100%;
}

@media (max-width: 768px) {
  #bioRequisitesList .req-grid, #requisitesList .req-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  #bioRequisitesModal .modal-content {
    max-width: 95% !important;
    padding: 20px !important;
  }
}

/* === REQUISITES GRID === */

.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* 📱 мобильная адаптация */
@media (max-width: 768px) {
  .req-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .modal .modal-content {
    max-width: 95% !important;
    padding: 20px !important;
  }
}

.passport-parse-btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 10px;
}
.passport-parse-btn:hover {
  background: #e0e7ff;
}

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

.bio-title {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.remark-status img {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.remark-action {
  margin-left: 6px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: 0.15s;
}

.remark-action:hover {
  background: #fff3d6;
}

.remark-action.active img {
  filter: drop-shadow(0 0 2px #ff5252);
}

.remark-action img {
  width: 14px;
  height: 14px;
}

/* Красная рамка */
.kanban-item.has-remark {
  border: 2px solid #ff4d4d !important;
  box-shadow: 0 2px 6px rgba(255, 0, 0, 0.15);
}

/* Watermark */
.remark-watermark {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: 28px;
  font-weight: 700;
  color: #ff4d4d;
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
  letter-spacing: 2px;
  z-index: 1;
  white-space: nowrap;
}

/* Admin button */
.remark-action:hover {
  background: #fff2d6;
}

.remark-action.active img {
  filter: drop-shadow(0 0 2px #ff4e4e);
}

.remark-preview {
    background: #fff4f4;
    /* border: 1px solid #ffb8b8; */
    color: #d13b3b;
    font-size: 11px;
    padding: 4px 3px;
    border-radius: 6px;
    margin-bottom: 6px;
    /* max-width: max-content; */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bio-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-size: 12.5px;
  color: #444;
  margin-top: 6px;
}

.bio-info-grid div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bio-top-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 4px 12px;
  font-size: 13px;
  color: #000;
  align-items: center;
}

.bio-top-item {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bio-icon {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.bio-surrogate-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
}

.bio-surrogate-a {
  color: #0b3a6f;
  text-decoration: none;
  font-weight: 600;
}

.bio-surrogate-a:hover {
  text-decoration: underline;
}

.bio-surrogate-icon {
  font-size: 15px;
}

.ai-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: white;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 26px;
  box-shadow: 0px 0px 20px 8px #28af8b73;
  z-index: 9999;
}
.ai-chat-button:hover {
  background: white;
}

.ai-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 75%;
  height: 75%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

@media (max-width: 800px) {
  .ai-chat-window {
    width:85%;
  }

}
.ai-chat-header {
  padding: 12px;
  background: #18a67b;
  color: white;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.ai-chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 14px;
}

.ai-msg {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  max-width: 85%;
}

.ai-msg p {
    margin: 4px 0 !important;
    line-height: 1.35 !important;
}
.ai-msg ul {
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}
.ai-msg li {
    margin: 0 !important;
    padding: 0 !important;
}

.ai-msg-user {
  background: #e6f7ff;
  align-self: flex-end;
}

.ai-msg-bot {
  background: #f1f1f1;
  align-self: flex-start;
}

.ai-chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

.ai-chat-input input {
  flex: 1;
  padding: 10px;
  border: none;
  outline: none;
  margin-bottom: 0;
}

.ai-chat-input button {
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
}
.ai-chat-input button:hover {
  background: transparent;
}

.ai-chat-button img {
  pointer-events: none;
}

.ai-chat-close img {
  pointer-events: none;
}

.ai-send-btn img {
  pointer-events: none;
}

.ai-chat-close {
  background: transparent;
  border: none;
  padding-left: 4px;
  padding-right: 4px;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  cursor: pointer;
}

.ai-chat-close:hover {
  background: transparent;  
}

.ai-send-btn {
  background: transparent;
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-send-btn:hover {
  background: transparent;
}

.ai-mode-select {
  margin-left: auto;
  margin-right: 8px;
  padding: 4px 8px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 0;
  height: 30px;
}

.ai-mode-select option {
  color: black;
}

.ai-model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 6px;
  font-size: 12px;
  color: #444;
}
.ai-model-selector select {
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid #ccc;
}

.ai-chat-textarea {
  width: 100%;
  min-height: 40px;
  max-height: 200px;
  resize: none;
  line-height: 20px;
  font-size: 15px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  outline: none;
  box-sizing: border-box;
  margin: 10px;
  overflow: hidden;
}

.ai-typing {
  padding: 8px 12px;
  color: #555;
  font-style: italic;
  font-size: 13px;
  opacity: 0.8;
}

/* === MODAL: РодЫ ПРОИЗОШЛИ === */

#deliverySurrogateModal .modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* Заголовок */
#deliverySurrogateModal h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Поля формы */
#deliverySurrogateModal label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

#deliverySurrogateModal input[type="date"],
#deliverySurrogateModal input[type="number"] {
  width: 95%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 10px;
  outline: none;
  transition: 0.2s;
  background: #fff;
  height: auto;
}

#deliverySurrogateModal input[type="date"]:focus,
#deliverySurrogateModal input[type="number"]:focus {
  border-color: #1c7ef5;
  box-shadow: 0 0 0 2px rgba(28,126,245,0.2);
}

/* Чекбокс */
#deliverySurrogateModal input[type="checkbox"] {
  transform: scale(1.25);
  margin-right: 6px;
}

/* Предварительный расчёт */
#deliveryPreviewBox {
  background: #f5f7fa;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 16px;
  font-size: 14px;
  border: 1px solid #e0e5eb;
}

/* Жирные строки */
#deliveryPreviewBox b {
  font-weight: 600;
}

/* Кнопки */
#deliverySurrogateModal .modal-content button {
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

#deliverySurrogateModal .btn-primary {
  background: #0a8a42;
  color: #fff;
}

#deliverySurrogateModal .btn-primary:hover {
  background: #087a39;
  color: white;
}

#deliverySurrogateModal .btn-cancel {
  background: #e9ecef;
  color: #333;
}

#deliverySurrogateModal .btn-cancel:hover {
  background: #d8dde2;
}

/* Универсальный zoom + drag */
.doc-preview-zoomable {
  transition: transform 0.12s ease-out;
  will-change: transform;
  transform-origin: center center;
  cursor: grab;
  position: relative;
}

.doc-preview-zoomable:active {
  cursor: grabbing;
}

#docPreviewModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

#docPreviewModal .modal-content {
  background: #000;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#docPreviewContent {
  padding: 20px;
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#docPreviewContent img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
}

.doc-preview-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 34px;
  font-weight: 300;
  cursor: pointer;
  color: white;
  z-index: 100000;
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
}

.lead-new-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #ff3b30;
  background: rgba(255, 59, 48, 0.12);
  
  border-radius: 12px;

  text-transform: uppercase;
  letter-spacing: 0.3px;

  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* === SIDEBAR — универсальное выезжающее меню (desktop + mobile) === */

nav {
  position: fixed;
  top: 60px;
  left: -300px;          /* скрыто */
  width: 260px;
  height: calc(100% - 60px);
  background: white;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.15);
  z-index: 2000;
  transition: left 0.3s ease;
  overflow-y: auto;
}

/* когда открыто */
nav.open {
  left: 0;
}

/* кнопка-гамбургер ВСЕГДА видна */
.menu-toggle {
  background: none;
  border: none;
  font-size: 26px;
  color: white;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Отключаем режим collapsed из десктопной версии */
nav.closed {
  left: -300px;
}

#loading-screen {
  pointer-events: none;
}

.finance-delete-btn {
  width: 24px;
  height: 24px;
  background: #ffe5e5;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.finance-delete-btn img {
  width: 15px;
  height: 15px;
  opacity: 0.7;
}

.cryo-spoiler {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 12px 0 18px 0;
  background: #fafafa;
}

.cryo-spoiler summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 4px 0;
  outline: none;
}

.cryo-spoiler summary::-webkit-details-marker {
  display: none !important;
}

.cryo-spoiler summary {
  list-style: none;
}


/* стрелка */
.cryo-spoiler summary::after {
  content: "▾";
  float: right;
  color: #777;
  transition: transform 0.2s ease;
}

.cryo-spoiler[open] summary::after {
  transform: rotate(180deg);
}

.spoiler-body {
  margin-top: 10px;
}

.autocomplete-list {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.autocomplete-list .item {
  padding: 6px 10px;
  cursor: pointer;
}

.autocomplete-list .item:hover {
  background: #f5f5f5;
}

/* =============== CRYO CARDS — NOTION STYLE =============== */

.cryo-card {
  background: #ffffff;
  padding: 22px 26px;
  border-radius: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border: 1px solid #f2f2f2;
  margin-bottom: 18px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cryo-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-color: #e5e5e5;
}

.cryo-route {
  font-size: 21px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
}

/* Статус (чип) */
.cryo-status {
  background: #eef1ff;
  color: #3a47d5;
  padding: 4px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Основной блок (2 колонки) */
.cryo-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 10px;
  margin-top: 6px;
}

.cryo-line {
  font-size: 14px;
  color: #333;
}

.cryo-line strong {
  color: #444;
  margin-right: 4px;
}

/* Вторичный блок */
.cryo-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e0e0e0;
  color: #666;
  font-size: 13px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

/* Кнопки */
.cryo-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.cryo-actions .btn-small {
  border-radius: 8px;
  padding: 8px 12px;
}

/* Hover-редактирование */
.cryo-edit {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}

.cryo-edit:hover {
  border-color: #c2c2c2;
}

/* Клиника в маршруте */
.cryo-clinic {
  color: #777;
  font-size: 0.9em;
}

.cryo-clinic:contains("клиника") {
  color: #aaa;
}

.cryo-delete {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.15s ease;
  color: #cc3333;
}

.cryo-card:hover .cryo-delete {
  opacity: 0.75;
  background: none;
}

.cryo-delete:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #fb0404;
  background: none;
}

.cryo-delete:active {
  opacity: 0.6;
  transform: scale(0.92);
}

/* БИО: удалить*/

.bio-delete-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  opacity: 0.6;
}

.bio-delete-btn:hover {
  opacity: 1;
}

/* -----------------------------
   КАРТОЧКИ КУРЬЕРОВ
------------------------------ */

.courier-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
}

.courier-info-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.courier-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.courier-line {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}

.courier-comment {
  margin-top: 6px;
  background: #fafafa;
  padding: 6px 8px;
  border-radius: 8px;
  color: #555;
  font-size: 13px;
  white-space: pre-line;
}

/* Удаление — минимальный стиль */
.courier-delete {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.courier-delete:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #3B485A;
  background: none !important;
}

.courier-delete:active {
  opacity: 0.75;
  transform: scale(0.95);
  color: #3B485A;
  background: none;
}


/* -----------------------------
   ИКОНКИ (SVG фоновая загрузка)
------------------------------ */

.c-icon-phone::before,
.c-icon-doc::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  opacity: 0.7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Эти SVG ты подставишь позже */
.c-icon-phone::before {
  background-image: url('data:image/svg+xml;utf8,<svg ...>');
}
.c-icon-doc::before {
  background-image: url('data:image/svg+xml;utf8,<svg ...>');
}


/* -----------------------------
   PREMIUM TOGGLE (замена notion)
   Стиль Notion × Linear
------------------------------ */

.premium-toggle {
  margin-bottom: 20px;
  border-radius: 8px;
  padding: 4px;
}

/* Убираем стандартный маркер */
.premium-toggle summary::-webkit-details-marker {
  display: none;
}

/* HEADER */
.premium-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  user-select: none;
  transition: background 0.18s ease, transform 0.12s ease;
}

.premium-summary:hover {
  background: #f5f5f5;
}

.premium-summary:active {
  transform: translateY(1px);
}

/* ПЛЮСИК (тонкие линии) */
.premium-icon {
  width: 16px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}

.premium-icon::before,
.premium-icon::after {
  content: "";
  position: absolute;
  background: #444;
  left: 0;
  right: 0;
  margin: auto;
  width: 16px;
  height: 2px;
  top: 7px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.premium-icon::after {
  transform: rotate(90deg);
}

/* При открытии превращаем в × */
.premium-toggle[open] .premium-icon::before {
  transform: rotate(45deg);
}

.premium-toggle[open] .premium-icon::after {
  transform: rotate(-45deg);
}

/* CONTENT (accordion animation) */
.premium-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-left: 4px;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease 0.05s,
    padding-top 0.25s ease;
}

.premium-toggle[open] .premium-content {
  max-height: 600px;
  opacity: 1;
  padding-top: 12px;
}

/* Внутренний layout */
.premium-row {
  display: flex;
  gap: 10px;
}

.premium-content input,
.premium-content textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s ease;
}

.premium-content input:focus,
.premium-content textarea:focus {
  border-color: #999;
  outline: none;
}

/* === CRYO MODAL BASE === */
.cryo-modal-window {
  background: #fff;
  width: min(900px, 95vw);
  padding: 28px;
  border-radius: 16px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* карточка */
.cryo-modal-card {
  background: #fff;
  border-radius: 12px;
  width: min(900px, 95vw);
  max-height: 90vh;              /* 🔥 ограничение */
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* 🔥 сохраняет углы */
}

/* header фиксированный */
.cryo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0 24px;
}

/* 🔥 вот тут скролл */
.cryo-modal-body {
  overflow-y: auto;
  padding: 16px 24px 24px 24px;
}

.cryo-modal-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.cryo-close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  opacity: 0.5;
}
.cryo-close:hover {
  opacity: 1;
}

/* GRID ROW */
.cryo-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.cryo-row-wide {
  display: block;
  width: 100%;
}

/* FIELD */
.cryo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cryo-field label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

#cryoRequestDate {
  height: 42px;
}

.cryo-field input,
.cryo-field select,
.cryo-field textarea {
  border: 1px solid #ddd;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  background: #fafafa;
  margin-right: 0;
}

.cryo-field textarea {
  resize: vertical;
}

/* PRICE INLINE GROUP */
.cryo-price {
  display: flex;
  gap: 8px;
  width: 100%;
}

.cryo-price select {
  min-width: 110px;
}

/* FOOTER BUTTONS */
.cryo-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.cryo-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.cryo-btn.save {
  background: #4a73ff;
  color: white;
}

.cryo-btn.cancel {
  background: #eee;
}

.cryo-btn.danger {
  background: #ffebeb;
  color: #b40000;
}

/* Крупные клиенты */
.cryo-title-clients {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111;
}

/* Компактный маршрут */
.cryo-route-compact {
  font-size: 15px !important;
  color: #666 !important;
  margin-bottom: 6px;
}

.cryo-route-compact .cryo-edit {
  font-size: 15px !important;
}

.cryo-route-compact .cryo-clinic {
  font-size: 14px !important;
  color: #888;
}

/* КРИО: Popup клиента */
#clientPopupModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.client-popup-card {
  background: #fff;
  padding: 28px;
  border-radius: 14px;
  width: min(420px, 90vw);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  position: relative;
  animation: fadeIn 0.2s ease;
}

.client-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
}
.client-popup-close:hover {
  opacity: 1;
}

.client-popup-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.client-popup-label {
  font-size: 13px;
  color: #777;
  margin-bottom: 4px;
}

.client-popup-section {
  margin-bottom: 16px;
}

.client-popup-msg-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  background: #4976f5;
  color: white;
  cursor: pointer;
  font-weight: 600;
}
.client-popup-msg-btn:hover {
  background: #3a63d4;
}

.cryo-hint {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff7e6;
  border: 1px solid #f5d08a;
  border-radius: 10px;
  font-size: 13px;
  color: #7a5c00;
}

.cryo-customer-details {
  margin-top: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e6ecf2;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.embryo-cryo-link {
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #eef4ff;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.embryo-cryo-link:hover {
  background: #e2ecff;
}

/* Просмотр криоперевозки */
.cryo-view-modal {
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.32);
}

.cryo-modal-window-bio.modern {

  width: min(920px, 92vw);
  max-height: 88vh;
  background: #ffffff;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.12),
    0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.7);
  animation: modalIn 0.18s ease;
}

.cryo-modal-header-bio {

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.cryo-modal-title-bio {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-family: 'Jost', sans-serif;
}

.cryo-modal-body-bio {
  overflow-y: auto;
  padding: 20px 22px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}

.cryo-modal-close-bio {

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: none;
  border-radius: 12px;

  background: #f8fafc;

  color: #475569;

  font-size: 28px;
  line-height: 1;

  cursor: pointer;

  transition: all 0.18s ease;

  flex-shrink: 0;
}

.cryo-modal-close-bio:hover {
  background: #eef2ff;
  color: #111827;
  transform: scale(1.04);
}

@keyframes modalIn {

  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cryo-view {
  font-family: 'Jost', sans-serif;
  color: #111827;
}

.cryo-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom:18px;
  letter-spacing: -0.02em;
}

.cryo-id {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.cryo-id:hover {
  background: #e5e7eb;
}

.cryo-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cryo-row-bio {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cryo-label {
  font-size: 10px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cryo-value {
  font-size: 13px;
  line-height: 1.35;
  color: #111827;
}

.cryo-value.strong {
  font-size: 15px;
  font-weight: 600;
}

.cryo-sub {
  margin-top: 2px;
  font-size: 13px;
  color: #6b7280;
}

.cryo-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 16px 0;
}

.cryo-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: #f3f4f6;
  color: #374151;
}

.cryo-comment {
  background: #f9fafb;
  border-radius: 14px;
  padding: 14px 16px;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
}


/* статусы */
.cryo-badge.подготовка { background: #f3f4f6; }
.cryo-badge.в\ пути { background: #e0f2fe; }
.cryo-badge.доставлено { background: #dcfce7; }
.cryo-badge.архив { background: #f1f5f9; }

.cryo-id {
  margin-left: 10px;
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  transition: 0.2s;
}

.cryo-id:hover {
  color: #111827;
}

.cryo-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.cryo-client-link {
  color: #1a73e8; /* приятный синий */
  cursor: pointer;
  font-weight: 600;
  border-bottom: 1px dashed transparent;
  transition: 0.15s ease;
}

.cryo-client-link:hover {
  border-bottom-color: #1a73e8;
  opacity: 0.85;
}

.cryo-customer-window {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.cryo-close {
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.7;
}

.cryo-row,
.cryo-row-wide {
  display: flex;
  gap: 20px;
}

.cryo-field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cryo-field label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

.cryo-btn.save {
  background: #3c6ff4;
  color: white;
}

.cryo-btn.cancel {
  background: #eee;
}

.cryo-field input,
.cryo-field select,
.cryo-field textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.client-history-row {
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #eee;
}

.client-history-id {
  font-size: 13px;
  color: #777;
}

.client-history-route {
  font-size: 15px;
  font-weight: 500;
  margin: 4px 0;
}

.client-history-dates {
  font-size: 13px;
  color: #555;
}

.client-history-status {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #4487ff;
}

.client-history-material,
.client-history-price,
.client-history-profit {
  margin-top: 4px;
  font-size: 14px;
}

.refresh-icon.spin {
  animation: spinIcon 0.8s linear infinite;
}

@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.cryo-input {
  width: 100% !important;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
  display: block;
}

  #cryoFinanceModal input,
  #cryoFinanceModal select,
  #cryoFinanceModal textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
  }

  /* --- Notion modal wrapper --- */
.notion-modal {
  position: fixed;
  inset: 0;
  background: rgba(55, 55, 55, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

/* --- Modal box --- */
.notion-modal-content {
  background: #fff;
  border-radius: 12px;
  width: min(420px, 92vw);
  padding: 24px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  animation: fadeInScale 0.18s ease-out;
  font-family: system-ui, -apple-system, sans-serif;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- Header --- */
.notion-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.notion-title {
  font-size: 20px;
  font-weight: 600;
}

.notion-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #666;
}

.notion-close:hover { color: #000; }

/* --- Body --- */
.notion-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.notion-label {
  font-size: 14px;
  color: #333;
  margin-bottom: -6px;
}

.notion-input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: 0.15s ease;
}

.notion-input:focus {
  border-color: #8c6dfd;
  box-shadow: 0 0 0 2px rgba(140,109,253,0.15);
  outline: none;
}

/* --- Footer buttons --- */
.notion-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.notion-btn {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 14px;
  transition: 0.15s;
}

.notion-btn.cancel {
  background: #f3f3f3;
  color: #333;
}

.notion-btn.cancel:hover {
  background: #e8e8e8;
}

.notion-btn.primary {
  background: #8c6dfd;
  color: #fff;
}

.notion-btn.primary:hover {
  background: #7254e8;
}

.bio-tab-btn {
  padding:6px 14px;
  border-radius:8px;
  border:1px solid #ddd;
  background:#f6f6f6;
  cursor:pointer;
  font-size:13px;
}

.bio-tab-btn.active {
  background:#e9f5f1;
  border-color:#28af8b;
  color:#1f8f6e;
  font-weight:500;
}

.bio-tab-content {
  display:none;
}

.bio-tab-content.active {
  display:block;
}

/* ===== Модалка доверенности ===== */

.poa-modal {
  max-width: 720px;
  padding: 32px;
  border-radius: 20px;
  position: relative;
}

.modal-title {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 600;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #2b2b2b;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ===== Формы ===== */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
}

.form-input,
.form-select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #dcdcdc;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 0;
}

.form-input:focus,
.form-select:focus {
  border-color: #28af8b;
}

.form-input {
  height: 42px;
}
.form-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.form-row.two-cols > .form-group {
  flex: 1;
}

.form-row.three-cols > .form-group {
  flex: 1;
}

/* Мобилка — всё в столбик */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
}

.form-row.two-cols > .form-group {
  flex: 1;
}

.checkbox-row {
  margin-top: 8px;
}

/* ===== Кнопки ===== */

.btn-outline {
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid #2f3c4f;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  border-radius: 999px;
  border: none;
  background: #e9f5f1;
  color: #1f8f6e;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dcdcdc;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
}

.poa-active { border-left: 4px solid #28af8b; }
.poa-warning { border-left: 4px solid #f5a623; }
.poa-expired { border-left: 4px solid #d0021b; opacity: .7; }
.poa-inactive { opacity: .5; }

.poa-signer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.poa-signer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e9f5f1;
  color: #1f8f6e;
  font-size: 13px;
}

.poa-signer-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  padding: 4px 4px;
}

.poa-signer-chip button:hover {
  color: #cc3333;
}
.form-row.three-cols > .form-group {
  flex: 1;
}

.poa-card.notion {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;

  padding: 12px 14px;
  margin-bottom: 10px;

  border-radius: 10px;
  background: #fff;
  border: 1px solid #eee;

  position: relative;
}

.poa-card.notion::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
}

.poa-active::before { background: #28af8b; }
.poa-warning::before { background: #f5a623; }
.poa-expired::before { background: #d0021b; }
.poa-inactive::before { background: #bbb; }

.poa-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poa-signer {
  font-size: 14px;
  font-weight: 500;
  color: #222;
}

.poa-notary{
  max-width: 320px;
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poa-signers-toggle {
  cursor: pointer;
  display: inline;
  border-bottom: 1px dashed rgba(0,0,0,0.35);
}

.poa-signers-toggle:hover {
  border-bottom-color: rgba(0,0,0,0.75);
}

.poa-signers-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(40,175,139,0.25);
  border-radius: 4px;
}

.poa-meta {
  font-size: 13px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.poa-number {
  font-weight: 500;
  color: #333;
}

.poa-dot {
  opacity: 0.4;
}

.poa-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.poa-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
}

.poa-edit-btn:hover {
  opacity: 1;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: rgba(0,0,0,.6);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== МОДАЛКА ВСТРЕЧ ===== */

.meeting-modal {
  max-width: 520px;
  padding: 32px;
  border-radius: 16px;
}

.meeting-modal .modal-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
}

.meeting-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.meeting-form label {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 6px;
  display: block;
}

.meeting-form .input {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  box-sizing: border-box;
}

.meeting-form .input:focus {
  outline: none;
  border-color: #3bbfa0;
  box-shadow: 0 0 0 2px rgba(59, 191, 160, 0.15);
}

.form-actions {
  margin-top: 12px;
}

.form-actions .btn-primary {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
}

/* Рендер ДЕНЬ */
/* ===== ДНЕВНОЙ КАЛЕНДАРЬ ===== */

.day-calendar {
  display: grid;
  grid-template-columns: 72px 1fr;
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  position: relative;
}

.day-hours {
  border-right: 1px solid #e5e7eb;
}

.day-hour {
  height: 48px; /* 30 минут = 48px */
  font-size: 12px;
  color: #6b7280;
  padding: 4px 8px;
  box-sizing: border-box;
}

.day-grid {
  position: relative;
}

.day-slot {
  height: 48px;
  border-bottom: 1px dashed #eef2f7;
}

.day-events-layer {
  position: absolute;
  left: 72px; /* ширина колонки часов */
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.day-events-layer .meeting-block {
  pointer-events: auto;
}


/* ===== ВСТРЕЧИ ===== */

.meeting-block {
  position: absolute;
  left: 12px;
  right: 12px;
  background: #e6f7f2;
  border-left: 4px solid #3bbfa0;
  border-radius: 8px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.meeting-time {
  font-size: 12px;
  font-weight: 600;
}

.meeting-title {
  font-size: 14px;
  font-weight: 500;
}

.meeting-owner {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.meeting-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #3b485a;
  margin-bottom: 2px;
}

.meeting-owner-inline {
  color: #6b7a90;
  font-weight: 500;
  white-space: nowrap;
}

.meeting-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-grid {
  cursor: pointer;
}

.day-slot:hover {
  background: rgba(59, 191, 160, 0.05);
}

.meeting-actions {
  position: absolute;
  top: 6px;
  right: 6px;
}

.meeting-delete {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
}

.meeting-delete:hover {
  color: #ef4444;
  background: none;
}

/* ===== НЕДЕЛЬНЫЙ КАЛЕНДАРЬ ===== */

.week-calendar {
  display: grid;
  grid-template-columns: 72px repeat(7, 1fr);
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  position: relative;
}

.week-header {
  display: contents;
}

.week-day-header {
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.week-hours {
  border-right: 1px solid #e5e7eb;
}

.week-hour {
  height: 48px;
  font-size: 12px;
  color: #6b7280;
  padding: 4px 8px;
}

.week-day {
  position: relative;
  overflow: hidden;
}

.week-day .week-events-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* чтобы клик по пустому месту работал по колонке */
}

.week-day .meeting-block {
  pointer-events: auto; /* но сами события кликабельны */
}

.week-slot {
  height: 48px;
  border-bottom: 1px dashed #eef2f7;
}

.week-day:hover {
  background: rgba(59,191,160,0.03);
}

/* Плашка быстрые действия в surrogate.html*/
/* ⚡ Quick Actions (Notion-style) */
.quick-actions {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.10);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2000;
  backdrop-filter: blur(6px);
}

.quick-actions .qa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 40px;
  overflow: hidden;

  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px;

  cursor: pointer;
  white-space: nowrap;
  color: #0f172a;
  transition: background 0.15s ease, width 0.2s ease;
  font-size: 16px;
}

.quick-actions .qa-btn span {
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.quick-actions:hover .qa-btn {
  width: 170px;
}

.quick-actions:hover .qa-btn span {
  opacity: 1;
}

.quick-actions .qa-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.qa-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.quick-actions .qa-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 4px 6px;
}

.quick-actions .qa-muted {
  opacity: 0.45;
  cursor: default;
}

/* ⚡ QA Template Popover */
.qa-popover {
  position: fixed;
  right: 76px;               /* рядом с панелью (16px + ~40px + отступ) */
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  max-height: 820px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.14);
  z-index: 2100;
  overflow: hidden;
  display: none;
  padding: 10px;
}

.qa-popover.open { display: block; }

.qa-popover-header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qa-popover-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.qa-popover-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0.55;
}
.qa-popover-close:hover { opacity: 0.85; }

.qa-popover-search {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.qa-popover-search input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  outline: none;
  font-size: 13px;
  box-sizing: border-box;
}
.qa-popover-search input:focus {
  border-color: rgba(24, 166, 123, 0.7);
  box-shadow: 0 0 0 3px rgba(24, 166, 123, 0.12);
}

.qa-popover-list {
  padding: 6px;
  overflow: auto;
  max-height: 260px;
}

.qa-tpl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.qa-tpl-item:hover { background: rgba(15, 23, 42, 0.06); }
.qa-tpl-item.active { background: rgba(24, 166, 123, 0.12); }

.qa-tpl-name {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.25;
}
.qa-tpl-meta {
  font-size: 11px;
  color: rgba(15, 23, 42, 0.55);
}

.qa-popover-footer {
  padding: 2px 5px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.qa-selected {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.qa-create-btn {
  border: 0;
  background: #18a67b;
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.qa-create-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.qa-tpl-sep{
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(100,116,139,.08);
  border-radius: 8px;
  margin: 8px 8px 6px;
}

.qa-mini-spinner{
  width:12px;height:12px;border-radius:50%;
  border:2px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.55);
  animation: qaSpin .8s linear infinite;
}
@keyframes qaSpin{ to{ transform: rotate(360deg);} }


/* поповер "Счета" шире*/
.qa-popover.invoices {
  width: 520px;
  max-width: 95vw;
}

/* Сам поповер: фиксируем высоту и делаем колонку */
#bioInvoicesPopover.qa-popover.invoices {
  display: flex;
  flex-direction: column;
  max-height: 80vh;      /* подстрой, например 70vh-85vh */
}

/* Хедер и поиск пусть остаются сверху, не скроллятся */
#bioInvoicesPopover .qa-popover-header,
#bioInvoicesPopover .qa-popover-search {
  flex: 0 0 auto;
}

/* Тело поповера занимает всё оставшееся место */
#bioInvoicesPopover .qa-popover-body {
  flex: 1 1 auto;
  min-height: 0;         /* критично для overflow внутри flex */
  display: flex;
  flex-direction: column;
}

/* Список — растягивается и скроллится */
#bioInvList.qa-inv-list {
  flex: 1 1 auto;
  min-height: 0;         /* критично */
  overflow-y: auto;
  overflow-x: hidden;
}


.qa-inv-list::-webkit-scrollbar {
  width: 6px;
}

.qa-inv-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.qa-inv-list::-webkit-scrollbar-track {
  background: transparent;
}

.sm-link {
  color: #175CD3;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sm-link .ext-icon {
  fill: currentColor;
  opacity: 0.65;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sm-link:hover .ext-icon {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* сумма внутри (приглушаем) */
.rent-amount {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
  opacity: 0.6;
  font-weight: 400;
}

/* базовая плашка */
.rent-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.9;
  transition: 0.15s;
}

/* hover — лёгкий акцент */
.rent-pill:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* ✅ всё хорошо — мягкий зелёный */
.rent-ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ⚠️ скоро платить */
.rent-warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

/* ❌ просрочено */
.rent-bad {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ❌ пульс оставляем, но мягче */
.rent-bad {
  animation: pulse-red 2s infinite;
}

/* компактная кнопка */
.btn-small {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.acc-header {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.acc-title {
  cursor: pointer;
  font-weight: 500;
}

.acc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* кнопки — делаем вторичными */
.acc-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: 0.15s;
}

.acc-btn:hover {
  background: #f3f4f6;
  color: #111;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(185,28,28,.4); }
  70% { box-shadow: 0 0 0 6px rgba(185,28,28,0); }
  100% { box-shadow: 0 0 0 0 rgba(185,28,28,0); }
}

.transfer-chip {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
  transition: background .15s, box-shadow .15s;
}

.transfer-chip:hover {
  background: #f9fafb;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.transfer-chip .tc-main {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
}

.transfer-chip .tc-no {
  font-weight: 600;
}

.transfer-chip .tc-outcome {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
}

.transfer-chip.positive .tc-outcome { background: #dcfce7; color: #166534; }
.transfer-chip.hcg_neg .tc-outcome,
.transfer-chip.abortion .tc-outcome,
.transfer-chip.failed .tc-outcome { background: #fee2e2; color: #991b1b; }
.transfer-chip.ongoing .tc-outcome { background: #e0f2fe; color: #075985; }

.transfer-chip .tc-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  gap: 10px;
}

.tch-counter {
    margin-left: 1px;
    color: #fff;
    background-color: #28af8b;
    padding: 0px 5px;
    border-radius: 50%;
    font-size: 10px;
}


.transfer-chip .tc-meta {
  font-size: 12px;
  color: #6b7280;
}

.inline-action {
  font-size: 12px;
  color: #1a73e8;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 6px;
  user-select: none;
}

.inline-action.cancel {
  color: #999;
}

.skeleton-bubble {
  height: 34px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e6e6e6 37%,
    #f0f0f0 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.copy-action:hover {
  background: rgba(0,0,0,0.05);
}

.copy-action img {
  pointer-events: none; /* чтобы клик всегда ловил span */
}

.auth-card {
  max-width: 420px;
  margin: 80px 5%;
  padding: 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
  animation: fadeIn .25s ease;
}

.auth-card h2 {
  margin-bottom: 16px;
  text-align: center;
}

.auth-card input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.btn.primary {
  width: 100%;
  padding: 12px;
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.mfa-desc {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-bottom: 16px;
}

#mfa-code-input {
  text-align: center;
  font-size: 28px;
  letter-spacing: 10px;
}

#mfa-code-input::placeholder {
  letter-spacing: 10px;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.35s ease;
  border-color: #ef4444;
}


#mfa-resend-btn.link {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: #10b981;
  font-size: 13px;
  cursor: pointer;
}

.hidden {
  display: none;
}

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

#mfa-recaptcha-portal {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

/* ============================= */
/* 🧪 АНАЛИЗЫ СМ — ОСНОВНОЙ БЛОК */
/* ============================= */

.lab-report-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fff;
}

/* ============================= */
/* 📌 Заголовок анализа          */
/* ============================= */

.lab-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
}

.lab-report-header.compact {
  gap: 12px;
}

.lab-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
}

.lab-title {
  color: #666;
  font-size: 10px;
  line-height: 1.2;
}

.lab-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================= */
/* 🔔 Иконки статуса и PDF       */
/* ============================= */

.lab-status-icon,
.lab-pdf-icon {
  width: 14px;
  height: 14px;
}

.lab-status-icon {
  cursor: default;
}

.lab-pdf-icon {
  cursor: pointer;
}

.lab-pdf-icon:hover {
  opacity: 0.7;
}

/* ============================= */
/* 📊 Блок показателей           */
/* ============================= */

.lab-results {
  display: none;
  margin-top: 8px;
  padding: 6px 8px;

  background: #fafafa;
  border-radius: 6px;

  /* 🔥 фикс выхода за границы */
  max-width: 100%;
  overflow-x: auto;
}

/* ============================= */
/* 📋 Строка показателя          */
/* ============================= */

.lab-result-row {
  display: grid;
  grid-template-columns:
    minmax(180px, 2fr)  /* название */
    80px                /* значение */
    120px               /* реф. диапазон */
    80px;               /* единицы */

  gap: 8px;
  padding: 6px 4px;
  align-items: center;

  font-size: 13px;
  border-bottom: 1px dashed #eee;
}

.lab-result-row:last-child {
  border-bottom: none;
}

/* Hover — как таблица */
.lab-result-row:hover {
  background: #f1f5f9;
}

/* ============================= */
/* 🧬 Качественные анализы       */
/* ============================= */

.lab-result-row.qualitative {
  grid-template-columns: 1fr 120px;
}

/* ============================= */
/* 🧾 Колонки                    */
/* ============================= */

.lab-col-name {
  white-space: normal;
  line-height: 1.25;
}

.lab-col-value {
  font-weight: 600;
  text-align: right;
}

.lab-col-ref,
.lab-col-unit {
  text-align: right;
  color: #666;
}

/* ============================= */
/* 🎨 Статусы показателей        */
/* ============================= */

/* 🔴 Отклонения */
.lab-result-row.high .lab-col-value,
.lab-result-row.low .lab-col-value,
.lab-result-row.positive .lab-col-value {
  color: #d9534f;
  font-weight: 700;
}

/* 🟢 Норма / отрицательные */
.lab-result-row.normal .lab-col-value,
.lab-result-row.negative .lab-col-value {
  color: #2e7d32;
}

/* 🔴 Мягкий фон для проблемных */
.lab-result-row.high,
.lab-result-row.low,
.lab-result-row.positive {
  background: rgba(255, 0, 0, 0.04);
}

/* 🟢 Без фона для нормы */
.lab-result-row.normal,
.lab-result-row.negative {
  background: transparent;
}

/* Качественные отклонения */
.lab-result-row.qualitative.high,
.lab-result-row.qualitative.positive {
  background: rgba(255, 0, 0, 0.04);
}

/* =============================== */
/* 🧪 UNLINKED LABS — MODAL        */
/* =============================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

/* сама модалка */
.modal-ul {
  background: #ffffff;
  width: 100%;
  max-width: 900px;
  max-height: 80vh;

  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-ul h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-ul > div:first-child {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-ul > div:first-child button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
}

.modal-ul > div:first-child button:hover {
  opacity: 1;
  color: #3B485A;
}

#unlinkedLabsList {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.unlinked-lab-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fafafa;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.unlinked-lab-item:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.unlinked-lab-item > div:first-child {
  /*display: flex;*/
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.unlinked-lab-item strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.unlinked-lab-item .muted {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.unlinked-lab-item button {
  background: #10b981;
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.unlinked-lab-item button:hover {
  background: #059669;
}

.unlinked-lab-item .suggestions {
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
}

.attach-sm-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attach-sm-item button {
  background: #10b981;
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.attach-btn-loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

.attach-btn-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top-color: #3B485A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  to { transform: rotate(360deg) translateY(-50%); }
}

.lab-show-more-btn {
  margin-top: 12px;
  background: none;
  border: none;
  color: #4a6cf7;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
}

.lab-show-more-btn:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
  color: #4a6cf7;
  background: none;
}

.lab-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lab-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #cc3333!important;
}

.lab-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;

  padding: 4px 10px;
  font-size: 12.5px;
  color: #444;

  cursor: pointer;
  white-space: nowrap;
}

.lab-upload-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.lab-upload-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  animation: labSpin 0.8s linear infinite;
}

@keyframes labSpin {
  to {
    transform: rotate(360deg);
  }
}

.lab-upload-btn:active {
  background: rgba(0, 0, 0, 0.08);
}

/* ===== REQUISITES BUTTONS (Notion style) ===== */

.req-actions {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

/* Базовая кнопка */
.req-actions button {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hover */
.req-actions button:hover {
  background: #f7f7f7;
}

/* Primary */
.req-save {
  background: #111;
  color: #28af8b;
  border-color: #111;
}

.req-save:hover {
  background: #222;
  color: #18a67b;
}

/* Cancel */
.req-cancel {
  background: #fff;
  color: #555;
}

/* Spinner */
.req-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(40, 175, 139, 0.2);
  border-top: 2px solid #28af8b;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* если нужен вариант для тёмной кнопки */
.req-spinner.on-dark {
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-mini {
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top: 2px solid #28af8b;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ИНВОЙСЫ */
/* 1️⃣ Современный стиль таблицы (Notion + ERP) */
.invoice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.invoice-table thead {
  background: #f7f9fc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.invoice-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: #3B485A;
  border-bottom: 1px solid #e6e9ef;
}

.invoice-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f6;
  vertical-align: middle;
}

.invoice-table tbody tr {
  transition: background 0.15s ease;
}

.invoice-table tbody tr:hover {
  background: #f9fbff;
}

.invoice-table tbody tr:last-child td {
  border-bottom: none;
}

/* 2️⃣ Колонка "Сумма" */
.invoice-table td:nth-child(5),
.invoice-table th:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 3️⃣ Красивые статусы */
.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.status-paid {
  background: #e6f6ed;
  color: #1e7e34;
}

.status-unpaid {
  background: #fdecea;
  color: #b02a37;
}

/* 4️⃣ Сделаем таблицу "карточной" на мобильном */
@media (max-width: 768px) {
  .invoice-table thead {
    display: none;
  }

  .invoice-table tr {
    display: block;
    background: white;
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }

  .invoice-table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
  }
}

/**/
#invoiceSummary {
  padding: 12px 16px;
  background: #f7f9fc;
  border-radius: 10px;
  font-weight: 600;
  color: #3B485A;
}

.invoice-unpaid-row {
  background: #fff9f9;
}

#invoiceFilterStatus,
#invoiceFilterManager {
  margin-bottom: 0 !important;
}

.invoice-bio-link {
  color: #1f4ed8;
  text-decoration: none;
  font-weight: 500;
}

.invoice-bio-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.invoice-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: 0.2s;
}

.invoice-delete-btn:hover {
  opacity: 1;
  color: #c62828;
}

/* =========================================
   💰 Неоновая кнопка "Счета"
========================================= */

.btn-invoices-glow {
  background: linear-gradient(135deg, #0dbb58, #16d96f);
  color: #fff !important;
  font-weight: 600;
  border: none;
  position: relative;
  box-shadow:
    0 0 6px rgba(22, 217, 111, 0.6),
    0 0 14px rgba(22, 217, 111, 0.5),
    0 0 24px rgba(22, 217, 111, 0.4);
  transition: all 0.25s ease;
}

/* мягкая пульсация */
@keyframes invoiceGlowPulse {
  0% {
    box-shadow:
      0 0 6px rgba(22, 217, 111, 0.6),
      0 0 14px rgba(22, 217, 111, 0.5),
      0 0 24px rgba(22, 217, 111, 0.4);
  }
  50% {
    box-shadow:
      0 0 10px rgba(22, 217, 111, 0.8),
      0 0 22px rgba(22, 217, 111, 0.7),
      0 0 40px rgba(22, 217, 111, 0.6);
  }
  100% {
    box-shadow:
      0 0 6px rgba(22, 217, 111, 0.6),
      0 0 14px rgba(22, 217, 111, 0.5),
      0 0 24px rgba(22, 217, 111, 0.4);
  }
}

.btn-invoices-glow {
  animation: invoiceGlowPulse 2.2s infinite ease-in-out;
}

/* hover — чуть агрессивнее */
.btn-invoices-glow:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 12px rgba(22, 217, 111, 0.9),
    0 0 28px rgba(22, 217, 111, 0.8),
    0 0 48px rgba(22, 217, 111, 0.7);
}

#invoicesModal .modal-content {
  overflow-y: hidden !important;
}

.table-counterparties {
  width: 100%;
  table-layout: fixed;
}

.table-counterparties {
  width: 100%;
  table-layout: fixed;
}

/* Общие ограничения */
.table-counterparties th,
.table-counterparties td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1️⃣ ID */
.table-counterparties th:nth-child(1),
.table-counterparties td:nth-child(1) {
  width: 200px;
  font-family: monospace;
  font-size: 12px;
  color: #666;
}

/* 2️⃣ Контрагент */
.table-counterparties th:nth-child(2),
.table-counterparties td:nth-child(2) {
  width: auto;
}

/* 3️⃣ Тип */
.table-counterparties th:nth-child(3),
.table-counterparties td:nth-child(3) {
  width: 130px;
}

/* 4️⃣ Поступления */
.table-counterparties th:nth-child(4),
.table-counterparties td:nth-child(4) {
  width: 160px;
  text-align: right;
  font-weight: 500;
  color: #18a67b; /* можно убрать если не хочешь зелёный */
}

/* 5️⃣ Действия */
.table-counterparties th:nth-child(5),
.table-counterparties td:nth-child(5) {
  width: 110px;
  text-align: right;
}

.table-counterparties td:nth-child(4) {
  font-variant-numeric: tabular-nums;
}
/* ===== Floating Staff FRT Panel ===== */

.staff-frt-panel{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 380px;
  max-width: calc(100vw - 28px);
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.10);
  z-index: 20000;
  overflow: visible;
}

.staff-frt-tabs{
  display:flex;
  border-bottom:1px solid #eee;
  padding:4px 6px;
  gap:6px;
}

.staff-frt-tab{
  font-size:12px;
  padding:4px 10px;
  border-radius:6px;
  cursor:pointer;
  color:#667085;
}

.staff-frt-tab:hover{
  background:#f2f4f7;
}

.staff-frt-tab.active{
  background:#eef2ff;
  color:#344054;
  font-weight:600;
}

.staff-results-period{
  font-size:12px;
  color:#667085;
  margin-bottom:8px;
}

/* ================= HEADER ================= */

.staff-frt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;
  background: #fbfbfd;
  border-bottom: 1px solid #eef0f4;
  cursor: move;
  gap: 10px;
  border-radius: 14px;
}

/* ===== USER SELECT (Unified pill) ===== */

.staff-frt-user-wrapper{
  position: relative;
  flex: 1;
  min-width: 180px;
}

.staff-frt-user{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 14px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  white-space:nowrap;
  transition: all .15s ease;
}

.staff-frt-user:hover{
  background:#f3f4f6;
}

.staff-frt-light{
  font-size:16px;
}

.staff-frt-caret{
  font-size:12px;
  color:#667085;
  margin-left:auto;
  margin-bottom: auto;
}

/* ===== DROPDOWN ===== */

.staff-frt-dropdown{
  position:absolute;
  left:0;
  top:110%;
  width:100%;
  min-width: 220px;
  max-height: 280px;
  overflow-y:auto;
  overflow-x:hidden;

  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.08);
  padding:6px;
  z-index: 99999;
}

/* Scrollbar styling */
.staff-frt-dropdown::-webkit-scrollbar {
  width: 6px;
}
.staff-frt-dropdown::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 6px;
}

.staff-frt-dropdown-item{
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  font-size:14px;
  white-space:nowrap;
}

.staff-frt-dropdown-item:hover{
  background:#f3f4f6;
}

/* ================= ACTION BUTTONS ================= */

.staff-frt-actions{
  display:flex;
  align-items:center;
  gap: 8px;
}

.staff-frt-btn{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  transition: all .15s ease;
}

.staff-frt-btn:hover{
  background:#f3f4f6;
  color:#3B485A;
}

/* ================= BODY ================= */

.staff-frt-body{
  padding: 12px;
  overflow: hidden;
}

/* ===== KPI GRID ===== */

.staff-frt-kpis{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.staff-frt-kpi{
  border: 1px solid #eef0f4;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  margin-bottom: 5px;
}

.staff-frt-kpi .v{
  font-weight: 800;
  font-size: 16px;
  color:#111827;
}

.staff-frt-kpi .l{
  font-size: 12px;
  color:#667085;
  margin-top: 2px;
}

/* ===== UNANSWERED LIST ===== */

.staff-frt-block{
  border-top: 1px dashed #eef0f4;
  padding-top: 10px;
}

.staff-frt-subtitle{
  font-weight: 700;
  font-size: 13px;
  color:#243042;
  margin-bottom: 8px;
}

.staff-frt-list{
  display:flex;
  flex-direction:column;
  gap: 8px;
  max-height: 240px;
  overflow:auto;
  padding-right: 4px;
}

.staff-frt-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  background: #fff;
}

.staff-frt-item a{
  color:#2563eb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.staff-frt-pill{
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color:#111827;
  white-space: nowrap;
}

/* ===== COLLAPSED STATE ===== */

.staff-frt-panel.collapsed .staff-frt-body{
  display:none;
}

/* ================= MOBILE ================= */

@media (max-width: 600px){
  .staff-frt-panel{
    right: 10px;
    left: 10px;
    width:auto;
    bottom: 12px;
  }
}

/* Мини иконка в верхней панели */
.frt-mini-toggle{
  margin-left: 10px;
  border:none;
  background:rgba(255,255,255,0.15);
  color:#fff;
  font-size:18px;
  width:34px;
  height:34px;
  border-radius:10px;
  cursor:pointer;
  transition:all .15s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}

.frt-mini-toggle:hover{
  background:rgba(255,255,255,0.25);
}

/* мобильная версия */
@media (max-width: 600px){
  .frt-mini-toggle{
    width:30px;
    height:30px;
    font-size:16px;
    margin-left:6px;
  }
}

.msg-error-hint{
  margin-top:6px;
  padding:6px 8px;
  border-radius:6px;
  font-size:12px;
  background:#fff4f4;
  color:#b71c1c;
  border:1px solid #f5c2c2;
  line-height:1.3;
  max-width:320px;
}

.invoice-id{
  font-family: monospace;
  font-size:10px;
  color:#777;
}

.staff-frt-ignore {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #f9fafb;
  color: #344054;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.staff-frt-ignore:hover {
  background: #f2f4f7;
}

.doc-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.doc-name {
  font-weight: 500;
  font-size: 13px;
  cursor: text;

  flex: 1;
  min-width: 0;

  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.doc-actions-wrapper {
  flex-shrink: 0;
}

.doc-name {
  max-width: 100%;
}

.doc-name:hover {
  text-decoration: underline;
  text-underline-offset: 4px ;
}

.dropdown-title {
  font-weight: 600;
}

.dropdown-hint {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  line-height: 1.2;
}

.sale-modal{
  max-width:560px;
  padding:32px;
}

.sale-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin-top:16px;
}

.sale-grid .field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.sale-grid .field.full{
  grid-column:1 / -1;
}

.sale-grid label{
  font-size:13px;
  color:#666;
}

.sale-grid input,
.sale-grid select,
.sale-grid textarea{
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:8px;
  font-size:14px;
  height: auto;
}

.sale-actions{
  margin-top:20px;
  display:flex;
  justify-content:flex-start;
}

.sale-client{
  margin-top:6px;
  font-size:13px;
  color:#666;
}

/* 📱 Мобильная версия */
@media (max-width: 640px){

  .sale-modal{
    max-width:100%;
    width:100%;
    padding:24px 18px;
  }

  .sale-grid{
    grid-template-columns:1fr;
    gap:14px;
  }

  .sale-grid .field.full{
    grid-column:auto;
  }

  .sale-actions{
    justify-content:center;
  }

}

/* Блок продажи */
.bio-sale-inline{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:10px;
}

.bio-sale-done{
  margin-top:10px;
  font-size:14px;
  display:flex;
  align-items:center;
  gap:6px;
}

.bio-sale-price{
  font-weight:600;
  color:#1f2937;
}

.bio-sale-date{
  font-size:13px;
  color:#9ca3af;
}


/* Кнопка фиксации продажи */
.btn-sale{
  margin-top:10px;
  padding:7px 12px;
  border-radius:6px;
  border:1px solid #d1d5db;
  background:#ffffff;
  color:#374151;
  font-size:13px;
  cursor:pointer;
  transition:all .15s ease;
}

.btn-sale:hover{
  background:#f9fafb;
  border-color:#9ca3af;
  color:#374151;
}

button:disabled{
  opacity:0.7;
  cursor:not-allowed;
}

.sale-agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sale-agent-row select {
  flex: 1;
}

.sale-agent-row .add-agent-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #dcdcdc;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.add-agent-btn:hover {
  background-color: #3B485A;
}
.field.full {
  margin-right: 12px;
}

/* Модалка агента */
.agent-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px 24px;
  margin-top: 20px;
}

/* поле */
.agent-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* широкое поле */
.agent-field.full {
  grid-column: 1 / -1;
}

/* среднее */
.agent-field.span2 {
  grid-column: span 2;
}

.agent-field label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.agent-field input,
.agent-field select {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #dcdcdc;
  font-size: 14px;
  background: #fff;
}

.agent-field textarea {
  min-height: 80px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dcdcdc;
  resize: vertical;
}

.agent-save {
  margin-top: 28px;
}

#saleModal {
  z-index: 1000;
}

#agentModal {
  z-index: 2000;
}

.agent-payments-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin-top:8px;
}

.payment-group{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:14px;
  background:#fafafa;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.payment-title{
  font-size:13px;
  font-weight:600;
  color:#374151;
}

.payment-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.payment-row span{
  font-size:13px;
  color:#6b7280;
  min-width:70px;
}

.payment-row input{
  flex:1;
  height:38px;
  padding:0 10px;
  border-radius:8px;
  border:1px solid #dcdcdc;
  font-size:14px;
}

/* 📱 мобилка */
@media (max-width:640px){
  .agent-payments-grid{
    grid-template-columns:1fr;
  }
}

.vacation-container {
  overflow-x: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

.vacation-table {
  border-collapse: collapse;
  min-width: 1200px;
  font-size: 13px;
}

.vacation-table th,
.vacation-table td {
  border: 1px solid #eee;
  padding: 6px;
  text-align: center;
  white-space: nowrap;
}

.vacation-table th {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 2;
}

.vacation-table .employee-name {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 3;
  text-align: left;
  font-weight: 500;
}

.vacation-day {
  width: 28px;
}

.vacation-active {
  background: #4CAF50;
  color: white;
  border-radius: 4px;
}

.selection-range {
  background: #2196F3 !important;
  color: white;
}

.vacation-day,
.employee-name {
  user-select: none;
}

.vacation-day {
  cursor: pointer;
}

/* левая колонка */
.sticky-left {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

/* ФИО */
.employee-name {
  min-width: 220px;
  font-weight: 500;
}

/* группа */
.group-title {
  font-weight: 600;
  background: #f0f3f7;
}

/* строка группы */
.group-row td {
  background: #f0f3f7;
}

/* пустые ячейки */
.group-fill {
  background: #f0f3f7;
}

#vacationTable th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.day-number {
  font-size: 12px;
  font-weight: 600;
}

.day-name {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}

/* выходные — мягкий фон */
.weekend {
  background: #f6f7f9;
}

/* выходные в header чуть заметнее */
th.weekend {
  background: #eef1f5;
}

/* если отпуск попал на выходной — приоритет у отпуска */
.vacation-active {
  background: #4CAF50 !important;
  color: white;
}

/* столбец "сегодня" */
.today-col {
  background: #fff7e6 !important;
}

/* header чуть ярче */
th.today-col {
  background: #ffe7ba !important;
}

.today-col {
  box-shadow: inset 2px 0 0 #ffa940;
}

.vac-icon {
  width: 14px;
  height: 14px;
  display: block;
  margin: 0 auto;
  pointer-events: none; /* чтобы не мешал drag */
}

/* если отпуск — сохраняем зелёный */
.vacation-active.today-col {
  background: #4CAF50 !important;
}

/* ОБЕРТКА */
.salary-table-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
}

/* ТАБЛИЦА */
.salary-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  min-width: 560px;
  background: transparent;
}

/* HEADER */
.salary-table thead th {
  text-align: left;
  font-weight: 500;
  color: #6b7280;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

/* ROWS */
.salary-table tbody tr {
  transition: background 0.15s ease;
}

.salary-table tbody tr:hover {
  background: #fafafa;
}

/* CELLS */
.salary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
  white-space: nowrap;
}

/* ЧИСЛА */
.salary-table td:nth-child(2),
.salary-table td:nth-child(3),
.salary-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ПРЕМИЯ (зелёный мягкий) */
.salary-table td:nth-child(3) {
  color: #16a34a;
}

/* ===== ИТОГО (Notion-style) ===== */
.salary-table td:last-child {
  font-weight: 500;
  color: #0f172a;
  background: #f5f5f5;
  border-radius: 6px;
}

/* при hover строки */
.salary-table tbody tr:hover td:last-child {
  background: #f3f4f6;
}

.salary-table td:last-child {
  position: relative;
}

.salary-table td:last-child span,
.salary-table td:last-child {
  position: relative;
  z-index: 1;
}

.salary-table td:last-child {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.salary-table td:last-child {
  color: #0f172a; /* чуть глубже чем #111 */
}

/* НУЛИ (если используешь span) */
.salary-table .muted {
  opacity: 0.35;
}

/* КЛИК ПО ЯЧЕЙКЕ */
.salary-table td[ondblclick] {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.salary-table td[ondblclick]:hover {
  background: #f3f4f6;
}

/* РОВНЫЕ КОЛОНКИ */
.salary-table th:nth-child(2),
.salary-table td:nth-child(2),
.salary-table th:nth-child(3),
.salary-table td:nth-child(3),
.salary-table th:nth-child(4),
.salary-table td:nth-child(4) {
  width: 140px;
}

/* p1 */
.salary-table td:nth-child(3) {
  color: #3b82f6;
}

/* p2 */
.salary-table td:nth-child(4) {
  color: #16a34a;
}

/* ИМЯ СОТРУДНИКА */
.salary-table td:first-child {
  font-weight: 500;
  color: #111;
}

/* ВЫРАВНИВАЕМ КОЛОНКИ 2–4 (Оклад / Премия / Итого) */
.salary-table th:nth-child(2),
.salary-table th:nth-child(3),
.salary-table th:nth-child(4) {
  text-align: right;
}

/* уже есть, но на всякий случай */
.salary-table td:nth-child(2),
.salary-table td:nth-child(3),
.salary-table td:nth-child(4) {
  text-align: right;
}

.salary-table thead th {
  padding-bottom: 6px;
}

.salary-table td {
  padding-top: 10px;
}

/* ===== ТОЛЬКО РАЗДЕЛ ЗАРПЛАТ ===== */

#employees-salary-section h2 {
  font-weight: 600;
  letter-spacing: -0.2px;
}

#employees-salary-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* КНОПКА */
#employees-salary-section button {
  background: #f3f4f6;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

#employees-salary-section button:hover {
  background: #e5e7eb;
}

/* КАРТОЧКА */
#employees-salary-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
  cursor: pointer;
}

.check-item input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#salaryMonthSelect,
#salaryYearSelect {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 6px 10px;
  background: white;
  cursor: pointer;
  font-weight: 900;
}

#salaryMonthSelect:hover,
#salaryYearSelect:hover {
  border-color: #28AF8B;
}

.salary-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.salary-tab-btn.active::before {
  content: "";
  width: 14px;
  height: 14px;
  background: url('/icons/check_green.svg') no-repeat center;
  background-size: contain;
}

/* ===============================
   💰 Настройки ЗП
=============================== */

.salary-section {
  padding: 16px 18px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #eee;
  margin-bottom: 8px;
}

.salary-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 🔥 лучше grid вместо flex */
.salary-field {
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

/* 🔥 единый стиль инпутов */
.salary-field input,
.salary-field select {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

/* 🔥 скрытие блоков */
.salary-section.hidden {
  display: none;
}

/* ===============================
   📊 Проценты
=============================== */

.input-percent {
  position: relative;
  width: 100%; /* 👈 теперь как у обычных */
}

.input-percent input {
  width: 100%;
  height: 36px;
  padding: 6px 28px 6px 10px; /* место под % */
}

.input-percent span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #6b7280;
  pointer-events: none;
}

/* ===============================
   ✨ UX
=============================== */

.salary-field input:focus,
.salary-field select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

input:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
  opacity: 0.8;
}

/* 🔥 ОБЩИЙ СКРОЛЛ */
.salary-table-wrap,
.simple-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative; /* 👈 важно */
}

/* таблицы */
.salary-table,
.simple-table {
  min-width: 700px;
}

/* ===============================
   ✨ ТЕНИ СКРОЛЛА
=============================== */

/* справа */
.salary-table-wrap::after,
.simple-table-wrapper::after {
  content: "";
  position: sticky;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
}

/* слева */
.salary-table-wrap::before,
.simple-table-wrapper::before {
  content: "";
  position: sticky;
  top: 0;
  left: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0.95), transparent);
}

.salary-table-wrap,
.simple-table-wrapper {
  padding: 0 4px; /* чуть воздуха */
}

.preg-badge {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
}

.preg-yes {
  background: #d1fae5;
  color: #065f46;
}

.preg-no {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================= */
/* 🔥 ЦИКЛЫ — STICKY КОЛОНКА */
/* ============================= */

.surrogates-table .sticky-col {
  position: sticky;
  left: -1px; /* фикс артефакта */
  z-index: 3;

  background: #f8fafc;
  min-width: 400px;

  border-right: 1px solid #e5e7eb;
  box-shadow: 2px 0 6px rgba(0,0,0,0.04);
}

/* header всегда выше */
.surrogates-table th.sticky-col {
  z-index: 5;
  background: #f1f5f9;
}

/* ❗ убираем влияние зебры на sticky */
.surrogates-table tbody tr:nth-child(even) .sticky-col {
  background: #f8fafc;
}


/* ============================= */
/* 📅 TODAY CELL (ячейка) */
/* ============================= */

.today-cell {
  position: relative;
  background: #f9fafb !important;
}

/* рамка как в Notion */
.today-cell::before {
  content: "";
  position: absolute;
  inset: 2px; /* чуть внутрь — выглядит аккуратнее */
  border: 2px solid #28af8b;
  border-radius: 6px;
  pointer-events: none;
  z-index: 0;
}

/* текст поверх */
.today-cell span {
  position: relative;
  z-index: 2;
}

.today-cell:hover::before {
  border-color: #000;
  transform: scale(1.02);
}

/* ============================= */
/* 📅 TODAY HEADER */
/* ============================= */
/* контейнер внутри th */
.today-header-box {
  position: relative;
  padding: 6px 4px;
  border-radius: 6px;
  background: #f1f5f9;
}

/* рамка аккуратная */
.today-header-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #28af8b;
  border-radius: 6px;
  pointer-events: none;
}


/* ============================= */
/* 📏 РОВНЫЕ ЯЧЕЙКИ */
/* ============================= */

.surrogates-table td {
  height: 56px;
  vertical-align: middle;
  padding: 8px 10px;
  font-size: 12px;
}

.surrogates-table th {
  text-align: center;
}


/* ============================= */
/* ✨ МЕЛКИЕ УЛУЧШЕНИЯ */
/* ============================= */

/* hover строки — как в Notion */
.surrogates-table tbody tr:hover td {
  background: #f3f4f6;
}

/* но не ломаем цвета цикла */
.surrogates-table tbody tr:hover td[style*="background"] {
  filter: brightness(0.98);
}

/* плавность */
.surrogates-table td,
.surrogates-table th {
  transition: background 0.15s ease;
}

.hcg-label {
  font-size: 10px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 2px;
}

/* 🔝 фикс хедера (даты) */
.surrogates-table thead th {
  position: sticky;
  top: -1px;
  z-index: 5; /* выше обычных ячеек */
  background: #f9fafb;
}

/* 🔝 левый верхний угол (ФИО + header) */
.surrogates-table thead th.sticky-col {
  z-index: 6; /* САМЫЙ верх */
  background: #f1f5f9;
}

/* 🔄 фикс для body sticky колонки */
.surrogates-table td.sticky-col {
  z-index: 4;
  background: #f8fafc;
}

.surrogates-table thead th {
  box-shadow: 0 2px 0 #e5e7eb;
}

#surrogates-layout {
  overflow: auto;
  max-height: calc(100vh - 200px); /* или свой */
}

/* Закрыто, причины под статусом в surrogate.html */
.close-reason-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff5f5;
  border: 1px solid #ffd6d6;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.close-reason-title {
  font-weight: 600;
  color: #b30000;
  font-size: 13px;
}

.close-reason-row {
  display: flex;
  gap: 6px;
  line-height: 1.4;
}

.close-reason-row .label {
  color: #888;
  min-width: 90px;
}

.close-reason-date {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.req-loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-content {
  position: relative;
}

.outcome-row {
  grid-column: 1 / -1;
  padding: 0;
  border: none;
  background: transparent;
}

.outcome-select {
  width: 100%;
  margin-top: 6px;
  height: 38px;
  font-weight: 500;
}

/* 🔥 если не выбран (ожидаем) — нейтрально */
.outcome-select[value="ongoing"] {
  background: #f5f5f5;
}

/* 🔥 можно подсветить выбор */
.outcome-select:focus {
  border-color: #4CAF50;
}

.outcome-group {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 12px;
}

.outcome-group label {
  margin-bottom: 6px;
  font-weight: 600;
}

.outcome-select {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
}

.req-hint {
  background: #f8f9fb;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.req-hint-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.req-hint-section {
  margin-top: 10px;
}

.req-hint-sub {
  font-weight: 500;
  margin-bottom: 4px;
}

.req-hint ul {
  margin: 0;
  padding-left: 18px;
}

.req-hint li {
  margin-bottom: 4px;
}
/* === ANALYSIS BOX === */

.analysis-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  background: #fff;
}

/* HEADER */
.analysis-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

/* поиск */
.analysis-header input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 13px;
}

/* кнопки */
.analysis-actions {
  display: flex;
  gap: 6px;
}

.analysis-btn {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.analysis-btn.primary {
  background: #28AF8B;
  color: #fff;
  border-color: #28AF8B;
}

.analysis-btn.primary:hover {
  background: #23997a;
}

.analysis-btn.ghost {
  color: #555;
}

.analysis-btn.ghost:hover {
  background: #f5f5f5;
}

/* LIST */
.analysis-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

/* ========================= */
/* 🔥 ГЛАВНЫЙ ФИКС — GRID */
/* ========================= */

.analysis-item {
  display: grid;
  grid-template-columns: 1fr 70px; /* 🔥 цена всегда справа */
  align-items: center;
  padding: 6px 8px;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}

/* левая часть */
.analysis-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* чекбокс */
.analysis-left input {
  flex-shrink: 0;
}

/* текст */
.analysis-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* цена */
.analysis-price {
  text-align: right;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

/* hover */
.analysis-item:hover {
  background: #f9fafb;
}

/* FOOTER */
.analysis-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
}

/* === GP MODAL FIX === */

.gp-modal {
  max-width: 520px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}

/* HEADER */
.gp-modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #eee;
}

.gp-modal-header h3 {
  margin: 0 0 6px;
}

.gp-modal-header p {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* BODY */
.gp-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

/* FOOTER */
.gp-modal-footer {
  padding: 12px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fff;
}

/* LABELS */
.gp-modal-body label {
  font-size: 13px;
  color: #666;
  display: block;
  margin-top: 10px;
}

/* INPUT */
.gp-modal-body .req-input {
  margin-top: 4px;
}

/* hint */
.hint {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

/* =========================
   🧬 ЭМБРИОНЫ — КАРТОЧКИ
   ========================= */

.embryo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* карточка */
.embryo-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;

  display: flex;
  flex-direction: column;
  gap: 10px;

  transition: all 0.2s ease;
}

.embryo-card:hover {
  border-color: #d0d7de;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

/* header */
.embryo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.embryo-title {
  font-size: 14px;
  font-weight: 500;
}

/* детали */
.embryo-details {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* подписи */
.label {
  color: #6b7280;
  font-weight: 500;
  margin-right: 6px;
}

/* бейдж */
.embryo-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
}

/* статусы */
.embryo-ok {
  background: #e6f7f1;
  color: #18a67b;
}

.embryo-soon {
  background: #fff4e5;
  color: #d48806;
}

.embryo-expired {
  background: #ffeaea;
  color: #cf1322;
}

.embryo-util {
  background: #f3f4f6;
  color: #9ca3af;
}

/* рамка по статусу */
.embryo-card.soon {
  border-color: #ffe58f;
}

.embryo-card.expired {
  border-color: #ffa39e;
  animation: pulseRed 2s infinite;
}

.embryo-card.util {
  opacity: 0.65;
  background: #fafafa;
}

/* пульсация просрочки */
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.2); }
  70% { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}

/* действия */
.embryo-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* кнопки */
.btn-mini {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #333;
  border: none;
  cursor: pointer;
  transition: 0.15s;
}

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

.btn-mini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* опасная */
.btn-mini.danger {
  background: #ffeaea;
  color: #cf1322;
}

.btn-mini.danger:hover {
  background: #ffd6d6;
}

/* вторичный текст */
.muted {
  color: #6b7280;
  font-size: 12px;
}

/* =========================
   📦 МОДАЛКА
   ========================= */

.embryo-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.embryo-section {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.embryo-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.embryo-row {
  display: flex;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.field label {
  font-size: 12px;
  color: #6b7280;
}

.field input,
.field select {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #18a67b;
}

/* кнопка +6 месяцев */
.embryo-actions-row {
  display: flex;
  justify-content: flex-end;
}

.btn-light {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

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

/* футер */
.embryo-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.embryo-card {
  position: relative;
}

/* верхние иконки */
.embryo-actions-top {
  position: absolute;
  top: 8px;
  right: 8px;

  display: flex;
  gap: 1px;
}

/* иконки */
.icon-btn-es {
  width: 20px;
  height: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 6px;
  border: none;
  background: transparent;

  cursor: pointer;
  transition: 0.15s;
  padding: 2px;
}

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

.icon-btn-es:hover {
  background: #f3f4f6;
}

.icon-btn-es:hover img {
  opacity: 1;
}

/* опасная */
.icon-btn-es.danger:hover {
  background: #ffeaea;
}

/* текстовые статусы */
.danger-text {
  color: #cf1322;
}

.warn-text {
  color: #d48806;
}

/* === ЭМБРИОНЫ — РЕЕСТР === */

.embryo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* заголовок */
.embryo-table thead {
  background: #f8fafc;
}

.embryo-table th {
  cursor: pointer;
  user-select: none;
}

.embryo-table th:hover {
  color: #111;
}

.embryo-table th {
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

/* строки */
.embryo-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* hover */
.embryo-table tbody tr:hover {
  background: #fafafa;
}

/* био имя */
.embryo-table .bio-name {
  font-weight: 500;
  color: #111827;
}

/* статус */
.embryo-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-block;
}

/* цвета */
.embryo-status.ok {
  background: #e6f7f1;
  color: #18a67b;
}

.embryo-status.soon {
  background: #fff4e5;
  color: #d48806;
}

.embryo-status.expired {
  background: #ffeaea;
  color: #cf1322;
}

.embryo-status.util {
  background: #f3f4f6;
  color: #9ca3af;
}

/* компакт */
.embryo-table.compact td {
  padding: 8px 10px;
}

@media (max-width: 768px) {
  .embryo-table th,
  .embryo-table td {
    padding: 8px;
    font-size: 12px;
  }
}

.bio-link {
  color: #111827;
  text-decoration: none;
}

.bio-link:hover {
  text-decoration: underline;
  color: #0077cc;
}

.embryo-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
}

.embryo-stats .stat {
  padding: 4px 8px;
  border-radius: 8px;
  background: #f3f4f6;
}

.stat.expired {
  background: #ffeaea;
  color: #cf1322;
}

.stat.soon {
  background: #fff4e5;
  color: #d48806;
}

.stat.total {
  background: #e6f7f1;
  color: #18a67b;
}

.section-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.section-summary::-webkit-details-marker {
  display: none; /* убираем стандартную стрелку */
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}


.bio-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom:24px;
}

.bio-card-header {
  display: flex;
  gap: 14px;
}

.bio-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bio-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.bio-card-meta {
  font-size: 13px;
  color: #666;
}

.bio-card-btn {
  background: #f5f7fb;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.bio-card-avatar {
  flex-shrink: 0;
}

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

.bio-card-btn:hover {
  background: #e9edf5;
}

.bio-card-label {
  font-size: 11px;
  color: #8892a0;
}

.bio-card-avatar {
  flex-shrink: 0;
  cursor: pointer;
}

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

.bio-card-btn:hover {
  background: #e9edf5;
}

.bio-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* === Embryo Storage File Upload === */

.es-file-upload {
  margin-top: 8px;
}

.es-file-box {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;

  background: #fff;
  transition: 0.2s;
}

.es-file-box:hover {
  border-color: #bbb;
}

.es-file-btn {
  background: #f5f5f5;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.es-file-name {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.es-file-name.has-file {
  color: #18a67b;
}

.es-file-hint {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  margin-bottom: 30px;
}

/* footer */
.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* cancel */
.modal-footer .btn {
  border-radius: 12px;
  padding: 10px 18px;
}

/* primary */
.btn.primary {
  flex: 1;
  height: 48px;
  font-size: 16px;
  border-radius: 14px;
}

.field-hint {
  font-size: 12px;
  color: #8a97a6;
  margin-top: 2px;
}

/* =========================
   🧪 LABS — NOTION STYLE
========================= */

.lab-group {
  margin-top: 20px;
}

.lab-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 12px;
  margin-bottom: 10px;

  background: #f7f7f7;
  border-radius: 10px;

  font-weight: 600;
  font-size: 14px;
}

.lab-group-count {
  font-size: 12px;
  color: #888;
}

.lab-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;

  padding: 14px 16px;
  margin-bottom: 10px;

  transition: all 0.15s ease;
}

.lab-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-color: #ddd;
}

.lab-meta {
  font-size: 12px;
  color: #777;
}

.lab-right {
  text-align: right;
}

.lab-status {
  font-size: 12px;
  font-weight: 500;
}

.lab-status.ok {
  color: #18a67b;
}

.lab-status.bad {
  color: #e5484d;
}

.lab-btn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
}

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

.lab-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;

  font-size: 12px;
  color: #777;
}

.lab-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lab-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.lab-source {
  background: #f3f3f3;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}
.lab-title-rez {
  color: #3b485a;
  font-size: 12px;
  /* line-height: 1.2; */
  font-weight: 500;
}

.lab-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lab-btn-icon {
  border: 1px solid #eee;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.15s ease;
}

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

.lab-btn-icon:hover {
  background: #f5f5f5;
}

.lab-suggestion {
  cursor: pointer;
  text-decoration: underline;
}

.lab-suggestion:hover {
  color: #0275d8;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

@media (max-width: 768px) {
  .surrogates-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .surrogates-actions .btn:first-child {
    grid-column: span 2; /* большая кнопка сверху */
  }
}

.cryo-client-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  cursor: pointer;
  transition: 0.2s;
}

.cryo-client-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.cryo-bio-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  font-weight: 500;
}

.cryo-bio-badge {
  pointer-events: none;
}

img:hover {
  transform: scale(1.05);
  transition: 0.15s;
}

.textarea-send-btn.sending {
  opacity: 0.6;
  pointer-events: none;
}

.textarea-send-btn.success {
  background: #18a67b;
}

.textarea-send-btn.success img {
  filter: brightness(0) invert(1);
}

.meta-chip {
  display:flex;
  align-items:center;
  gap:4px;
  background:#f3f3f3;
  padding:2px 6px;
  border-radius:6px;
  cursor:pointer;
  transition:0.15s;
}

.meta-chip:hover {
  background:#e8e8e8;
}

.lead-modal-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.lead-modal-body {
  flex: 1;
  overflow-y: auto;
}

.lead-modal-content {
  overflow: visible;
}

#leadInfoBody {
  transition: all .2s ease;
}

#timelineComposer {
  position: sticky;
  top: 0;
  z-index: 5;
}

#timelineComposerBody {
  transition: all 0.2s ease;
}

.lead-linear {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* HEADER */
.lead-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.lead-main {
  flex: 1;
}

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

.lead-type {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
}

.lead-name {
  font-weight: 600;
  cursor: pointer;
}

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

.chip {
  font-size: 12px;
  padding: 2px 6px;
  background: #f1f3f5;
  border-radius: 6px;
}

.chip.muted {
  color: #888;
}

.lead-id {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* STATUS */
.lead-status-row {
  display: flex;
  gap: 6px;
}

.status-pill {
  padding: 4px 8px;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 12px;
  cursor: pointer;
}

/* PROPERTIES */
.lead-properties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 8px;
}

.prop {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.label {
  color: #888;
  font-size: 11px;
}

.value {
  font-weight: 500;
}

/* EXTRA */
.lead-extra-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 10px;
}

.lead-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.lead-actions-block {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.status-pill.active {
  background: #111;
  color: #fff;
  font-weight: 500;
}

.status-pill:hover {
  background: #e5e7eb;
}

.lead-actions-block .btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-wrap {
  position: relative;
}

#surrogatesActionsDropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  z-index: 1000;
}

.timeline-task-date-error {
  border-radius:6px;
  outline: 2px solid #e53935;
  border-radius: 6px;
  animation: timelineShake .25s linear;
}

@keyframes timelineShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* ========================================
   🧊 CREATE CRYO MODAL
======================================== */

.cryo-create-modal{
  width:min(900px,95vw);
  max-height:90vh;
  overflow-y:auto;
  background:#fff;
  border-radius:20px;
  display:flex;
  flex-direction:column;
}

/* важно */
#cryoModal.modal{
  overflow-y:auto;
  padding:24px;
  align-items:flex-start;
}