/* Toolbar */
.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.fc .fc-toolbar-title {
    font-size: 1.1rem !important;
    font-weight: 600;
}

/* ปุ่มทั่วไป */
.fc .fc-button {
    font-size: 0.8125rem !important;
    font-weight: 500;
    text-transform: none;
    padding: 0.45rem 0.75rem !important;
    border-radius: 0.5rem;
    line-height: 1.25;
    box-shadow: none;
    border: 1px solid rgb(226 232 240);
    background: rgb(255 255 255);
    color: rgb(51 65 85);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fc .fc-button:hover:not(:disabled) {
    background: rgb(248 250 252);
    border-color: rgb(203 213 225);
    color: rgb(15 23 42);
}

.fc .fc-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ปุ่ม "วันนี้" — outline (ไม่ใช้สไตล์เดียวกับมุมมองที่เลือก) */
.fc .fc-today-button.fc-button-primary:not(:disabled) {
    background: rgb(255 255 255) !important;
    color: var(--primary-700, #b45309) !important;
    border: 1px solid color-mix(in srgb, var(--primary-500, #f59e0b) 45%, rgb(226 232 240)) !important;
    box-shadow: none !important;
}

.fc .fc-today-button.fc-button-primary:not(:disabled):hover {
    background: color-mix(in srgb, var(--primary-500, #f59e0b) 8%, white) !important;
    border-color: var(--primary-400, #fbbf24) !important;
    color: var(--primary-800, #92400e) !important;
}

/* เดือน / สัปดาห์ / วัน / ปี ที่เลือกอยู่ — สีเข้ม (ขอบสีเดียวกับพื้นเพื่อให้กลุ่มติดกันสนิท) */
.fc .fc-button-active:not(:disabled) {
    background-color: var(--primary-800, #92400e) !important;
    border-color: var(--primary-800, #92400e) !important;
    color: rgb(255 255 255) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.fc .fc-button-active:not(:disabled):hover {
    background-color: var(--primary-900, #78350f) !important;
    border-color: var(--primary-900, #78350f) !important;
    color: rgb(255 255 255) !important;
}

/* กลุ่มปุ่มติดกันแบบ FullCalendar (prev|วันนี้|next และ เดือน|สัปดาห์|วัน|ปี) */
.fc .fc-header-toolbar .fc-button-group {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0;
    vertical-align: middle;
}

.fc-direction-ltr .fc-header-toolbar .fc-button-group > .fc-button:not(:first-child) {
    margin-left: -1px !important;
}

.fc .fc-header-toolbar .fc-button-group > .fc-button {
    float: none;
    border-radius: 0 !important;
    position: relative;
    z-index: 1;
}

.fc .fc-header-toolbar .fc-button-group > .fc-button:hover:not(:disabled),
.fc .fc-header-toolbar .fc-button-group > .fc-button:focus {
    z-index: 2;
}

.fc .fc-header-toolbar .fc-button-group > .fc-button.fc-button-active:not(:disabled) {
    z-index: 3;
}

.fc .fc-header-toolbar .fc-button-group > .fc-button:first-child {
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
}

.fc .fc-header-toolbar .fc-button-group > .fc-button:last-child {
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

.fc .fc-daygrid-event {
    font-size: 0.75rem;
    cursor: pointer;
}

.fc .fc-timegrid-event {
    font-size: 0.75rem;
    cursor: pointer;
}

.fc .fc-col-header-cell-cushion {
    font-size: 0.8rem;
}

.fc td,
.fc th {
    border-color: #e5e7eb !important;
}

.dark .fc td,
.dark .fc th {
    border-color: #374151 !important;
}

.dark .fc .fc-toolbar-title {
    color: #e5e7eb;
}

.dark .fc .fc-button {
    background: #1f2937;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark .fc .fc-button:hover:not(:disabled) {
    background: #374151;
    border-color: #6b7280;
    color: #f9fafb;
}

.dark .fc .fc-today-button.fc-button-primary:not(:disabled) {
    background: #1f2937 !important;
    color: var(--primary-300, #fcd34d) !important;
    border: 1px solid color-mix(in srgb, var(--primary-500, #f59e0b) 55%, #4b5563) !important;
}

.dark .fc .fc-today-button.fc-button-primary:not(:disabled):hover {
    background: #374151 !important;
}

.dark .fc .fc-button-active:not(:disabled) {
    background-color: var(--primary-700, #b45309) !important;
    border-color: var(--primary-700, #b45309) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.dark .fc .fc-button-active:not(:disabled):hover {
    background-color: var(--primary-600, #d97706) !important;
    border-color: var(--primary-600, #d97706) !important;
    color: #fff !important;
}

.dark .fc .fc-daygrid-day-number {
    color: #d1d5db;
}

.dark .fc .fc-col-header-cell-cushion {
    color: #d1d5db;
}
