/* Стилі для таблиці подій у звітах */
.main-menu-wrapper{
padding: 10px;
}
.events-report {

    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.dispatcher-info {
    background: rgba(255,255,255,0.06);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.14);
        border-radius: 12px;
        padding: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    border-left: 6px solid #60a5fa;
}

.dispatcher-info strong {
    color: #333;
}

.report-summary {
    margin-bottom: 30px;
}

.report-summary h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.event-type-section {
}

.event-type-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #555;
}

.event-count {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.events-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 15px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
}

.events-table th {
    background: transparent;
    padding: 12px 8px;
    text-align: left;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,0.16);
    font-size: 14px;
    color: #e6f0ff;
}

.events-table td {
    padding: 10px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    vertical-align: top;
    font-size: 13px;
    line-height: 1.4;
    background: transparent;
    color: #dbeafe;
}

.events-table tbody tr:nth-child(even) {
    background: transparent;
}

/* Обмеження ширини стовпців */
.events-table th:nth-child(1),
.events-table td:nth-child(1) {
    max-width: 100px;
    width: 100px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.events-table th:nth-child(2),
.events-table td:nth-child(2) {
    max-width: 200px;
    width: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.events-table th:nth-child(3),
.events-table td:nth-child(3) {
    max-width: 300px;
    width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.events-table th:nth-child(4),
.events-table td:nth-child(4) {
    max-width: 240px;
    width: 220px;
    white-space: nowrap;
    word-wrap: normal;
    overflow-wrap: normal;
}

.events-table th:nth-child(5),
.events-table td:nth-child(5) {
    max-width: 240px;
    width: 220px;
    white-space: nowrap;
    word-wrap: normal;
    overflow-wrap: normal;
}

.events-table th:nth-child(6),
.events-table td:nth-child(6) {
    max-width: 150px;
    width: 150px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Стилі для згортання/розгортання тексту */
.text-expandable {
    position: relative;
}

.text-content {
    display: block;
    line-height: 1.4;
}

.text-content.collapsed {
    max-height: 3.36em; /* ~3 рядки при line-height: 1.4 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.expand-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    margin-top: 2px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.expand-btn:hover {
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.expand-btn .arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.expand-btn.expanded .arrow {
    transform: rotate(180deg);
}

/* Прибрано підсвічування рядків при наведенні */
/* .events-table tbody tr:hover {
    background: #f0f8ff;
} */

/* Кольорове кодування для різних типів подій */
.connection-lost h3 {
    background: transparent;
    color: #ffc107;
    border-left: 4px solid #ffc107;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.fire-alarm h3 {
    background: transparent;
    color: #dc3545;
    border-left: 4px solid #dc3545;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.malfunction h3 {
    background: transparent;
    color: #ffc107;
    border-left: 4px solid #ffc107;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.zone-disabled h3 {
    background: transparent;
    color: #17a2b8;
    border-left: 4px solid #17a2b8;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.no-type h3 {
    background: transparent;
    color: #6c757d;
    border-left: 4px solid #6c757d;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
}

.report-footer {
    margin-top: 30px;
    padding: 20px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: #d1dbeb;
}

.total-events {
    font-size: 18px;
    font-weight: 800;
    color: #9fd4ff;
}

.btn-export {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-export:hover {
    background: #218838;
}

.btn-export:active {
    background: #1e7e34;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .events-report {
        padding: 10px;
    }
    
    .events-table {
        font-size: 12px;
    }
    
    .events-table th,
    .events-table td {
        padding: 8px 4px;
    }
    
    .report-footer {
        flex-direction: column;
        text-align: center;
    }
    
    .dispatcher-info {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .events-table {
        font-size: 11px;
    }
    
    .events-table th,
    .events-table td {
        padding: 6px 3px;
    }
    
    .report-summary h2 {
        font-size: 16px;
        padding: 8px;
    }
}

/* Стилі для завантаження */
.loading-events {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Стилі для порожнього стану */
.no-events {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* Додаткові стилі для фільтрів на сторінці звітів */
/* Основні стилі фільтрів наслідуються з styles.css */

/* Переконуємося, що toast повідомлення працюють правильно */
#toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ——— Яркие категории для секций событий ——— */
/* Базовая обёртка таблицы (на случай, если глобальные стили отсутствуют) */
.event-type-section .event-table{
    overflow: hidden;
    max-height: none;
    transition: max-height .25s ease;
    border-radius: 10px;
}

/* CONNECTION LOST — жёлтая тема */
.event-type-section .event-header.connection-lost,
.event-type-section.connection-lost .event-header{
    border-left: 10px solid #f59e0b;
    background: #ffd500;
    color:#3a2a00;
    box-shadow: 0 8px 20px rgba(245,158,11,.28), 0 3px 10px rgba(245,158,11,.16);
}
.event-type-section .event-header.connection-lost .event-header-title,
.event-type-section.connection-lost .event-header .event-header-title{
    color:#3a2a00;
}
.event-type-section .event-header.connection-lost + .event-table,
.event-type-section.connection-lost .event-table{
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

/* APS TRIGGERED — красная тема */
.event-type-section .event-header.aps-triggered,
.event-type-section.aps-triggered .event-header{
    border-left: 10px solid #ef4444;
    background: #c55353;
    color:#5a0e12;
    box-shadow: 0 8px 20px rgba(239,68,68,.28), 0 3px 10px rgba(239,68,68,.16);
}
.event-type-section .event-header.aps-triggered .event-header-title,
.event-type-section.aps-triggered .event-header .event-header-title{
    color:#4b0b0f;
}
.event-type-section .event-header.aps-triggered + .event-table,
.event-type-section.aps-triggered .event-table{
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

/* MALFUNCTION — оранжевая тема */
.event-type-section .event-header.malfunction,
.event-type-section.malfunction .event-header,
.event-type-section .event-header.faults,
.event-type-section.faults .event-header{
    border-left: 10px solid #24ff9d;
    background: #00ffda;
    color:#4a2c00;
    box-shadow: 0 8px 20px rgba(251,140,0,.24), 0 3px 10px rgba(251,140,0,.14);
}
.event-type-section .event-header.malfunction + .event-table,
.event-type-section.malfunction .event-table,
.event-type-section .event-header.faults + .event-table,
.event-type-section.faults .event-table{
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

/* DISABLED ZONES — синевато-серая тема */
.event-type-section .event-header.disabled-zones,
.event-type-section.disabled-zones .event-header{
    border-left: 10px solid #b8ff65;
    background: #59ff00;
    color:#0b1a21;
    box-shadow: 0 8px 20px rgba(84,110,122,.22), 0 3px 10px rgba(84,110,122,.14);
}
.event-type-section .event-header.disabled-zones + .event-table,
.event-type-section.disabled-zones .event-table{
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

/* NO TYPE — нейтральная подсветка (на всякий случай) */
.event-type-section .event-header.no-type,
.event-type-section.no-type .event-header{
    border-left: 10px solid #9e9e9e;
    background: linear-gradient(120deg, #f4f4f4, #e9ecef 55%, #f5f7fa);
    color:#222;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.event-type-section .event-header.no-type + .event-table,
.event-type-section.no-type .event-table{
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}