:root {
  --primary-color: #007bff;
  --danger-color: #dc3545;
  --secondary-color: #6c757d;
  --background-color: #ffffff;
  --text-color: #333;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --selected-color: rgba(0, 123, 255, 0.1); /* Цвет выделения выбранных строк */
}

.group-table-container {
  max-width: 100%;
  margin: 16px auto;
  overflow-x: auto;
}
.width{
  width: 24px;
  height: 21px;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

.group-table th,
.group-table td {
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: left;
  font-size: 0.85em;
  color: var(--text-color);
}

.group-table th {
  background: #f8f9fa;
  font-weight: 600;
  cursor: pointer;
}

.group-table th[data-sort]:hover {
  background: #e9ecef;
}

.group-row:hover {
  background: #f8f9fa;
}

.group-table .btn-icon {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  position: relative;
}

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

.group-table .btn-icon:hover img {
  filter: brightness(0.8);
}

.group-table .btn-icon[title]::after {
  content: attr(title);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.group-table .btn-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

.client-table-container {
  max-height: 300px; /* Увеличил высоту для удобства */
  overflow-y: auto;
  margin-bottom: 12px;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-color);
}

.client-table th,
.client-table td {
  border: 1px solid var(--border-color);
  padding: 8px;
  font-size: 0.8em;
  color: var(--text-color);
}

.client-table th {
  background: #f8f9fa;
  font-weight: 600;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 1;
}

.client-table th[data-sort]:hover {
  background: #e9ecef;
}

.client-row:hover {
  background: #f8f9fa;
  cursor: pointer;
}

.client-row.selected {
  background: var(--selected-color);
}

.client-row input[type="checkbox"] {
  cursor: pointer;
}

.client-row input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 10px;
}

.modal-content {
  background: var(--background-color);
  padding: 12px;
  border-radius: 8px;
  width: 95%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px var(--shadow-color);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  margin: 0 0 10px;
  font-size: 1.2em;
  color: var(--text-color);
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}

.modal-actions button {
  padding: 5px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8em;
  transition: background 0.3s, transform 0.2s;
}

.modal-actions .btn-primary {
  background: var(--primary-color);
  color: white;
}

.modal-actions .btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.modal-actions .btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.modal-actions .btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.confirm-modal {
  max-width: 320px;
  text-align: center;
}

.confirm-modal p {
  margin: 10px 0;
  color: #666;
  font-size: 0.8em;
}

.client-selector {
  margin-bottom: 10px;
}

.client-selector label {
  font-size: 0.8em;
  color: var(--text-color);
  display: block;
  margin-bottom: 6px;
}

.client-search-container input {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8em;
}

.client-selector-selected {
  margin-top: 8px;
}

.client-selector-selected label {
  font-size: 0.8em;
  color: var(--text-color);
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #f9f9f9;
}

.chip {
  padding: 4px 8px;
  border-radius: 16px;
  background: #e7f0ff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8em;
  color: var(--text-color);
  animation: chipAppear 0.2s ease;
}

@keyframes chipAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chip-remove {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 0.85em;
  line-height: 1;
  transition: color 0.2s;
}

.chip-remove:hover {
  color: #b02a37;
}

.date-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  padding: 10px;
}

.date-modal-content {
  background: var(--background-color);
  padding: 12px;
  border-radius: 8px;
  width: 95%;
  max-width: 400px;
  box-shadow: 0 4px 12px var(--shadow-color);
  animation: fadeIn 0.3s ease;
}

.date-modal-content h2 {
  margin: 0 0 10px;
  font-size: 1.1em;
  color: var(--text-color);
}

.date-modal-content input {
  width: 100%;
  padding: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8em;
}

.date-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.date-modal-actions button {
  padding: 5px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8em;
  transition: background 0.3s, transform 0.2s;
}

.date-modal-actions .btn-primary {
  background: var(--primary-color);
  color: white;
}

.date-modal-actions .btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.date-modal-actions .btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.date-modal-actions .btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Адаптивность для экранов до 350px */
@media (max-width: 350px) {
  .group-table-container,
  .client-table-container {
    padding: 0 8px;
  }

  .group-table th,
  .group-table td,
  .client-table th,
  .client-table td {
    font-size: 0.75em;
    padding: 6px;
  }

  .group-table .btn-icon {
    padding: 4px;
  }

  .group-table .btn-icon img {
    width: 14px;
    height: 14px;
  }

  .group-table .btn-icon[title]::after {
    font-size: 0.7em;
    padding: 3px 6px;
    top: -18px;
  }

  .modal-content {
    width: 95%;
    padding: 10px;
  }

  .modal-content h2 {
    font-size: 1.1em;
  }

  .modal-content input,
  .modal-content select {
    padding: 5px;
    font-size: 0.75em;
  }

  .modal-actions {
    flex-direction: column;
    gap: 6px;
  }

  .modal-actions button {
    width: 100%;
    padding: 4px;
    font-size: 0.75em;
  }

  .client-table-container {
    max-height: 180px;
  }

  .client-search-container input {
    padding: 5px;
    font-size: 0.75em;
  }

  .client-selector-selected label {
    font-size: 0.75em;
  }

  .chip {
    padding: 3px 6px;
    font-size: 0.75em;
  }

  .chip-remove {
    font-size: 0.8em;
  }

  .date-modal-content {
    max-width: 300px;
    padding: 10px;
  }

  .date-modal-content h2 {
    font-size: 1em;
  }

  .date-modal-content input {
    padding: 5px;
    font-size: 0.75em;
  }

  .date-modal-actions button {
    padding: 4px;
    font-size: 0.75em;
  }
}
