* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.login-container .card {
    width: 100%;
    max-width: 400px;
}

h1 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

h3 {
    color: #555;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.btn-delete {
    background: #ff4757;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
}

.btn-delete:hover {
    background: #ff3838;
}

.error {
    background: #ff4757;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success {
    background: #00d25b;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.info {
    margin-top: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

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

.user-info {
    font-size: 16px;
    color: #666;
}

.logout {
    color: #ff4757;
    text-decoration: none;
    margin-left: 15px;
    font-weight: 600;
}

.logout:hover {
    text-decoration: underline;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

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

.readings-table {
    width: 100%;
    border-collapse: collapse;
}

.readings-table th,
.readings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.readings-table th {
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
}

.readings-table tr:hover {
    background: #f8f9fa;
}

.systolic {
    font-weight: bold;
    color: #ff6b6b;
}

.diastolic {
    font-weight: bold;
    color: #4ecdc4;
}

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-card li:last-child {
    border-bottom: none;
}

.btn-export {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
    transition: background 0.3s;
}

.btn-export:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Группа кнопок в header */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

/* Стили для карточки графиков */
.charts-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-filter select {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.chart-filter select:hover {
    border-color: #667eea;
}

.chart-types {
    display: flex;
    gap: 10px;
}

.chart-type-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.chart-type-btn:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.chart-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.chart-container {
    position: relative;
    height: 600px;
    margin: 20px 0;
}

.chart-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.chart-stat-item {
    text-align: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-width: 150px;
}

.chart-stat-item .stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.chart-stat-item .stat-value {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* Адаптивность для графиков */
@media (max-width: 768px) {
    .chart-container {
        height: 600px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chart-types {
        justify-content: center;
    }
    
    .chart-stat-item {
        min-width: 120px;
        padding: 8px 15px;
    }
    
    .chart-stat-item .stat-value {
        font-size: 16px;
    }
}

/* Анимации для графиков */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.charts-card {
    animation: fadeIn 0.5s ease-out;
}

/* Дополнительные стили для тултипов */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
}

/* Зоны нормы на графике (опционально) */
.normal-zone {
    background: rgba(76, 175, 80, 0.1);
    position: absolute;
    pointer-events: none;
}
