/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1e2a38;
    --sidebar-text: #a8b5c4;
    --sidebar-active-bg: #2d3f52;
    --sidebar-active-text: #ffffff;
    --sidebar-hover-bg: #263547;
    --topbar-height: 56px;
    --accent: #4e8ef7;
  }
  
  /* ===== RESET ===== */
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    overflow-x: hidden;
  }
  
  /* ===== SIDEBAR ===== */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: transform 0.25s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  #sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  
  .sidebar-logo {
    font-size: 1.4rem;
    color: var(--accent);
  }
  
  .sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
  }
  
  .sidebar-nav {
    padding: 8px 0;
    margin: 0;
  }
  
  .nav-section-label {
    padding: 14px 20px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(168, 181, 196, 0.5);
  }
  
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
  }
  
  .sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #ffffff;
  }
  
  .sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left: 3px solid var(--accent);
  }
  
  .sidebar-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
  }
  
  .sidebar-footer {
    padding: 12px 20px;
    font-size: 0.75rem;
    color: rgba(168, 181, 196, 0.4);
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  
  /* ===== MAIN WRAPPER ===== */
  #main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
  }
  
  #main-wrapper.expanded {
    margin-left: 0;
  }
  
  /* ===== TOPBAR ===== */
  #topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  
  #topbar h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
  }
  
  /* ===== PAGE CONTENT ===== */
  #page-content {
    flex: 1;
    padding: 24px;
  }
  
  #app {
    min-height: calc(100vh - var(--topbar-height) - 48px);
  }
  
  /* ===== КАРТОЧКИ ===== */
  .card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  
  .card-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    padding: 14px 20px;
  }
  
  /* ===== ТАБЛИЦЫ ===== */
  .table {
    font-size: 0.9rem;
  }
  
  .table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #718096;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 16px;
    white-space: nowrap;
  }
  
  .table tbody td {
    padding: 10px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
  }
  
  .table tbody tr:hover {
    background: #f7fafc;
    cursor: pointer;
  }
  
  .table tbody tr:last-child td {
    border-bottom: none;
  }
  
  /* ===== БЕЙДЖИ СТАТУСОВ ===== */
  .badge-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
  }
  
  .status-active    { background: #c6f6d5; color: #276749; }
  .status-pending   { background: #fefcbf; color: #744210; }
  .status-expired   { background: #fed7d7; color: #742a2a; }
  .status-finished  { background: #e2e8f0; color: #4a5568; }
  .status-frozen    { background: #bee3f8; color: #2a4365; }
  .status-debt      { background: #fbd38d; color: #7b341e; }
  
  /* ===== ПОИСК ===== */
  .search-bar {
    position: relative;
  }
  
  .search-bar input {
    padding-left: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
  }
  
  .search-bar input:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(78, 142, 247, 0.15);
  }
  
  .search-bar .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
  }
  
  /* ===== КНОПКИ ===== */
  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
  }
  
  .btn-primary:hover {
    background: #3a7ef0;
    border-color: #3a7ef0;
  }
  
  /* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
  }
  
  .empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
  }
  
  .empty-state p {
    font-size: 0.95rem;
    margin: 0;
  }
  
  /* ===== СТАТИСТИЧЕСКИЕ ПЛИТКИ ===== */
  .stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  
  .stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a202c;
  }
  
  .stat-card .stat-label {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 2px;
  }
  
  .stat-card .stat-icon {
    font-size: 1.6rem;
    opacity: 0.15;
  }
  
  /* ===== АДАПТИВ ===== */
  @media (max-width: 768px) {
    #sidebar {
      transform: translateX(calc(-1 * var(--sidebar-width)));
    }
  
    #sidebar.mobile-open {
      transform: translateX(0);
    }
  
    #main-wrapper {
      margin-left: 0;
    }
  }

  /* ===== ОТЧЁТЫ ===== */

.reports-page .nav-tabs {
  border-bottom: 2px solid #e2e8f0;
}

.reports-page .nav-tabs .nav-link {
  color: #718096;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.reports-page .nav-tabs .nav-link:hover {
  color: #2d3748;
  border-bottom-color: #cbd5e0;
}

.reports-page .nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
  background: transparent;
}

.reports-page .nav-pills .nav-link {
  font-size: 0.85rem;
  color: #718096;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  margin-right: 6px;
}

.reports-page .nav-pills .nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== ПЕЧАТЬ ===== */

@media print {
  /* Скрываем всё лишнее */
  #sidebar,
  #topbar,
  #sidebar-toggle,
  .btn,
  .nav-tabs,
  .nav-pills,
  .card.mb-4:has(#rem-days),  /* панели фильтров */
  .accordion-button,
  .toast-container {
    display: none !important;
  }

  /* Разворачиваем все аккордеоны */
  .accordion-collapse {
    display: block !important;
  }

  /* Основной контент на всю ширину */
  #main-wrapper {
    margin-left: 0 !important;
  }

  #page-content {
    padding: 0 !important;
  }

  body {
    background: #fff !important;
    font-size: 12px;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  /* Таблицы — аккуратнее на печати */
  .table {
    font-size: 11px;
  }

  /* Разрыв страницы перед каждым большим блоком */
  .accordion-item {
    page-break-inside: avoid;
  }

  /* Убираем цветные фоны строк для экономии чернил */
  .table-danger,
  .table-warning,
  .table-success {
    background: transparent !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ========================================================== */
/* === [FEEDBACK] Стили — удалить после внедрения =========== */
/* ========================================================== */

/* Плавающая кнопка фидбека */
#feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1060;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Статусы фидбеков (для страницы feedback-board) */
.fb-status-new          { background: #dbeafe; color: #1e40af; }
.fb-status-clarification{ background: #fef9c3; color: #854d0e; }
.fb-status-in_progress  { background: #e0e7ff; color: #3730a3; }
.fb-status-done         { background: #dcfce7; color: #166534; }
.fb-status-backlog      { background: #f1f5f9; color: #475569; }

.fb-priority-high        { color: #dc2626; font-weight: 600; }
.fb-priority-medium      { color: #d97706; }
.fb-priority-low         { color: #16a34a; }
.fb-priority-nice_to_have{ color: #6b7280; }

/* ========================================================== */
/* === [/FEEDBACK] ========================================== */
/* ========================================================== */