/*
 * ============================================
 * 🎨 DESIGN SYSTEM v1.0 — ПУТЕВЫЕ ЛИСТЫ
 * ============================================
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================
   🎨 CSS ПЕРЕМЕННЫЕ — СВЕТЛАЯ ТЕМА
   ============================================ */
:root {
    --bg-primary: #f4f7f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-info: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --border-radius-sm: 6px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 25px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   🌙 ТЁМНАЯ ТЕМА
   ============================================ */
:root[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #1f2940;
    --text-primary: #eaeaea;
    --text-secondary: #b0b0b0;
    --text-muted: #6b6b6b;
    --border-color: #2d2d44;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #4a4e69 0%, #5a5a7a 100%);
    --gradient-success: linear-gradient(135deg, #0d7377 0%, #14a3a3 100%);
    --gradient-info: linear-gradient(135deg, #1a5f7a 0%, #2d8a9e 100%);
    --gradient-warning: linear-gradient(135deg, #8b3a6f 0%, #a8456c 100%);
    --gradient-danger: linear-gradient(135deg, #8b2834 0%, #a3353a 100%);
}

html[data-theme="dark"] body { background-color: #1a1a2e; }

/* ============================================
   🔄 ГЛОБАЛЬНЫЕ СТИЛИ
   ============================================ */
* {
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   📐 КОНТЕЙНЕР
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   🃏 КАРТОЧКИ
   ============================================ */
.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.card-header {
    padding: 18px 24px;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header.bg-primary { background: var(--gradient-primary); color: white; border: none; }
.card-header.bg-success { background: var(--gradient-success); color: white; border: none; }
.card-header.bg-info { background: var(--gradient-info); color: white; border: none; }
.card-header.bg-danger { background: var(--gradient-danger); color: white; border: none; }
.card-header.bg-warning { background: var(--gradient-warning); color: white; border: none; }

.card-body { padding: 24px; }

/* ============================================
   🔘 КНОПКИ
   ============================================ */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    font-family: inherit;
}

.btn:hover { opacity: 0.9; transform: translateY(-2px); }

.btn-primary { background: var(--gradient-primary); color: white; }
.btn-success { background: var(--gradient-success); color: white; }
.btn-info { background: var(--gradient-info); color: white; }
.btn-danger { background: var(--gradient-danger); color: white; }
.btn-warning { background: var(--gradient-warning); color: white; }
.btn-secondary { 
    background: var(--bg-tertiary); 
    color: var(--text-primary); 
    border: 1px solid var(--border-color);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ============================================
   📊 ТАБЛИЦЫ
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-secondary);
}

.table thead { background: var(--bg-tertiary); }

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr { transition: background 0.2s ease; }
.table tbody tr:hover { background: var(--bg-tertiary); }
.table tbody tr:last-child td { border-bottom: none; }

.table tfoot td, .table tfoot th {
    background: var(--bg-tertiary);
    font-weight: 600;
    padding: 16px;
}

.table-responsive { overflow-x: auto; }

/* ============================================
   📝 ФОРМЫ
   ============================================ */
.form-control, .form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

textarea.form-control { resize: vertical; min-height: 70px; }

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group { margin-bottom: 16px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-col { min-width: 0; }

/* ============================================
   🔔 УВЕДОМЛЕНИЯ
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

:root[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ff8a8a;
    border-color: rgba(239, 68, 68, 0.3);
}
:root[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

/* ============================================
   🎯 НАВИГАЦИЯ
   ============================================ */
.navbar {
    background: var(--gradient-primary) !important;
    padding: 14px 0 !important;
    box-shadow: 0 4px 15px var(--shadow-color);
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-weight: 700;
    font-size: 20px;
    color: white !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white !important;
}

.nav-link.active {
    background: rgba(255,255,255,0.25);
    color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ============================================
   📈 СТАТИСТИКА
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    padding: 22px;
    border-radius: var(--border-radius-lg);
    color: white;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.5s ease;
}

.stat-card:hover::before { transform: scale(1.5); }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); }

.stat-card.primary { background: var(--gradient-primary); }
.stat-card.success { background: var(--gradient-success); }
.stat-card.info { background: var(--gradient-info); }
.stat-card.danger { background: var(--gradient-danger); }
.stat-card.warning { background: var(--gradient-warning); }

.stat-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

/* ============================================
   🏷️ БЕЙДЖИ
   ============================================ */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pill.primary { background: rgba(102, 126, 234, 0.15); color: #667eea; }
.badge-pill.success { background: rgba(17, 153, 142, 0.15); color: #11998e; }
.badge-pill.info { background: rgba(33, 147, 176, 0.15); color: #2193b0; }
.badge-pill.danger { background: rgba(235, 51, 73, 0.15); color: #eb3349; }
.badge-pill.warning { background: rgba(240, 147, 251, 0.15); color: #c73e8a; }

:root[data-theme="dark"] .badge-pill.primary { background: rgba(102, 126, 234, 0.25); color: #a5b4fc; }
:root[data-theme="dark"] .badge-pill.success { background: rgba(17, 153, 142, 0.25); color: #6ee7b7; }
:root[data-theme="dark"] .badge-pill.info { background: rgba(33, 147, 176, 0.25); color: #67e8f9; }
:root[data-theme="dark"] .badge-pill.danger { background: rgba(235, 51, 73, 0.25); color: #fca5a5; }

/* ============================================
   🌙 ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ
   ============================================ */
.theme-toggle {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: inherit;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle .icon { font-size: 18px; }

/* ============================================
   👥 ADMIN GRID
   ============================================ */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.admin-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.admin-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.admin-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-card h3 {
    margin: 8px 0 4px;
    color: var(--text-primary);
    font-size: 16px;
}

.admin-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ============================================
   📊 BAR CHART (простой график на CSS)
   ============================================ */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    height: 220px;
    padding: 20px 10px 0;
    border-bottom: 2px solid var(--border-color);
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    position: relative;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: var(--gradient-info);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.bar:hover {
    background: var(--gradient-primary);
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   📊 PROGRESS BAR
   ============================================ */
.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: 20px;
    height: 24px;
    overflow: hidden;
    min-width: 120px;
}

.progress-bar {
    background: var(--gradient-success);
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    transition: width 0.5s ease;
    white-space: nowrap;
}

/* ============================================
   🎯 ACTIONS CELL
   ============================================ */
.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================
   🪟 MODAL WINDOWS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-small { max-width: 450px; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gradient-danger);
    color: white;
    border-color: transparent;
    transform: rotate(90deg);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   🔐 LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px var(--shadow-color);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.login-header {
    background: var(--gradient-primary);
    padding: 32px 24px;
    text-align: center;
    color: white;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.login-header h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
}

.login-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.login-card form {
    padding: 28px 24px;
}

/* ============================================
   📱 АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    
    .navbar { padding: 10px 0 !important; }
    .navbar-nav { flex-direction: column; align-items: stretch; width: 100%; }
    .nav-link { padding: 10px !important; }
    
    .stat-card-content { gap: 14px; }
    .stat-icon { width: 48px; height: 48px; font-size: 22px; }
    .stat-value { font-size: 22px; }
    
    .theme-toggle { bottom: 20px; right: 20px; padding: 8px 14px; }
    
    .modal-content { padding: 20px; }
    .modal-actions { flex-direction: column; }
    
    .actions-cell { flex-direction: column; align-items: stretch; }
    .actions-cell .btn { width: 100%; justify-content: center; }
    
    .bar-chart { height: 160px; }
    .bar-value { font-size: 9px; }
    .bar-label { font-size: 9px; }
}

/* ============================================
   ⏳ АНИМАЦИИ
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease; }

/* ============================================
   🖨️ ПЕЧАТЬ
   ============================================ */
@media print {
    body { background: white; color: black; }
    .navbar, .theme-toggle, .btn, .modal { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .stat-card { color: black !important; background: #f0f0f0 !important; }
}

/* ============================================
   📈 LINE CHART (SVG)
   ============================================ */
.line-chart-container {
  display: flex;
  gap: 12px;
  height: 340px;
  margin: 20px 0;
}

.line-chart-container .chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 8px 30px 0;
  min-width: 70px;
  text-align: right;
}

.line-chart-container .y-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1;
}

.line-chart-area {
  flex: 1;
  position: relative;
  min-width: 0;
  border-left: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
}

.line-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.chart-point-group {
  cursor: pointer;
}

.chart-point {
  transition: all 0.2s ease;
}

.chart-point-group:hover .chart-point {
  r: 6;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(33, 147, 176, 0.6));
}

.chart-point-group:hover .hover-line {
  opacity: 0.4 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
  .line-chart-container {
    height: 260px;
  }
  
  .line-chart-container .chart-y-axis {
    min-width: 50px;
  }
  
  .line-chart-container .y-label {
    font-size: 9px;
  }
}

/* ============================================
   📸 PHOTO UPLOAD & GALLERY
   ============================================ */
.photo-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-tertiary);
}

.photo-upload-zone:hover,
.photo-upload-zone.dragover {
  border-color: #2193b0;
  background: rgba(33, 147, 176, 0.05);
}

.photo-upload-zone .upload-placeholder {
  padding: 10px;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 10px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-preview-size {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* === Галерея === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: white;
  padding: 20px 10px 8px;
}

.gallery-item-name {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.gallery-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  opacity: 0.9;
}

.gallery-item-meta .btn-sm {
  padding: 2px 8px;
  font-size: 10px;
}

/* === Лайтбокс === */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--border-radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: var(--gradient-danger);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

/* === Адаптивность === */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

/* ============================================
   🖼️ PHOTO THUMBNAILS IN TABLES
   ============================================ */
.photo-thumbnail-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.photo-thumbnail-wrapper:hover {
  transform: scale(1.1);
}

.photo-thumbnail-wrapper:hover .photo-thumbnail {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.photo-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.photo-count-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--gradient-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--bg-secondary);
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Адаптивность */
@media (max-width: 768px) {
  .photo-thumbnail {
    width: 40px;
    height: 40px;
  }
  
  .photo-count-badge {
    font-size: 9px;
    padding: 1px 5px;
  }
}

/* ============================================
   📸 EDIT TRIP PHOTOS
   ============================================ */
.edit-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.edit-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.edit-photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.edit-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--gradient-danger);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
  opacity: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.edit-photo-item:hover .edit-photo-delete {
  opacity: 1;
}

.edit-photo-delete:hover {
  transform: scale(1.15) rotate(90deg);
}

.edit-photo-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 10px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .edit-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
  }
}
