/* Стилі для сторінки аналітики техніків - темна тема */

/* Загальний фон сторінки аналітики - використовуємо глобальний підхід */

/* Основний контейнер */
.main-menu-wrapper {
    background: transparent !important;
}

/* Секції аналітики */
.technicians-section, 
.main-menu-right,
.technician-details-section {
    background: linear-gradient(180deg, rgba(15,22,34,0.85), rgba(11,17,26,0.90)) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
}
.activity-item {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 15px;
    background: linear-gradient(180deg, rgba(15,22,34,0.85), rgba(11,17,26,0.90));
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.activity-item:hover {
    background: linear-gradient(180deg, rgba(24,34,51,0.90), rgba(15,22,34,0.95));
    border-color: rgba(79,156,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.activity-time {
    color: #a9b6c7;
    font-size: 0.9em;
}

.activity-type {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}

.activity-type.user_activity { background: #28a745; }
.activity-type.maintenance { background: #fd7e14; }
.activity-type.shift_change { background: #6f42c1; }
.activity-type.system_event { background: #6c757d; }
.activity-type.task_completion { background: #17a2b8; }

.activity-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #e7edf6;
}

.activity-description {
    color: #a9b6c7;
    line-height: 1.4;
}

.activity-user {
    color: #4f9cff;
    font-size: 0.9em;
    margin-top: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #a9b6c7;
}

.error {
    background: rgba(255,101,118,0.15);
    color: #ff6576;
    border: 1px solid rgba(255,101,118,0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: linear-gradient(180deg, rgba(15,22,34,0.85), rgba(11,17,26,0.90));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #4f9cff;
}

.stat-label {
    color: #a9b6c7;
    font-size: 0.9em;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #a9b6c7;
}

.activity-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Стилі для техніків */
.technicians-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.technician-card {
    background: linear-gradient(180deg, rgba(15,22,34,0.85), rgba(11,17,26,0.90));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.technician-card:hover {
    border-color: rgba(79,156,255,0.5);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(24,34,51,0.90), rgba(15,22,34,0.95));
}

.technician-card.clickable {
    cursor: pointer;
}

.technician-card.non-clickable {
    cursor: default;
    opacity: 0.7;
}

.technician-card.non-clickable:hover {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: none;
}

.technician-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.technician-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.technician-info {
    flex: 1;
}

.technician-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #e7edf6;
}

.technician-role {
    font-size: 14px;
    color: #a9b6c7;
    text-transform: capitalize;
}

.technician-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(15,22,34,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #4f9cff;
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #a9b6c7;
    margin-top: 2px;
}

.technician-status {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
}

.technician-status.inactive {
    background: #dc3545;
}

/* Стилі для детальної аналітики */
.technician-details-section {
    background: linear-gradient(180deg, rgba(15,22,34,0.85), rgba(11,17,26,0.90));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    backdrop-filter: blur(15px);
}

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

.details-card {
    background: rgba(15,22,34,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.details-number {
    font-size: 24px;
    font-weight: bold;
    color: #4f9cff;
    display: block;
}

.details-label {
    font-size: 14px;
    color: #a9b6c7;
    margin-top: 5px;
}

.details-section {
    margin-bottom: 30px;
}

.details-section h3 {
    color: #e7edf6;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

.maintenance-item, .task-item {
    background: rgba(15,22,34,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4f9cff;
    backdrop-filter: blur(5px);
}

.maintenance-item.primary {
    border-left-color: #28a745;
}

.maintenance-item.secondary {
    border-left-color: #ffc107;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.item-title {
    font-weight: bold;
    color: #e7edf6;
}

.item-time {
    font-size: 12px;
    color: #a9b6c7;
}

.item-description {
    color: #a9b6c7;
    font-size: 14px;
    line-height: 1.4;
}

.duration-badge {
    background: rgba(79,156,255,0.2);
    border: 1px solid rgba(79,156,255,0.4);
    color: #4f9cff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.completed {
    background: #28a745;
    color: white;
}

.status-badge.pending {
    background: #ffc107;
    color: #212529;
}

.status-badge.in_progress {
    background: #17a2b8;
    color: white;
}
/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .technicians-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .technician-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    
    .details-summary {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .technician-card {
        padding: 15px;
    }
    
    .technician-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .technician-name {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .technician-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) and (min-width: 481px) {
    .technician-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .details-summary {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

/* Покращення анімацій */
.technician-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.technician-card:hover {
    transform: translateY(-4px);
}

.technician-status {
    transition: all 0.3s ease;
}

/* Покращення читабельності */
.item-description {
    line-height: 1.5;
}

.maintenance-item, .task-item {
    transition: background-color 0.2s ease;
}

.maintenance-item:hover, .task-item:hover {
    background-color: rgba(24,34,51,0.8);
    border-color: rgba(79,156,255,0.3);
}

/* Стилі для завантаження */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #a9b6c7;
    font-size: 16px;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top: 2px solid #4f9cff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Покращення кольорової схеми */
.technician-card.clickable:hover {
    border-color: rgba(79,156,255,0.7);
    box-shadow: 0 6px 16px rgba(79,156,255,0.15);
}

.details-card {
    transition: transform 0.2s ease;
}

.details-card:hover {
    transform: translateY(-2px);
}

/* Стилі для пустих станів */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #a9b6c7;
    background: rgba(15,22,34,0.6);
    border-radius: 8px;
    border: 2px dashed rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
}

.no-data small {
    display: block;
    margin-top: 10px;
    font-size: 14px;
    color: #6c7a8a;
}

/* Стилі для помилок */
.error {
    background: rgba(255,101,118,0.15);
    color: #ff6576;
    border: 1px solid rgba(255,101,118,0.3);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    backdrop-filter: blur(5px);
}

/* Покращення типографії */
.technician-name {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.details-number {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.item-title {
    font-weight: 600;
    color: #e7edf6;
}

/* Стилі для бейджів */
.duration-badge, .status-badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 11px;
}

.duration-badge.pending {
    background: rgba(108,117,125,0.2);
    border: 1px solid rgba(108,117,125,0.4);
    color: #6c757d;
    font-weight: 600;
}

/* Стилі для списку об'єктів */
.objects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Прокручуваний список у деталях, щоб сторінка не «росла» надто довго */
.technician-details-section .objects-list {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 6px; /* невеликий відступ під скролбар */
    overscroll-behavior: contain;
}

/* Кастомізація скролбара для списку */
.technician-details-section .objects-list::-webkit-scrollbar {
    width: 8px;
}
.technician-details-section .objects-list::-webkit-scrollbar-thumb {
    background: rgba(79,156,255,0.35);
    border-radius: 8px;
}
.technician-details-section .objects-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.maintenance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.maintenance-status {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #a9b6c7;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.maintenance-item.primary .maintenance-status {
    background: rgba(40,167,69,0.2);
    border: 1px solid rgba(40,167,69,0.4);
    color: #28a745;
    font-weight: 600;
}

.maintenance-item.secondary .maintenance-status {
    background: rgba(255,193,7,0.2);
    border: 1px solid rgba(255,193,7,0.4);
    color: #ffc107;
    font-weight: 600;
}

.maintenance-description {
    font-size: 14px;
    color: #a9b6c7;
    line-height: 1.4;
}

/* Стилі для загального списку об'єктів */
.objects-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.object-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.object-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.object-number {
    font-weight: bold;
    color: #007bff;
    min-width: 60px;
}

.object-name {
    color: #333;
    flex: 1;
}

.object-time {
    color: #6c757d;
    font-size: 14px;
    min-width: 150px;
}

.object-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.role-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.primary {
    background: #d4edda;
    color: #155724;
}

.role-badge.secondary {
    background: #fff3cd;
    color: #856404;
}

@media (max-width: 768px) {
    .object-summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .object-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
    }
    
    .object-time {
        min-width: auto;
    }
    
    .object-badges {
        align-self: flex-end;
    }
}

/* Покращення контрасту */
.technician-role {
    font-weight: 500;
}

.stat-label, .details-label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Стилі для кнопок та селектів */
#detailsMonthSelector {
    padding: 8px 12px !important;
    background: rgba(15,22,34,0.8) !important;
    color: #e7edf6 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    font-size: 14px;
    line-height: 1.4;
    caret-color: #e7edf6 !important;
    -webkit-text-fill-color: #e7edf6 !important; /* фикс видимости текста на WebKit */
    text-shadow: none !important;
}

#detailsMonthSelector option {
    background: rgba(15,22,34,0.95) !important;
    color: #e7edf6 !important;
}

button[onclick="loadTechniciansAnalytics()"] {
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #4f9cff, #7b61ff) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

button[onclick="loadTechniciansAnalytics()"]:hover {
    background: linear-gradient(135deg, #5ba3ff, #8a6fff) !important;
    transform: translateY(-1px);
}

button[onclick="closeTechnicianDetails()"] {
    padding: 8px 16px !important;
    background: rgba(108,117,125,0.8) !important;
    color: #e7edf6 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

button[onclick="closeTechnicianDetails()"]:hover {
    background: rgba(108,117,125,1) !important;
    transform: translateY(-1px);
}

button[onclick="loadUserActivity()"] {
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #35d09f, #28a745) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

button[onclick="loadUserActivity()"]:hover {
    background: linear-gradient(135deg, #4dd4a8, #34ce57) !important;
    transform: translateY(-1px);
}

/* Стилі для заголовків */
h2 {
    color: #e7edf6 !important;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Стилі для тексту "Немає даних" */
.technician-details-section div:contains("Немає даних"),
div[style*="color: #666"]:contains("Немає даних"),
div:contains("Немає даних за обраний період") {
    color: #a9b6c7 !important;
    background: rgba(15,22,34,0.6) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 8px !important;
    padding: 20px !important;
    text-align: center !important;
    backdrop-filter: blur(5px) !important;
}

/* Загальні стилі для контенту деталей */
#technicianDetailsContent {
    background: transparent !important;
    color: #e7edf6 !important;
}

#technicianDetailsContent div {
    color: #a9b6c7 !important;
}

#technicianDetailsContent small {
    color: #6c7a8a !important;
}

/* Стилі для фокусу (доступність) */
.technician-card.clickable:focus {
    outline: 2px solid #4f9cff;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #4f9cff;
    outline-offset: 2px;
}

select:focus {
    outline: 2px solid #4f9cff;
    outline-offset: 2px;
}

/* Додаткові стилі для центральної області */
.technician-details-section > div {
    background: transparent !important;
}

/* Стилі для всього тексту в деталях */
.technician-details-section * {
    color: #a9b6c7 !important;
}

.technician-details-section h2 {
    color: #e7edf6 !important;
}

/* Стилі для повідомлення про відсутність даних */
.technician-details-section div[style*="text-align: center"],
.technician-details-section div[style*="color: #666"] {
    color: #a9b6c7 !important;
    background: rgba(15,22,34,0.6) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 8px !important;
    padding: 40px 20px !important;
    backdrop-filter: blur(5px) !important;
}

/* Стилі для контейнера активних задач */
#technicianDetailsContent > div {
    background: transparent !important;
    color: #a9b6c7 !important;
}

/* Перевизначення стилів для повідомлення про відсутність даних */
.no-data {
    background: rgba(15,22,34,0.6) !important;
    border: 2px dashed rgba(255,255,255,0.15) !important;
    color: #a9b6c7 !important;
    text-align: center !important;
    padding: 60px 20px !important;
    border-radius: 8px !important;
    backdrop-filter: blur(5px) !important;
    margin: 20px 0 !important;
}

.no-data small {
    color: #6c7a8a !important;
    display: block !important;
    margin-top: 10px !important;
    font-size: 14px !important;
}

/* Загальні стилі для всіх div в деталях техніка */
.technician-details-section div:not(.details-summary):not(.details-card):not(.maintenance-item):not(.task-item) {
    color: #a9b6c7 !important;
}
