/* Современные стили для проекта Бюджет проектов */

/* Импорт Google Fonts для современной типографики */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS переменные для цветовой схемы */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --secondary-color: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --text-primary: #374151;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

/* Базовые стили */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Улучшенная навигация */
.navbar {
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-color) !important;
  letter-spacing: -0.02em;
}

.nav-link {
  font-weight: 500;
  color: var(--text-secondary) !important;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  margin: 0 0.25rem;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background-color: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(99, 102, 241, 0.1);
  font-weight: 600;
}

/* Улучшенные карточки */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-header h5,
.card-header h6 {
  color: var(--text-primary);
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
  color: var(--text-primary);
}

.card-title {
  color: var(--text-primary);
  font-weight: 600;
}

/* Статистические карточки */
.stat-card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-white);
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 24px;
  flex-shrink: 0;
}

/* Кнопки */
.btn {
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

/* Таблицы */
.table {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table thead th {
  background-color: var(--bg-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 1rem;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--text-primary);
}

.table td strong {
  color: var(--text-primary);
}

.table td a {
  color: var(--text-primary);
}

.table td a:hover {
  color: var(--primary-color);
}

/* Бейджи */
.badge {
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* Формы */
.form-control {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.625rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Футер */
footer {
  background-color: var(--bg-white);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-header {
    padding: 1rem;
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.625rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4, h5, h6 {
    font-size: 1rem;
  }

  .stat-card .card-body {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .table-responsive {
    border-radius: var(--radius-md);
  }

  .table {
    font-size: 0.875rem;
    margin-bottom: 0;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: var(--bg-white);
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid var(--bg-light);
  }

  .table tbody td:last-child {
    border-bottom: none;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
  }

  .row.g-3 > *,
  .row.g-4 > * {
    margin-bottom: 1rem;
  }

  .d-flex.justify-content-between {
    flex-direction: column;
    gap: 1rem;
  }

  .d-flex.justify-content-between > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .d-flex.justify-content-between > div:last-child .btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 576px) {
  .stat-card .card-body {
    padding: 0.875rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .card-header h5 {
    font-size: 1rem;
  }

  .table {
    font-size: 0.8rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .chart-container {
    height: 250px !important;
  }

  .progress-stacked {
    height: 24px;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Улучшенные прогресс-бары */
.progress {
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-light);
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Алерты */
.alert {
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-sm);
}

/* Спиннеры */
.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Улучшенные тени для карточек статистики */
.bg-primary.bg-opacity-10 {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

.bg-success.bg-opacity-10 {
  background-color: rgba(16, 185, 129, 0.1) !important;
}

.bg-danger.bg-opacity-10 {
  background-color: rgba(239, 68, 68, 0.1) !important;
}

.bg-warning.bg-opacity-10 {
  background-color: rgba(245, 158, 11, 0.1) !important;
}

.bg-info.bg-opacity-10 {
  background-color: rgba(59, 130, 246, 0.1) !important;
}

.bg-secondary.bg-opacity-10 {
  background-color: rgba(107, 114, 128, 0.1) !important;
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease-out;
}

/* Улучшенная типографика */
h1 {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-muted {
  color: var(--text-secondary) !important;
}

/* Улучшенные ссылки */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Улучшенные границы */
.border-top {
  border-top: 1px solid var(--border-color) !important;
}

.border-bottom {
  border-bottom: 1px solid var(--border-color) !important;
}

/* Улучшения для навигации на мобильных */
@media (max-width: 991px) {
  .navbar-collapse {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .navbar-nav {
    margin-bottom: 0.5rem;
  }

  .navbar-nav .nav-item {
    margin-bottom: 0.25rem;
  }

  .d-flex.align-items-center {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
  }
}

/* Улучшения для карточек статистики */
.stat-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.stat-card h6 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card small {
  font-size: 0.8rem;
  display: block;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .stat-card h3 {
    font-size: 1.5rem;
  }
  
  .stat-card .d-flex {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .stat-card .d-flex > div:first-child {
    width: 100%;
  }
  
  .stat-icon {
    align-self: flex-start;
  }
}

@media (max-width: 576px) {
  .stat-card h3 {
    font-size: 1.35rem;
  }
  
  .stat-card h6 {
    font-size: 0.65rem;
  }
  
  .stat-card small {
    font-size: 0.75rem;
  }
}

/* Улучшения для графиков на мобильных */
@media (max-width: 768px) {
  .chart-container {
    height: 250px !important;
    margin-bottom: 1.5rem;
  }
}

/* Улучшения для списков и групп */
.list-group-item {
  border-color: var(--border-color);
  padding: 0.75rem 1rem;
}

.list-group-item:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.list-group-item:last-child {
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Улучшения для прогресс-баров */
.progress-stacked {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-stacked .progress-bar {
  border-right: 2px solid var(--bg-white);
}

.progress-stacked .progress-bar:last-child {
  border-right: none;
}

/* Улучшения для форм на мобильных */
@media (max-width: 576px) {
  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .form-control {
    font-size: 1rem; /* Предотвращает зум на iOS */
  }
}

/* Улучшенные цвета для текста */
.text-primary {
  color: var(--primary-color) !important;
}

.text-success {
  color: var(--success-color) !important;
}

.text-danger {
  color: var(--danger-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

.text-info {
  color: var(--info-color) !important;
}

/* Дополнительные улучшения для мобильных устройств */
@media (max-width: 768px) {
  .row.g-3 > [class*="col-"],
  .row.g-4 > [class*="col-"] {
    margin-bottom: 1rem;
  }

  .card.mb-4 {
    margin-bottom: 1.5rem !important;
  }

  .mb-4 {
    margin-bottom: 1.5rem !important;
  }

  .mt-4 {
    margin-top: 1.5rem !important;
  }

  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .px-0 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* Улучшения для очень маленьких экранов */
@media (max-width: 375px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.9rem;
  }

  .stat-card .card-body {
    padding: 0.75rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  h3 {
    font-size: 1rem;
  }
}
