/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Auth */
.auth-container {
    max-width: 420px;
    margin: 24px auto;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.auth-form .form-group {
    margin-bottom: 12px;
}
.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.auth-form .form-actions {
    display: flex;
    justify-content: flex-end;
}
.error {
    color: #c62828;
    margin-top: 10px;
}

/* API viewer */
.api-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.api-controls input {
    min-width: 360px;
}
#swagger-ui {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#app {
    display: flex;
    min-height: 100vh;
}

/* Навигация */
.navbar {
    width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.navbar.hidden {
    display: none;
}

.nav-brand {
    display: flex;
    align-items: center;
    padding: 0 20px 30px;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    border-left-color: #fff;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    border-left-color: #fff;
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e8ed;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    display: flex;
    align-items: center;
}

.page-header h1 i {
    margin-right: 15px;
    color: #667eea;
}

.page-header p {
    color: #7f8c8d;
    margin-top: 5px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-content h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Таблицы */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #bdc3c7;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Активность */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-activity h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.activity-item i {
    margin-right: 15px;
    color: #667eea;
    font-size: 1.1rem;
}

.activity-item span {
    flex: 1;
    color: #495057;
}

.activity-item small {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Статусы */
.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

/* Календарь */
.calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.month-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    text-align: center;
}

.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.psychologist-selector {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.psychologist-selector label {
    font-weight: 500;
    color: #495057;
}

.psychologist-selector select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

.calendar-grid {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
}

.day-header {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e9ecef;
}

.day-header:last-child {
    border-right: none;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 140px;
}

.calendar-day {
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.other-month {
    background-color: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.calendar-day.has-sessions {
    background-color: #e8f5e8;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.time-slot {
    background: #667eea;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.time-slot.booked {
    background: #dc3545;
    cursor: not-allowed;
}

.time-slot.booked:hover {
    background: #dc3545;
    transform: none;
}

.time-slot.available {
    background: #28a745;
}

.time-slot.available:hover {
    background: #218838;
}

.booking-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.booking-info p {
    margin: 5px 0;
    color: #495057;
}

/* Адаптивность */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }
    
    .navbar {
        width: 100%;
        height: auto;
    }
    
    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .nav-link {
        white-space: nowrap;
        min-width: 120px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .psychologist-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .calendar-days {
        grid-auto-rows: 100px;
    }
    
    .time-slots {
        gap: 1px;
    }
    
    .time-slot {
        font-size: 0.6rem;
        padding: 2px 4px;
        min-height: 16px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: fadeIn 0.3s ease;
}

.stat-card {
    animation: fadeIn 0.3s ease;
}

/* Утилиты */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}
