/* Estilo do Widget MyTCalendarGrid - Visão Mensal com Navegação e Visão Anual (4x3) */

.calendar-grid-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 0 auto 16px auto;
    max-width: 1000px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cal-header {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
}

.cal-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.cal-nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.cal-nav-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-day {
    height: 56px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.cal-day.cal-empty {
    opacity: 0.15;
    border: none;
    background: transparent;
    cursor: default;
}

.cal-day:not(.cal-empty):hover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.cal-day.cal-today {
    border: 2px solid #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.cal-day-number {
    font-size: 12px;
    font-weight: 600;
}

.cal-dots {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.cal-dot, .cal-square-marker {
    width: 10px !important;
    height: 10px !important;
    border-radius: 4px !important; /* Quadradinho grande e proeminente */
    display: inline-block !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    transition: transform 0.15s ease !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.cal-dot:hover, .cal-square-marker:hover {
    transform: scale(1.25) !important;
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}

/* REGRA DE IMPRESSÃO LIMPA (A4) DO CALENDÁRIO COMPLETO COM CORES PRESERVADAS */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    body * {
        visibility: hidden !important;
    }
    .calendar-grid-container,
    .calendar-grid-container * {
        visibility: visible !important;
    }
    .calendar-grid-container {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        padding: 5px !important;
        background: #ffffff !important;
    }
    .cal-nav-btn, .btn, .no-print, .btn-print-cal, .twindow-header {
        display: none !important;
    }
    .cal-year-grid-4x3 {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    .cal-month-card-mini {
        border: 1.5px solid #94a3b8 !important;
        break-inside: avoid !important;
        background: #ffffff !important;
    }
    .cal-dot {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border: 1px solid rgba(0,0,0,0.15) !important;
    }
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* =========================================================================
   VISÃO PANORÂMICA DO ANO TODO (GRADE 4x3 DE 12 MESES NO DESKTOP)
   ========================================================================= */

.cal-year-grid-4x3 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 colunas por 3 linhas de meses no desktop */
    gap: 12px;
    margin-top: 14px;
}

@media (max-width: 1200px) {
    .cal-year-grid-4x3 {
        grid-template-columns: repeat(3, 1fr); /* 3 colunas em notebooks */
    }
}

@media (max-width: 768px) {
    .cal-year-grid-4x3 {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas em tablets */
    }
}

@media (max-width: 480px) {
    .cal-year-grid-4x3 {
        grid-template-columns: repeat(1, 1fr); /* 1 coluna em celulares */
    }
}

.cal-month-card-mini {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.15s, border-color 0.15s;
}

.cal-month-card-mini:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.cal-mini-title {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid #f1f5f9;
}

.cal-grid-mini {
    gap: 2px;
}

.cal-day-mini {
    height: 26px;
    border-radius: 3px;
    font-size: 9px;
}

.cal-day-mini .cal-day-number {
    font-size: 9px;
}

.cal-day-mini .cal-dot {
    width: 4px;
    height: 4px;
    margin-top: 1px;
}

/* =========================================================================
   ESTILOS DE ADAPTAÇÃO TOTAL PARA TELAS MOBILE E TABLETS (< 768px)
   ========================================================================= */

.cal-top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.cal-top-toolbar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    /* Ajuste da Janela TWindow do Adianti em telas pequenas */
    .twindow {
        width: 98% !important;
        left: 1% !important;
        top: 1% !important;
        max-width: 100% !important;
    }
    .twindow-content {
        padding: 8px !important;
    }

    /* Toolbar Superior no Mobile */
    .cal-top-toolbar {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
        padding: 10px !important;
        text-align: center !important;
    }
    .cal-top-toolbar-actions {
        justify-content: center !important;
        width: 100% !important;
    }
    .cal-top-toolbar-actions .btn {
        flex: 1 1 auto !important;
        font-size: 11px !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }

    /* Container do Calendário */
    .calendar-grid-container {
        padding: 8px !important;
        border-radius: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Navegação do Mês */
    .cal-nav-header {
        padding: 4px 0 !important;
    }
    .cal-nav-title {
        font-size: 14px !important;
    }
    .cal-nav-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .cal-nav-btn.btn-print-cal {
        display: none !important; /* Esconde o botão repetido no cabeçalho do mês em telas menores */
    }

    /* Grade dos Dias no Mobile */
    .cal-grid {
        gap: 3px !important;
    }
    .cal-day-header {
        font-size: 10px !important;
        padding: 4px 0 !important;
    }
    .cal-day {
        min-height: 42px !important;
        height: auto !important;
        padding: 2px !important;
        border-radius: 6px !important;
    }
    .cal-day-number {
        font-size: 11px !important;
    }
    .cal-dots {
        gap: 2px !important;
        margin-top: 2px !important;
    }
    .cal-dot, .cal-square-marker {
        width: 10px !important;
        height: 10px !important;
        border-radius: 3px !important;
    }

    /* Legenda de Cores no Mobile */
    .cal-legend {
        gap: 8px !important;
        padding-top: 8px !important;
        font-size: 11px !important;
    }
    .cal-legend-item {
        font-size: 11px !important;
    }
}