body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #007bff !important;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 1rem;
    opacity: 0.9;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

.status-offline {
    background-color: #dc3545;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.success-message {
    background: linear-gradient(135deg, #2ed573 0%, #1e90ff 100%);
    color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

.data-table {
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
    cursor: pointer;
}

.filter-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.export-buttons {
    margin-bottom: 20px;
}

.export-buttons .btn {
    margin-right: 10px;
    margin-bottom: 5px;
}

.real-time-indicator {
    display: inline-flex;
    align-items: center;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.real-time-indicator .status-indicator {
    margin-right: 5px;
}

.dashboard-header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: between;
    align-items: center;
}

.dashboard-title {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.last-updated {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Единая высота для карточек с графиками на админ‑дашборде */
.analytics-card-body {
   position: relative;
   height: 260px;           /* общая высота для обоих графиков */
}

.analytics-card-body canvas {
   width: 100% !important;
   height: 100% !important; /* растягиваем график по всей высоте карточки */
}

/* Единая высота для блока User Activity / Recent Activity */
.activity-card-body {
    position: relative;
    height: 180px;
}

.activity-card-body canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    .last-updated {
        margin-top: 10px;
    }

    /* На мобильных даем карточкам авто‑высоту, чтобы не ломать верстку */
    .analytics-card-body,
    .activity-card-body {
        height: auto;
    }
}