  body { margin: 0; font-family: sans-serif; background: #f4f4f4; }
    header {
      background: #333; color: white; padding: 1em 2em;
      display: flex; justify-content: space-between; align-items: center;
    }
    header nav a { color: white; margin-right: 20px; text-decoration: none; }
    .layout { display: flex; height: calc(100vh - 60px); }
    aside {
      width: 250px; background: #fff; color: white;
      padding: 1em; overflow-y: auto;
    }
    aside h2 { font-size: 18px; margin-top: 0; }
    aside ul { list-style: none; padding-left: 0; }
    aside li { padding: 8px 0; cursor: pointer; }
    main {
      flex: 1; padding: 2em; overflow-y: auto; background: white;
    }
    #dateRangePicker + .flatpickr-input {
  width: 240px !important;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  display: inline-block;
}
 
    .project-details {
      padding: 1em; background: #f9f9f9;
      border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .btn {
      margin: 10px 10px 10px 0;
      padding: 10px 20px;
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      background: #3b82f6;
    }
    
    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .btn:active {
      transform: translateY(0);
    }
    
    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    
    /* Все кнопки теперь используют единый стиль */
    .btn-add, .btn-update, .btn-delete, .btn-edit {
      background: #3b82f6;
    }
    
    .btn-add:hover, .btn-update:hover, .btn-delete:hover, .btn-edit:hover {
      background: #2563eb;
    }
    
    /* Вторичная кнопка (Сбросить) */
    .btn-secondary {
      background: #6b7280;
    }
    
    .btn-secondary:hover {
      background: #4b5563;
    }
    
    /* Специальные стили для кнопок пагинации */
    .pagination .btn {
      padding: 6px 12px;
      font-size: 13px;
      margin: 0 2px;
    }
    
    .pagination .btn:disabled {
      background: #9ca3af;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    
    .pagination .btn:disabled:hover {
      background: #9ca3af;
      transform: none;
      box-shadow: none;
    }
    .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-content {
      background: white; padding: 2em;
      border-radius: 8px; width: 400px; position: relative;
    }
    .modal-content input, .modal-content textarea {
      width: 100%; padding: 10px;
      margin-bottom: 1em; border: 1px solid #ccc; border-radius: 6px;
    }
    
    /* Кнопки в модальных окнах */
    .modal-content .btn {
      margin: 5px 10px 5px 0;
      padding: 8px 16px;
      font-size: 14px;
    }
.view-toggle-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-right: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.view-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.view-toggle-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(59,130,246,0.2);
}

    .autocomplete-item {
      padding: 8px 12px;
      cursor: pointer;
    }
    .spinner {
      border: 6px solid #eee;
      border-top: 6px solid #3b82f6;
      border-radius: 50%;
      width: 38px; height: 38px;
      animation: spin 1s linear infinite;
      display:inline-block;
    }
    @keyframes spin {
      0% { transform: rotate(0deg);}
      100% { transform: rotate(360deg);}
    }
    .autocomplete-item:hover {
      background: #eee;
    }
    .close-btn {
      position: absolute; top: 10px; right: 15px;
      font-size: 24px; cursor: pointer;
      background: none;
      border: none;
      color: #666;
      transition: color 0.2s ease;
    }
    
    .close-btn:hover {
      color: #333;
    }
    table {
      border-collapse: collapse; width: 100%;
      margin-top: 1em; background: white;
    }
    th, td {
      padding: 10px; text-align: center; border: 1px solid #ddd;
    }
    th { background-color: #f0f0f0; font-weight: bold; }
	.metric-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 70px;
    transition: all 0.2s ease;
}
.metric-cell {
    font-weight: 600;
    font-size: 0.95em;
    /* Скругления и паддинг лучше ставить тут, чтобы не было накладок */
    border-radius: 6px;
    padding: 10px;
    transition: background 0.2s;
}
.metric-green {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}
.metric-yellow {
    background-color: #fef9c3 !important;
    color: #b49a2a !important;
}
.metric-orange {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
}
.metric-blue {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}
.metric-red {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}
.autocomplete-item {
    padding: 5px 10px;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.autocomplete-item:hover {
    background: #f0f0f0;
}
.autocomplete-list {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  display: none;
}
.region-pill {
    display: inline-block;
    background: #f5f5f5;
    border-radius: 16px;
    padding: 3px 12px 3px 10px;
    margin: 2px;
    font-size: 13px;
    position: relative;
}
.remove-region {
    margin-left: 7px;
    color: #b00;
    font-weight: bold;
    cursor: pointer;
}
    .card {
      max-width: 420px; margin: 40px auto; background: #fff;
      border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      padding: 24px;
    }
    .card h2 { margin-top: 0; }
    .form-group { margin-bottom: 14px; }
    .form-group label { display: block; margin-bottom: 6px; color: #333; }
    .form-group input {
      width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px;
    }
    
    /* Кнопки в формах */
    .form-group button, .card button {
      background: #3b82f6;
      color: white;
      padding: 10px 18px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .form-group button:hover, .card button:hover {
      background: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .form-group button:active, .card button:active {
      transform: translateY(0);
    }
    .muted { color: #666; font-size: 14px; margin-top: 10px; }
    .error { color: #dc3545; margin-top: 10px; }
    .success { color: #28a745; margin-top: 10px; }
    .project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.project-actions .btn {
  padding: 8px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.project-actions .btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Все кнопки в project-actions теперь используют единый стиль */
.project-actions .btn-delete,
.project-actions .btn-edit,
.project-actions .btn-add {
  background: #3b82f6;
  color: #fff;
}

.project-actions .btn-delete:hover,
.project-actions .btn-edit:hover,
.project-actions .btn-add:hover {
  background: #2563eb;
  color: #fff;
}
#projectSidebar {
  padding: 0;
}
.project-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  cursor: pointer;
  background: #222;
  border-radius: 8px;
  padding: 12px 6px;
  transition: background 0.13s, box-shadow 0.13s;
}
.project-item:hover {
  background: #2d2d2d;
  box-shadow: 0 2px 10px rgba(59,130,246,0.13);
}
.project-thumb img {
  width: 32px; height: 32px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.project-title {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  word-break: break-all;
}
.project-preview-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.project-screenshot {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 8px;
}
.project-preview-title {
  color: #fff;
  font-weight: bold;
  text-align: center;
  font-size: 16px;
}
.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
}
.autocomplete-item:hover {
  background: #eee;
}
    .region-pill {
      display: inline-block;
      background: #f0f0f0;
      margin:2px;
      padding:2px 8px;
      border-radius:8px;
      font-size:13px;
    }
    .region-pill .remove-region {
      margin-left:5px;
      cursor:pointer;
      color:#d00;
      background: none;
      border: none;
      font-size: 12px;
      transition: color 0.2s ease;
    }
    
    .region-pill .remove-region:hover {
      color: #b91c1c;
    }
    body {
      font-family: 'Segoe UI', sans-serif;
      background: #f4f6f8;
      margin: 0;
      padding: 0;
    }
    header {
      background: #111827;
      color: white;
      padding: 16px 32px;
      font-size: 20px;
      font-weight: bold;
    }
    .dashboard {
      max-width: 1100px;
      margin: 32px auto;
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: 24px;
    }
    .sidebar {
      background: #fff;
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .sidebar h3 {
      margin-top: 0;
      font-size: 18px;
    }
    .content {
      background: #fff;
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .section {
      margin-bottom: 32px;
    }
    .section h4 {
      margin-bottom: 8px;
      font-size: 16px;
    }
    input[type="text"], input[type="email"], input[type="password"] {
      width: 100%;
      padding: 10px;
      margin-bottom: 12px;
      border: 1px solid #ddd;
      border-radius: 6px;
      font-size: 14px;
    }
    button {
      background: #3b82f6;
      color: white;
      padding: 10px 18px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    button:hover {
      background: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    button:active {
      transform: translateY(0);
    }
    .balance {
      font-size: 24px;
      font-weight: bold;
      color: #16a34a;
    }
    
    /* Дополнительные стили для кнопок */
    .btn-group {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    
    .btn-group .btn {
      margin: 0;
    }
    
    /* Стили для кнопок в таблицах */
    .table-actions .btn {
      padding: 6px 12px;
      font-size: 13px;
      margin: 2px;
    }
    
    /* Стили для кнопок в карточках */
    .card-actions .btn {
      margin: 5px 10px 5px 0;
    }

    /* Стили для заголовков таблицы с подзаголовками */
    .th-with-sub {
      position: relative;
    }

    .th-main {
      font-weight: bold;
      margin-bottom: 4px;
    }

    .th-sub {
      font-size: 11px;
      color: #666;
      font-weight: normal;
      line-height: 1.2;
    }

    /* Стили для кнопок переключения вида */
    .view-toggle-btn {
      background: #f3f4f6;
      border: 1px solid #d1d5db;
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 500;
      color: #000;
      transition: all 0.2s ease;
    }

    .view-toggle-btn:hover {
      background: #e5e7eb;
      border-color: #9ca3af;
    }

    .view-toggle-btn.active {
      background: #3b82f6;
      color: white;
      border-color: #3b82f6;
    }

    /* Стили для метрик в таблице */
    .metric-cell {
      font-weight: bold;
      text-align: center;
    }

    .metric-green {
      background-color: #dcfce7;
      color: #166534;
    }

    .metric-yellow {
      background-color: #fef3c7;
      color: #92400e;
    }

    .metric-orange {
      background-color: #fed7aa;
      color: #c2410c;
    }

    .metric-blue {
      background-color: #dbeafe;
      color: #1e40af;
    }

    .metric-red {
      background-color: #fee2e2;
      color: #991b1b;
    }

    /* Стили для сортируемых заголовков */
    .sortable-date {
      transition: background-color 0.2s ease;
    }

    .sortable-date:hover {
      background-color: #f3f4f6;
    }

    /* Стили для информационных блоков */
    .info-block {
      border: 2px solid grey;
      padding: 10px;
      position: relative;
      border-radius: 6px;
    }

    .info-block .info-title {
      position: absolute;
      top: 10px;
      font-size: 16px;
      font-weight: bold;
      color: grey;
      font-style: italic;
      background-color: #f9f9f9;
      padding: 5px 10px;
      transform: translateY(-28px);
      border-radius: 4px;
    }

    /* Стили для чекбоксов ТОП-позиций */
    .topband-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }

    .topband-controls label {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: #374151;
      cursor: pointer;
      user-select: none;
    }

    .topband-controls input[type="checkbox"] {
      margin-right: 6px;
      width: 16px;
      height: 16px;
      cursor: pointer;
    }

    /* Стили для селекта количества элементов */
    #pageSizeSelect {
      padding: 6px 10px;
      border: 1px solid #d1d5db;
      border-radius: 6px;
      background-color: white;
      font-size: 14px;
      color: #374151;
      cursor: pointer;
      transition: border-color 0.2s ease;
    }

    #pageSizeSelect:hover {
      border-color: #9ca3af;
    }

    #pageSizeSelect:focus {
      outline: none;
      border-color: #3b82f6;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }