:root{
    --bs-border-color: #ced2d7;
    --bs-text-tertiary: #a8b1bd;
    --calendar-body: #ffffff;/*#f0f2f5*/
    --bs-body-tertiary: var(--calendar-body);/*#f0f2f5*/
    --bs-light-bg-subtle: #f8fafc; /*#fcfcfd*/
    --bs-secondary-color: rgba(33, 37, 41, 0.75);
    --bs-dark-text: #334155;
}

.title-month {
    font-weight: 600;
}

/* Container do Cabeçalho */
#calendar-header-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Esquerda, Centro, Direita */
    align-items: center;
}
#calendar-header-toolbar .toolbar-section-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
#calendar-header-toolbar .toolbar-section-center {
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}
#calendar-header-toolbar .toolbar-section-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* --- CSS (Layout Principal) --- */
#calendar-table {
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-weight: 500;
    padding: 0.5rem 0;
    flex-shrink: 0;
    color: var(--bs-dark-text);
    text-transform: uppercase;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem; /* gap-1 */
    flex-grow: 1;
    height: 100%;
}

/* --- Vistas Específicas (CSS) --- */
.fc-view-month .calendar-body {
    grid-template-rows: repeat(6, 1fr);
    min-height: calc(100px * 6);
}
.fc-view-week .calendar-body {
    grid-template-rows: 1fr;
    min-height: 100px;
}


.calendar-cell {
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
    border-radius: 10px;
    position: relative;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    background-color: var(--calendar-body);
}
.other-month {
    background-color: var(--bs-body-tertiary);
}
.other-month .day-number {
    color: var(--bs-text-tertiary);
}
.calendar-cell:not(.other-month) {
    cursor: pointer;
}
.calendar-cell:not(.other-month):hover {
    background-color: var(--bs-light-bg-subtle);
}
.day-number {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    text-align: right;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    color: var(--bs-dark-text);
    flex-shrink: 0;
}
.today {
    background-color: #F0F9FF !important;
}
.today .day-number {
    font-weight: 500;
    color: var(--bs-dark-text);
}

/* -- Estilos da Vista de Dia e Lista -- */
#day-view-container {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    position: relative;
    border-radius: 10px;
}

.hour-row {
    display: flex;
    border-bottom: 1px dashed var(--bs-border-color);
    background: #ffffff;
}

.hour-label {
    flex: 0 0 70px;
    padding: 8px;
    text-align: right;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    border-right: 1px solid var(--bs-border-color);
}

.hour-content {
    flex-grow: 1;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 50px;
}
.hour-content:hover {
    background-color: var(--bs-light-bg-subtle);
}

/* --- Marcador de Hora Atual --- */
.time-marker {
    position: absolute;
    left: 70px;
    right: 0;
    height: 2px;
    background-color: var(--bs-danger);
    z-index: 10;
    pointer-events: none;
    display: none;
}
.time-marker::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bs-danger);
}

/* -- Estilos de Eventos -- */
.day-content {
    padding: 0 0.25rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}
.fc-view-month .day-content {
    max-height: calc(100px - 30px);
    flex-grow: 0;
}
.event-chip {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: pointer;
}
.event-chip:not(.event-chip-custom) {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background-color: var(--bs-primary);
    color: white;
}
.event-chip:hover {
    opacity: 0.85;
}
.event-chip .bi {
    vertical-align: text-bottom;
}
.event-chip-day {
    margin-bottom: 0.2rem;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-chip-day:not(.event-chip-custom) {
    background-color: var(--bs-success);
    color: white;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}
.event-chip-day:hover {
    opacity: 0.85;
}
.event-chip-day .bi {
    vertical-align: text-bottom;
}

/* Estilos adicionais para a Vista de Lista */
.list-group-item-event {
    transition: background-color 0.2s;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.list-group-item-event:last-child {
    border-bottom: none;
}
.list-group-item-event:hover {
    background-color: #f8fafc;
}
.list-day-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--bs-dark-text);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}