/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd8;
    --secondary: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #e9ecef;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Боковое меню */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.logo h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--white);
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    border-left-color: var(--white);
}

.nav-item.logout {
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    background: rgba(0,0,0,0.2);
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}

/* Верхняя панель */
.top-bar {
    background: var(--white);
    padding: 15px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: var(--gray-light);
}

.user-info {
    font-weight: 500;
    color: var(--dark);
}

/* Контент */
.content {
    padding: 25px;
    flex: 1;
}

/* Заголовки */
h1 {
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

h2 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

h3 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Карточки */
.card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--gray-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Кнопки */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    line-height: 1;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-top: 10px;
}

/* Сетка действий */
.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Список приемов */
.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appointment-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    gap: 15px;
    flex-wrap: wrap;
}

.appointment-item .time {
    font-weight: bold;
    color: var(--primary);
    min-width: 60px;
}

.appointment-item .patient {
    flex: 1;
    font-weight: 500;
}

.appointment-item .doctor {
    color: var(--gray);
}

/* Вкладки */
.tabs {
    display: flex;
    background: var(--white);
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 120px;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-btn:hover:not(.active) {
    background: var(--gray-light);
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Поиск */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid var(--gray-light);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Список задач */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    border-left: 4px solid var(--primary);
}

.task-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.task-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Индикаторы статусов */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-new { 
    background: #fff3cd; 
    color: #856404; 
    border: 1px solid #ffeaa7;
}

.status-active { 
    background: #cce7ff; 
    color: #004085; 
    border: 1px solid #b3d7ff;
}

.status-completed { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb;
}

.status-problem { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f1b0b7;
}

.status-cancelled { 
    background: #e2e3e5; 
    color: #383d41; 
    border: 1px solid #d6d8db;
}

/* Уведомления */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #ffc107;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
        height: 100vh;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
    
    .appointment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .task-actions {
        flex-direction: column;
    }
    
    .task-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
}