:root {
    --outlook-green: #107c10;
    --outlook-bg: #ffffff;
    --outlook-sidebar: #f8f9fa;
    --outlook-border: #edebe9;
    --outlook-text: #323130;
    --outlook-hover: #f3f2f1;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--outlook-bg);
    color: var(--outlook-text);
    overflow: hidden;
}

#agenda-wrapper, #planning_rutl-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

/* BARRE D'OUTILS SUPÉRIEURE */
#outlook-toolbar {
    height: 52px;
    border-bottom: 1px solid var(--outlook-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    background: #fff;
}

#btn-add-event-fancy {
    background-color: var(--outlook-green) !important;
    border: none !important;
    border-radius: 4px;
    font-weight: 500;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.view-switcher {
    display: flex;
    background: var(--outlook-hover);
    padding: 3px;
    border-radius: 6px;
}

.view-switcher .btn {
    border: none !important;
    background: transparent;
    color: var(--outlook-text);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-switcher .btn i {
    font-size: 1rem;
    color: #605e5c;
}

.view-switcher .btn:hover {
    background: #f3f2f1;
}

.view-switcher .btn.active {
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: var(--outlook-green);
}

.view-switcher .btn.active i {
    color: var(--outlook-green);
}

/* LAYOUT PRINCIPAL */
#main-layout {
    display: flex;
    flex: 1;
    height: calc(100% - 52px);
}

/* SIDEBAR */
#outlook-sidebar {
    width: 280px;
    background-color: var(--outlook-sidebar);
    border-right: 1px solid var(--outlook-border);
    padding: 20px 16px;
    overflow-y: auto;
}

.mini-calendar-placeholder {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 24px;
    border: 1px solid var(--outlook-border);
    font-size: 0.8rem;
    text-align: center;
}

.calendar-item:hover {
    background: var(--outlook-hover);
}

/* MINI CALENDRIER SIDEBAR */
#mini-cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.75rem;
}

#mini-cal-table th {
    font-weight: 400;
    color: #605e5c;
    padding: 5px 0;
    text-align: center;
    width: 14.28%;
}

#mini-cal-table td,
#picker-mini-table td {
    text-align: center;
    padding: 5px 0;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    color: #323130;
}

#mini-cal-table td:hover,
#picker-mini-table td:hover {
    background: #f3f2f1;
}

/* Survol par ligne uniquement si activé (vues semaine) */
#mini-cal-table.hover-row tr:hover td {
    background: #f3f2f1;
    border-radius: 0;
}

#mini-cal-table.hover-row tr:hover td:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

#mini-cal-table.hover-row tr:hover td:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#mini-cal-table td.today,
#picker-mini-table td.today {
    color: white !important;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

#mini-cal-table td.today::after,
#picker-mini-table td.today::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    background: var(--outlook-green);
    border-radius: 50%;
    z-index: -1;
}

#mini-cal-table td.selected,
#picker-mini-table td.selected {
    background: #dff6dd !important;
    border: 1px solid #7cb37c !important;
    border-radius: 0 !important;
    color: #107c10 !important;
    font-weight: 600;
}

#mini-cal-table td.today.selected,
#picker-mini-table td.today.selected {
    color: white !important;
}

#mini-cal-table td.selected-week {
    background: #dbf0db !important;
    border-top: 1px solid #7cb37c;
    border-bottom: 1px solid #7cb37c;
    border-radius: 0;
}

#mini-cal-table td.selected-week.selection-start,
#mini-cal-table td.selected-week:first-child {
    border-left: 1px solid #7cb37c;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

#mini-cal-table td.selected-week.selection-end,
#mini-cal-table td.selected-week:last-child {
    border-right: 1px solid #7cb37c;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#mini-cal-table td.other-month {
    color: #c8c6c4;
}

#mini-prev,
#mini-next,
.cursor-pointer {
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

#mini-prev:hover,
#mini-next:hover,
.cursor-pointer:hover {
    background-color: #f3f2f1;
    color: var(--outlook-green) !important;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: #107c10;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    margin: 4px 0;
}

.sidebar-link:hover {
    background: #f3f2f1;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #605e5c;
    margin: 20px 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
}

.calendar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.calendar-item:hover {
    background: var(--outlook-hover);
}

/* CALENDRIER PRINCIPAL */
#calendar-container {
    flex: 1;
    background: #fff;
    padding: 12px;
    overflow: hidden;
}

#calendar {
    height: 100%;
}

/* Slot horaire : centré, sans suffixe */
.fc .fc-timegrid-slot-label,
.fc .fc-timegrid-axis {
    text-align: center !important;
    padding: 0 !important;
}

.fc .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-axis-cushion {
    display: inline-block !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 0.85rem;
    color: #605e5c;
    padding: 0 !important;
    margin: 0 !important;
}

.fc {
    border: none !important;
}

.fc th {
    border: none !important;
    padding: 8px 0 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    color: #616161 !important;
    font-weight: 600 !important;
}

.fc-day-today {
    background-color: rgba(16, 124, 16, 0.04) !important;
}

/* Styles des événements Outlook */
.fc-event {
    border: none !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    margin: 1px 2px !important;
    color: #323130 !important;
}

/* Événements d'un seul jour (Style Bordure Gauche) */
.fc-daygrid-dot-event {
    background-color: #fff !important;
    border-left: 4px solid #6c757d !important;
}

/* Événements en bloc (Multi-jours ou All-day) */
.fc-daygrid-block-event {
    color: #fff !important;
    /* Texte blanc sur fond plein */
}

.fc-daygrid-block-event .fc-event-main i,
.fc-daygrid-block-event .fc-event-title {
    color: #fff !important;
}

.fc-event-main i {
    font-size: 0.9rem;
    vertical-align: middle;
    margin-right: 4px;
    color: inherit;
}

.fc-header-toolbar {
    display: none !important;
}

/* Scrollbars ultra-fines style Outlook */
#outlook-sidebar::-webkit-scrollbar,
#calendar-container .fc-scroller::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#outlook-sidebar::-webkit-scrollbar-thumb,
#calendar-container .fc-scroller::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 10px;
}

#outlook-sidebar::-webkit-scrollbar-track,
#calendar-container .fc-scroller::-webkit-scrollbar-track {
    background: transparent;
}

/* Headers de colonnes : 02 Lun */
.fc .fc-col-header-cell-cushion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 5px 0 5px 10px !important;
    text-decoration: none !important;
    position: relative;
}

.fc .fc-col-header-cell-cushion .header-day-num {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--outlook-green);
    line-height: 1.1;
}

.fc .fc-col-header-cell-cushion .header-day-text {
    font-size: 0.75rem;
    color: #605e5c;
    text-transform: capitalize;
}

.fc-day-today .header-day-num {
    color: var(--outlook-green) !important;
    font-weight: 600 !important;
}

.fc-day-today .fc-col-header-cell-cushion::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--outlook-green);
}

.fc-day-today .header-day-text {
    color: var(--outlook-green) !important;
}

/* Cacher le numéro de jour dans les en-têtes en vue mois */
.fc-daygrid-month-view .header-day-num {
    display: none !important;
}

/* DATE PICKER DROPDOWN */
#calendar-title-container {
    position: relative;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

#calendar-title-container:hover {
    background: #f3f2f1;
}

#calendar-date-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    background: white;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 500px;
    margin-top: 8px;
}

#calendar-date-picker-dropdown.show {
    display: flex;
}

.picker-left {
    flex: 1;
    padding-right: 20px;
    border-right: 1px solid #edebe9;
}

.picker-right {
    width: 200px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
}

#picker-mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    table-layout: fixed;
}

#picker-mini-table th {
    font-weight: 500;
    color: #0012bc;
    /* Bleu comme sur l'image */
    font-size: 0.85rem;
    padding: 8px 0;
    text-align: center;
}

#picker-mini-table td {
    height: 32px;
    width: 32px;
    padding: 0;
    line-height: 32px;
    font-size: 0.85rem;
}

.picker-month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.picker-month-item {
    font-size: 0.85rem;
    padding: 8px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    color: #323130;
}

.picker-month-item:hover {
    background: #f3f2f1;
}

.picker-month-item.active {
    background: #dff6dd;
    color: #107c10;
    font-weight: 600;
}

.picker-year-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.picker-today-btn {
    margin-top: auto;
    text-align: right;
    font-size: 0.9rem;
    color: #605e5c;
    cursor: pointer;
    padding-top: 20px;
    transition: color 0.2s;
}

.picker-today-btn:hover {
    color: var(--outlook-green);
    text-decoration: underline;
}

/* DAY COUNT DROPDOWN */
.day-dropdown-wrapper {
    position: relative;
}

.day-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    background: white;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    min-width: 140px;
    margin-top: 4px;
}

.day-dropdown-menu.show {
    display: block;
}

.day-dropdown-item {
    padding: 6px 16px;
    font-size: 0.85rem;
    color: #323130;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.day-dropdown-item:hover {
    background: #f3f2f1;
}

.day-dropdown-item .day-check {
    display: inline-block;
    width: 14px;
    color: var(--outlook-green);
    font-weight: 700;
}

/* SPLIT VIEW (MODE FRACTIONNÉ) */
#split-container {
    display: flex;
    height: 100%;
    gap: 0;
    overflow-x: auto;
}

.split-column {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--outlook-border);
    height: 100%;
    overflow: hidden;
}

.split-column:last-child {
    border-right: none;
}

.split-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--outlook-border);
    background: #fafafa;
    flex-shrink: 0;
}

.split-column-header .split-cat-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.split-column-header .split-close-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #a19f9d;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.split-column-header .split-close-btn:hover {
    color: #605e5c;
}

.split-column-calendar {
    flex: 1;
    overflow: hidden;
}

.split-column-calendar .fc {
    height: 100% !important;
}

.split-column-calendar .fc-header-toolbar {
    display: none !important;
}

.split-column-calendar .fc th {
    border: none !important;
}

/* JOURS FÉRIÉS */
.fc-daygrid-bg-harness .fc-bg-event {
    opacity: 0.5 !important;
}

.holiday-event {
    pointer-events: none !important;
}

.holiday-event .fc-event-main {
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding-left: 2px !important;
}

/* Événement jour férié flottant au-dessus */
.holiday-header-event {
    z-index: 100 !important;
    font-weight: 800 !important;
    border: 1px solid #e83e08 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: none !important;
}

.holiday-header-event .fc-event-main {
    padding: 2px 5px !important;
}

/* Nouveau style pour l'en-tête des jours fériés */
.holiday-header-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e83e08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(232, 62, 8, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
    margin-top: 2px;
}

/* Surlignage de la colonne/case entière */
.holiday-bg {
    background-color: rgba(248, 215, 218, 0.2) !important;
}

.fc-timegrid-col.holiday-bg {
    background-color: rgba(248, 215, 218, 0.1) !important;
}

/* YEAR VIEW FÉRIÉS */
.year-month-table td.holiday {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 700;
}


/* YEAR VIEW (VUE ANNÉE) */
#year-view-container {
    height: 100%;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 24px;
    padding: 30px;
    background: #ffffff;
}

@media (max-width: 1200px) {
    #year-view-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    #year-view-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.year-month-card {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #edebe9;
    transition: background 0.2s, border-color 0.2s;
}

.year-month-card:hover {
    background: #f3f2f1;
    border-color: var(--outlook-green);
}

.year-month-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--outlook-green);
    margin-bottom: 8px;
    padding-left: 4px;
    text-transform: capitalize;
}

.year-month-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.year-month-table th {
    font-weight: 500;
    color: #605e5c;
    padding: 4px 0;
    text-align: center;
    border: none !important;
}

.year-month-table td {
    text-align: center;
    padding: 6px 0;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    color: #323130;
    transition: background 0.15s;
}

.year-month-table td:hover {
    background: #f3f2f1;
    color: var(--outlook-green);
    font-weight: 600;
}

.year-month-table td.other-month {
    color: #c8c6c4;
    cursor: default;
}

.year-month-table td.other-month:hover {
    background: transparent;
}

.year-month-table td.today {
    color: var(--outlook-green);
    font-weight: 700;
}

.year-month-table td.today::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--outlook-green);
    border-radius: 50%;
}

.year-month-table td.has-events {
    font-weight: 600;
}

.year-month-table td.has-events::before {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 3px;
    height: 3px;
    background: #107c10;
    border-radius: 50%;
    opacity: 0.6;
}