:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --accent: #10b981;
  --accent-dark: #059669;
  --red-500: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  min-height: 100vh;
}

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(to bottom, #003700, #ededef);
  color: #111827;
  position: fixed;
  height: 100%;
  overflow-y: auto;
  z-index: 100;
  transition: width 0.35s ease;
}

.sidebar.collapsed {
  width: 80px;
}
/* Toggle-кнопка не перекрывает логотип */
.sidebar .toggle-sidebar-btn {
  position: absolute;
  top: 1.5rem;          /* ниже профиля */
  right: 1rem;
  z-index: 10;
}

.sidebar.collapsed .profile-block {
  margin-top: 3.5rem;   /* логотип уходит ниже кнопки */
  justify-content: center;
}

.sidebar.collapsed .logo-text {
  display: none;        /* в свёрнутом только аватар */
}
.main-content {
  margin-left: 240px;
  flex: 1;
  transition: margin-left 0.35s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 80px;
}

.toggle-sidebar-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.toggle-sidebar-btn:hover {
  background: rgba(0,0,0,0.25);
}

.profile-block {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}

.sidebar.collapsed .profile-block .nav-text {
  display: none;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.25rem;
  color:  #d0d0d3;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 1rem 0;
}

.nav-item:hover {
  background: rgba(0,0,0,0.08);
}

.nav-label {
  margin-left: 1rem;
  font-size: 1rem;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .nav-item {
  position: relative;
}

.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e40af;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 200;
}

.sidebar.collapsed .nav-item:hover::after {
  opacity: 1;
}

.sidebar.collapsed .nav-item:hover::before {
  content: '';
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e40af;
}

.header {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-toggle {
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
  display: none;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 24px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

@media (max-width: 1023px) {
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .toggle-sidebar-btn {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
}

/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--gray-500);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.template-card {
  background: var(--gray-50);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: all 0.2s;
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.template-preview {
  height: 140px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
}

.template-info {
  padding: 1rem;
  text-align: center;
}

.template-info h4 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.custom-form {
  display: none;
}

.custom-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}


.logo-text {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.6rem;
  background: linear-gradient(90deg, #d0d0d3, #dcdfe6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 3px rgba(30,64,175,0.2);
  letter-spacing: -0.5px;
}
.mb-6{
    margin-top: 25px;

}