/* mobile.css - для экранов шириной менее 768px */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #0f172a;
    min-height: 100vh;
}

.vepas-dashboard {
    width: 100%;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* ===== ОСНОВНАЯ СЕТКА - ВЕРТИКАЛЬНОЕ РАСПОЛОЖЕНИЕ ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
 
/* Все колонки становятся шириной 100% */
.column-1,
.column-2,
.column-3 {
    width: 100%;
}

/* ПОРЯДОК: сначала колонка 1, потом колонка 2, потом колонка 3 */
.column-1 { order: 2; }
.column-2 { order: 1; }
.column-3 { order: 3; }

/* ===== КАРТОЧКИ (базовые стили) ===== */
.card {
    background: #14232e;
    border-radius: 10px;
    padding: 12px;
}

.driver-photo-card {
    position: relative;
    padding: 5px;
}

.reference-photo {
    width: 100%;
    aspect-ratio: 3/4;
    background: #1e3340;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.driver-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}

/* Показатели */
.vital-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #254a5a;
}

.vital-label {
    font-size: 14px;
    color: #8aaec0;
}

.vital-value {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.vital-value.warning {
    background: #a03224;
    padding: 2px 8px;
    border-radius: 8px;
}

.complaint-value.yes {
    background: #a03224;
    color: white;
    padding: 2px 10px;
    border-radius: 8px;
}

.complaint-value.no {
    background: #0a5c3c;
    color: white;
    padding: 2px 10px;
    border-radius: 8px;
}

/* ===== ВИДЕО ===== */
.video-card {
    background: #0a1820;
    border-radius: 10px;
    padding: 5px;
}

.video-container {
    position: relative;
    width: 100%;
    background: #050e14;
    border-radius: 8px;
    overflow: hidden;
}

.video-portrait .video-container {
    aspect-ratio: 4/5;
}

.video-landscape .video-container {
    aspect-ratio: 16/9;
}

.current-frame {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#currentFrame1 {
    transform: rotate(-90deg) scale(1.25);
}

.video-controls {
    position: absolute;
    bottom: 8px;
    left: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
}

.progress-row {
    position: absolute;
    bottom: 50px;
    left: 6px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 15;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #8fc9ff;
}

.frame-counter {
    position: absolute;
    bottom: 55px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #ccc;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    z-index: 10;
}

.play-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 3px;
    color: white;
    font-size: 9px;
}

.speed-control input {
    width: 50px;
}

/* ===== КНОПКИ РЕШЕНИЯ ===== */
.decision-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-accept, .btn-reject {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.btn-accept {
    background: #0a5c3c;
    border: 2px solid #2ecc71;
    color: white;
}

.btn-reject {
    background: #a03224;
    border: 2px solid #ff6b6b;
    color: white;
}

/* ===== ВНУТРЕННИЕ КОЛОНКИ 3 ===== */
.column-3-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.column-3-inner-left,
.column-3-inner-right {
    width: 100%;
}

.avg-stats-card .values {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-align: center;
}

.detail-btn {
    background: #f39c12;
    color: #1e3340;
    border: none;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
}

.history-card {
    display: flex;
    flex-direction: column;
}

.history-card #historyContent {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #1e3340;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 11px;
}

/* ===== ВЫЕЗЖАЮЩАЯ ПАНЕЛЬ ===== */
.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #0f1a24;
    border-left: 2px solid #254a5a;
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.panel-overlay.show {
    display: block;
}

.side-panel-header {
    padding: 12px;
    background: #1e3340;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-panel-header h3 {
    color: white;
    font-size: 14px;
}

.close-panel-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.exam-card {
    background: #1e3340;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 11px;
}

.section-header {
    padding: 6px 8px;
    background: #1e3340;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-header h3 {
    color: white;
    font-size: 12px;
}

.exam-status {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
}

.exam-status.pending {
    background: #e67e22;
    color: white;
}

/* Анимации */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* ===== ТОЛЬКО ДЛЯ МОБИЛЬНЫХ (НЕ ТРОГАЕТ ДЕСКТОП) ===== */
@media (max-width: 767px) {
    
    /* Перестраиваем шапку в 2 строки */
    .vepas-dashboard .header {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 10px !important;
        align-items: center !important;
        padding: 8px 12px !important;
        background: #0b1a24 !important;
    }
    
    /* Логотип - первая строка, слева */
    .vepas-dashboard .logo {
        grid-row: 1 !important;
        grid-column: 1 !important;
        font-size: 20px !important;
        color: #8fc9ff !important;
    }
    
    /* Header-right (статистика + кнопка ≡) - первая строка, справа */
    .vepas-dashboard .header-right {
        grid-row: 1 !important;
        grid-column: 2 !important;
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
    }
    
    /* Статистика очереди */
    .vepas-dashboard .queue-stats {
        background: #1e3340 !important;
        padding: 4px 8px !important;
        border-radius: 8px !important;
        display: flex !important;
        gap: 6px !important;
    }
    
    .vepas-dashboard .queue-count,
    .vepas-dashboard .queue-time {
        color: #f4c542 !important;
        font-size: 12px !important;
        font-weight: bold !important;
    }
    
    /* Кнопка меню ≡ */
    .vepas-dashboard .toggle-panel-btn {
        background: #1e3340 !important;
        border: 1px solid #3d6375 !important;
        border-radius: 8px !important;
        padding: 4px 10px !important;
        font-size: 18px !important;
        color: white !important;
        cursor: pointer !important;
    }
    
    /* doctor-badge (все кнопки + врач) - целиком на вторую строку */
    .vepas-dashboard .doctor-badge {
        grid-row: 2 !important;
        grid-column: 1 / span 2 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
    }
    
    /* Индикатор врача */
    .vepas-dashboard .online-indicator {
        background: #1e3340 !important;
        padding: 6px 10px !important;
        border-radius: 20px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    .vepas-dashboard .online-dot {
        width: 8px !important;
        height: 8px !important;
        background: #2ecc71 !important;
        border-radius: 50% !important;
    }
    
    .vepas-dashboard .online-indicator span:last-child {
        color: white !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }
    
    /* Все кнопки - компактные, квадратные, БЕЗ ТЕКСТА */
    .vepas-dashboard .doctor-badge a button,
    .vepas-dashboard .doctor-badge > button {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        font-size: 0 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        cursor: pointer !important;
    }
     
	/* Кнопка "Скачать приложение" */
	.vepas-dashboard .doctor-badge a[href="/download"] button::before {
		content: "📱" !important;
		font-size: 16px !important;
		display: block !important;
	}

	/* Кнопка "История осмотров" */
	.vepas-dashboard .doctor-badge a[href="/examinations_history"] button::before {
		content: "📋" !important;  /* ← выберите иконку на ваш вкус */
		font-size: 16px !important;
		display: block !important;
	}
    
    .vepas-dashboard .doctor-badge button[onclick="changeCertificate()"]::before {
        content: "🔄" !important;
        font-size: 16px !important;
        display: block !important;
    }
    
    .vepas-dashboard .doctor-badge button[onclick="logout()"]::before {
        content: "🚪" !important;
        font-size: 16px !important;
        display: block !important;
    }
    
    /* Кнопка администратора (только если JS её показал) */
    .vepas-dashboard #adminLink button {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        font-size: 0 !important;
        border-radius: 8px !important;
        background: #1e3340 !important;
        border: 1px solid #4f7a94 !important;
        cursor: pointer !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .vepas-dashboard #adminLink button::before {
        content: "⚙️" !important;
        font-size: 16px !important;
        display: block !important;
    }
    
/* Цвет фона кнопок — все одинаковые */
.vepas-dashboard .doctor-badge a button,
.vepas-dashboard .doctor-badge > button {
    background: #1e3340 !important;
    border: 1px solid #4f7a94 !important;
}

/* Кнопка выхода — отдельный цвет */
.vepas-dashboard .doctor-badge button[onclick="logout()"] {
    background: #a03224 !important;
    border: none !important;
}
    
    .vepas-dashboard .doctor-badge button[onclick="changeCertificate()"] {
        background: #1e3340 !important;
        border: 1px solid #4f7a94 !important;
    }
    
    .vepas-dashboard .doctor-badge button[onclick="logout()"] {
        background: #a03224 !important;
        border: none !important;
    }
    
    /* ===== ЦВЕТА ТЕКСТА ДЛЯ МОБИЛЬНЫХ ===== */
    
    /* Основной текст в карточках */
    .vepas-dashboard .card,
    .vepas-dashboard .card * {
        color: white !important;
    }
    
    /* Заголовки карточек */
    .vepas-dashboard .card-header {
        color: #8fc9ff !important;
    }
    
    /* Текст в показателях */
    .vepas-dashboard .vital-label,
    .vepas-dashboard .vital-value,
    .vepas-dashboard .vital-unit {
        color: white !important;
    }
    
    /* Предупреждения */
    .vepas-dashboard .vital-value.warning {
        background: #a03224 !important;
        color: white !important;
        padding: 2px 8px !important;
        border-radius: 8px !important;
    }
    
    /* Жалобы */
    .vepas-dashboard .complaint-value.yes {
        background: #a03224 !important;
        color: white !important;
    }
    .vepas-dashboard .complaint-value.no {
        background: #0a5c3c !important;
        color: white !important;
    }
    
    /* История осмотров */
    .vepas-dashboard .history-item,
    .vepas-dashboard .history-item * {
        color: white !important;
    }
    
    .vepas-dashboard .history-id {
        color: #8fc9ff !important;
    }
    
    .vepas-dashboard .history-metrics {
        color: #8aaec0 !important;
    }
    
    /* Средние значения */
    .vepas-dashboard .avg-stats-card .values {
        color: white !important;
    }
    
    /* Текст "Выберите осмотр" */
    .vepas-dashboard #driverInfoContent,
    .vepas-dashboard #vitalsContent,
    .vepas-dashboard #decisionContent,
    .vepas-dashboard #historyContent,
    .vepas-dashboard #avgStatsContent {
        color: white !important;
    }
    
    /* Селекты и текстовые поля */
    .vepas-dashboard select,
    .vepas-dashboard textarea,
    .vepas-dashboard input {
        color: white !important;
        background: #1e3340 !important;
        border: 1px solid #3d6375 !important;
    }
    
    /* Текст в очереди и истории (боковая панель) */
    .vepas-dashboard .exam-card,
    .vepas-dashboard .exam-card *,
    .vepas-dashboard .section-header *,
    .vepas-dashboard .driver-name-card {
        color: white !important;
    }
    
    .vepas-dashboard .exam-number {
        color: #8fc9ff !important;
    }
    
    .vepas-dashboard .exam-metrics {
        color: #8aaec0 !important;
    }
    
    /* Время ожидания */
    .vepas-dashboard .exam-card span[style*="color: #f4c542"] {
        color: #f4c542 !important;
    }
    
    /* Кнопка детального анализа */
    .vepas-dashboard .detail-btn {
        color: #1e3340 !important;
        background: #f39c12 !important;
    }
    
    /* Текст в модальных окнах */
    .vepas-dashboard .modal-content,
    .vepas-dashboard .modal-content * {
        color: white !important;
    }
	
	/* Бейдж поверх видео - прозрачный, сверху (мобильная версия) */
	.recognition-badge-overlay {
		position: absolute;
		top: 12px;
		left: 12px;
		z-index: 10;
		
		/* Вообще без фона */
		background: transparent;
		backdrop-filter: none;
		
		/* Только тень для читаемости */
		text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
		
		padding: 0;
		pointer-events: none;
	}
	 
	/* Подсветка активного осмотра в истории (мобильная версия) */
.history-item.active {
    background: #0a5c3c !important;
    border-left: 3px solid #2ecc71;
}
 
.history-item.active .exam-number {
    color: #fff !important;
}

.history-item.active .exam-metrics {
    color: #fff !important;
}
	
/* Мобильные показатели - компактно, с пиктограммами, без текстовых подписей */
.vepas-dashboard .vital-row {
    display: inline-flex !important;
    width: auto !important;
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: center !important;
    gap: 4px !important;
}

.vepas-dashboard .vital-label {
    font-size: 16px !important;
    margin-right: 0 !important;
}

.vepas-dashboard .vital-unit {
    display: none !important;
}

.vepas-dashboard #vitalsContent {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.vepas-dashboard .vital-value {
    font-size: 16px !important;
    font-weight: bold !important;
}

/* Предупреждения */
.vepas-dashboard .vital-value.warning {
    background: #a03224 !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
}

/* Жалобы и аритмия - без фона, только цвет текста */
.vepas-dashboard .complaint-value {
    background: none !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: bold !important;
}
.vepas-dashboard .complaint-value.yes {
    color: #f87171 !important;
}
.vepas-dashboard .complaint-value.no {
    color: #2ecc71 !important;
}

.video-controls {
    background: transparent !important;
    backdrop-filter: none !important;
}

.play-btn, .speed-control, .frame-counter {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}

/* Цвета для блока распознавания */
.recognition-badge-overlay div div:first-child span:last-child {
    color: #f87171 !important;  /* Красный по умолчанию */
}

.recognition-badge-overlay div div:first-child span:last-child[data-value="high"] {
    color: #2ecc71 !important;  /* Зелёный при высоком проценте */
}

}

/* Все кнопки - компактные, квадратные, БЕЗ ТЕКСТА */
.vepas-dashboard .doctor-badge a button,
.vepas-dashboard .doctor-badge > button {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    cursor: pointer !important;
}
 
/* Кнопка "Скачать приложение" */
.vepas-dashboard .doctor-badge a[href="/download"] button::before {
    content: "📱" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка "История осмотров" */
.vepas-dashboard .doctor-badge a[href="/examinations_history"] button::before {
    content: "📋" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка "Сменить сертификат" */
.vepas-dashboard .doctor-badge button[onclick="changeCertificate()"]::before {
    content: "🔄" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка "График осмотров" */
.vepas-dashboard .doctor-badge button[onclick="openTimelineChart()"]::before {
    content: "📊" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка выхода */
.vepas-dashboard .doctor-badge button[onclick="logout()"]::before {
    content: "🚪" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка "График осмотров" — принудительно */
.vepas-dashboard .doctor-badge button[onclick="openTimelineChart()"] {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.vepas-dashboard .doctor-badge button[onclick="openTimelineChart()"]::before {
    content: "📊" !important;
    font-size: 18px !important;
    display: inline-block !important;
}

/* Глобальное правило для кнопки "График осмотров" на мобильных */
@media (max-width: 767px) {
		
    button[onclick="openTimelineChart()"] {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        font-size: 0 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #1e3340 !important;
        border: 1px solid #4f7a94 !important;
    }
    
    button[onclick="openTimelineChart()"]::before {
        content: "📊" !important;
        font-size: 18px !important;
        display: inline-block !important;
    }
}

/* Кнопка ТАБЛО - иконка 📊 */
.vepas-dashboard .doctor-badge a[href="/tablo"] button {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 0 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #1e3340 !important;
    border: 1px solid #4f7a94 !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.vepas-dashboard .doctor-badge a[href="/tablo"] button::before {
    content: "📊" !important;
    font-size: 18px !important;
    display: block !important;
}

/* ===== КНОПКА ТАБЛО — иконка 📺 ===== */
.vepas-dashboard .doctor-badge a[href="/tablo"] button::before {
    content: "📺" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Кнопка "График осмотров" — иконка 📊 (остаётся) */
.vepas-dashboard .doctor-badge button[onclick="openTimelineChart()"]::before {
    content: "📊" !important;
    font-size: 18px !important;
    display: block !important;
}

/* Заглушка для фото водителя */
.placeholder-driver {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #1e3340;
    color: #ffffff; /* ← БЕЛЫЙ ЦВЕТ */
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
}
.placeholder-driver .icon {
    font-size: 48px;
    opacity: 0.5;
    color: #8aaec0; /* ← СВЕТЛО-СИНИЙ ДЛЯ ИКОНКИ */
}
.placeholder-driver .text {
    font-size: 13px;
    opacity: 0.8;
    color: #ffffff; /* ← БЕЛЫЙ ТЕКСТ */
}

/* Заглушка для видео (общая) */
.placeholder-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #0f1a24;
    color: #ffffff; /* ← БЕЛЫЙ ЦВЕТ */
    gap: 12px;
}
.placeholder-video .icon {
    font-size: 56px;
    opacity: 0.4;
    color: #8aaec0; /* ← СВЕТЛО-СИНИЙ ДЛЯ ИКОНКИ */
}
.placeholder-video .title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff; /* ← БЕЛЫЙ ТЕКСТ */
}
.placeholder-video .sub {
    font-size: 12px;
    opacity: 0.6;
    color: #8aaec0; /* ← СВЕТЛО-СИНИЙ ТЕКСТ */
}
