/* Layout для организаций: боковое меню + центральная панель + правая панель */

body.org-layout {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.org-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background-color: #f5f6fa;
}

/* Боковое меню */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-brand {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.5rem;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.sidebar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-left-color: #3498db;
}

.sidebar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: #3498db;
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.user-avatar {
  font-size: 2rem;
  margin-right: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: white;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: capitalize;
}

/* Основной контент */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

/* Верхняя панель */
.top-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.top-bar-title {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
}

.top-bar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Центральная панель */
.content-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: #f5f6fa;
}

/* Правая панель редактирования */
.right-panel {
  width: 0;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 999;
  transition: width 0.3s ease;
  overflow: hidden;
}

.right-panel.active {
  width: 450px;
}

.right-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.right-panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

.right-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Overlay для мобильных */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Мобильная версия */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .right-panel.active {
    width: 100%;
  }

  .overlay.active {
    display: block;
  }
}

/* Стили для таблиц в центральной панели */
.content-panel .table {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content-panel .table thead {
  background-color: #f8f9fa;
}

.content-panel .table tbody tr {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.content-panel .table tbody tr:hover {
  background-color: #f8f9fa;
}

.content-panel .table tbody tr.selected {
  background-color: #e3f2fd;
}

/* Стили для карточек */
.content-panel .card {
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

/* Стили для кнопок действий */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Стили для правой панели */
.right-panel-content .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

.right-panel-content .form-control,
.right-panel-content .form-select {
  border-radius: 6px;
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
}

.right-panel-content .form-control:focus,
.right-panel-content .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* История в правой панели */
.history-item {
  padding: 0.75rem;
  border-left: 3px solid #667eea;
  background: #f8f9fa;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.history-item-title {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
}

.history-item-time {
  font-size: 0.75rem;
  color: #6c757d;
}

.history-item-details {
  font-size: 0.85rem;
  color: #495057;
}

/* Анимации */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.right-panel.active {
  animation: slideInRight 0.3s ease;
}

/* Скроллбары */
.sidebar-nav::-webkit-scrollbar,
.right-panel-content::-webkit-scrollbar,
.content-panel::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track,
.right-panel-content::-webkit-scrollbar-track,
.content-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.right-panel-content::-webkit-scrollbar-thumb,
.content-panel::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover,
.right-panel-content::-webkit-scrollbar-thumb:hover,
.content-panel::-webkit-scrollbar-thumb:hover {
  background: #555;
}
