/* ========================================================== */
/* --- 1. CONFIGURAÇÕES BÁSICAS E ESTRUTURA GERAL --- */
/* ========================================================== */

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
}

header {
    background-color: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

main {
    max-width: 1200px;
    margin: 15px auto;
    padding: 20px;
}

/* ========================================================== */
/* --- 2. CONTROLES DO CALENDÁRIO --- */
/* ========================================================== */

.calendar-controls {
    max-width: 1200px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-controls button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calendar-controls button:hover {
    background-color: #218838;
}

/* ========================================================== */
/* --- 3. LAYOUT DO CALENDÁRIO (GRID) --- */
/* ========================================================== */

.weekdays,
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.weekdays span {
    background-color: #e9ecef;
    padding: 10px 5px;
    font-weight: 700;
    border: 1px solid #ddd;
}

.day {
    /*min-height: 100px;*/
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-top: none;
    cursor: pointer;
    text-align: center;
    background-color: #fff;
    transition: background-color 0.2s;
}

.day:hover:not(.empty) {
    background-color: #f0f0f0;
}

.day-number {
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 5px;
    color: #007bff; /* Azul padrão */
    display: block;
}

.empty {
    background-color: #f8f8f8;
    cursor: default;
    border: none;
}

.activity-indicator {
    background-color: #ffc107;
    color: #333;
    font-size: 0.8em;
    padding: 3px 5px;
    border-radius: 3px;
    display: block;
    width: fit-content;
    margin: 2px auto 0 auto;
}

/* ========================================================== */
/* --- 4. CORES DE STATUS DO DIA (CALENDÁRIO) --- */
/* ========================================================== */

/* FUNDO ROSA: Compartilhado por Feriado e Freezing Comerciais */
.day.holiday {
    background-color: #ffebeb;
    border-left: 5px solid #fec0fe;
}

/* NÚMERO VERMELHO: Apenas se for feriado real */
.day.is-holiday-red .day-number {
    color: red !important;
}

/* NÚMERO AZUL: Se for Rosa (holiday) mas NÃO for feriado real (ex: dia 02) */
.day.holiday:not(.is-holiday-red) .day-number {
    color: #007bff;
}

.day.freezing-tbra { 
    background-color: #ffcc99;
    border-left: 5px solid orange;
}

.day.freezing-tbra-release-ngin { 
    background-color: #c9e6f3;
    border-left: 5px solid #0099cc;
}

.day.freezing-b2b-tbra { 
    background-color: #e6e6e6;
    border-left: 5px solid #bfbfbf;
}

.day.general-activity {
    background-color: #d4edda;
    border-left: 5px solid #155724;
}

/* ========================================================== */
/* --- 5. MODAL BASE --- */
/* ========================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    overflow-y: scroll;
}

.modal-content {
    background-color: #fff;
    margin: 5px auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    margin-top: -10px;
}

.close-btn:hover {
    color: #000;
}

.modal-header-controls {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 15px;
    overflow: hidden; 
}

.modal-header-controls h3 {
    margin: 0; 
    margin-right: 15px; 
    word-wrap: break-word;
    flex-grow: 1; 
}

.on-call-modal {
    background-color: #e9f5ff;
    border-left: 5px solid #007bff;
    padding: 10px 12px;
    font-weight: bold;
    border-radius: 6px;
    margin-bottom: 10px;
}

.pdf-clickable {
    cursor: pointer;
    width: 35px;
    flex-shrink: 0; 
}

/* ========================================================== */
/* --- 6. LISTA DE ATIVIDADES NO MODAL --- */
/* ========================================================== */

#activities-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    border: 1px solid #ccc;
    padding: 10px;
    border-left: 5px solid #ccc;
}

.activity-item h4 {
    margin: 0 0 5px 0;
    color: #007bff;
}

.activity-item p {
    margin: 0;
    word-wrap: break-word;
}

.periodicidade-tag {
    color: Black;
    font-size: 0.75em;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: bold;
    border: 1px solid #33333363;
}

/* ========================================================== */
/* --- 7. CORES DE BORDA POR GRUPO/SERVIÇO --- */
/* ========================================================== */

.activity-item.border-engemon-incendio { border-left-color: #92D050 !important; } 
.activity-item.border-engemon-automacao { border-left-color: #E8950E !important; } 

.activity-item.border-group-FREEZING_COMERCIAIS { border-left-color: #fec0fe; }
.activity-item.border-group-TBRA { border-left-color: #FFC000; }
.activity-item.border-group-B2B_TBRA { border-left-color: #BFBFBF; }

.activity-item.border-group-VERTIV_POWER { border-left-color: #FFFF00; }
.activity-item.border-group-VERTIV_COOLING { border-left-color: #92CDDC; }
.activity-item.border-group-CARRIER { border-left-color: #BFBFBF; }
.activity-item.border-group-SOTREQ { border-left-color: #C1B991; }
.activity-item.border-group-ENERG { border-left-color: #E6B8B7; }
.activity-item.border-group-COTEPE { border-left-color: #DEC97C; }
.activity-item.border-group-LG { border-left-color: #883b77; }
.activity-item.border-group-M2E {border-left-color: #856c20;}

.p-FREEZING, .activity-item.border-p-FREEZING { background-color: #fec0fe; border-left-color: #fec0fe; }
.p-MENSAL, .activity-item.border-p-MENSAL { background-color: #da9694; border-left-color: #da9694; }
.p-BIMESTRAL, .activity-item.border-p-BIMESTRAL { background-color: #e26b0a; border-left-color: #e26b0a; }
.p-TRIMESTRAL, .activity-item.border-p-TRIMESTRAL { background-color: #ffff00; border-left-color: #ffff00; }
.p-QUADRIMESTRAL, .activity-item.border-p-QUADRIMESTRAL { background-color: #95b3d7; border-left-color: #95b3d7; }
.p-SEMESTRAL, .activity-item.border-p-SEMESTRAL { background-color: #00b050; border-left-color: #00b050; }
.p-ANUAL, .activity-item.border-p-ANUAL { background-color: #ff0000; color: white; border-left-color: #ff0000; }

/* ========================================================== */
/* --- 8. RESPONSIVIDADE --- */
/* ========================================================== */

@media (max-width: 768px) {
   
    /*.filters-section {flex-flow: column;}*/
    main { margin: 25px; padding: 10px; }
    header h1 { font-size: 1.5em; }
    .calendar-controls { justify-content: space-evenly; gap: 10px; margin-bottom: 10px;}
    .weekdays span { font-size: 0.75em; padding: 5px 2px; }
    .day { min-height: 55px; padding: 2px; font-size: 0.8em; }
    .modal-content { width: 80%; margin: 5% auto; max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 420px) {
    .filters-section {
        flex-flow: column nowrap;
        align-items: right;
    }
}