/* ═══════════════════════════════════════════════════════════
   F4M_CALENDAR
   ═══════════════════════════════════════════════════════════ */

div.F4M_CALENDAR {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

/* ─── BOX_ACTION ─────────────────────────────────────────── */

div.F4M_CALENDAR .BOX_ACTION {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 80px;
    overflow: hidden;
    z-index: 98;
    flex-shrink: 0;
}

div.F4M_CALENDAR .BOX_ACTION .CODE {
    height: 40px;
    visibility: hidden;
}

div.F4M_CALENDAR .BOX_ACTION .ACTION {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 90%;
    margin-left: 5%;
}

div.F4M_CALENDAR .BOX_ACTION .ACTION span.button
, div.F4M_CALENDAR .BOX_ACTION .ACTION span.button > i {
    font-size: 26px !important;
    top: 0;
    left: 0;
    display: flex;
    align-self: center;
    justify-self: center;
    align-items: center;
    justify-content: center;
}

div.F4M_CALENDAR .BOX_ACTION .BTN_VIEWS {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ─── BOX_MAIN ───────────────────────────────────────────── */

div.F4M_CALENDAR .BOX_MAIN {
    display: flex;
    flex-direction: row;
    flex: 1;
    padding-top: 85px;
    box-sizing: border-box;
    overflow: hidden;
    height: 100%;
    max-width: 90%;
    margin-left: 5%;
}

/* ─── BOX_SIDEBAR ────────────────────────────────────────── */

div.F4M_CALENDAR .BOX_SIDEBAR {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #ccc;
    transition: width 0.2s ease, min-width 0.2s ease;
    box-sizing: border-box;
    background: #fff;
}

div.F4M_CALENDAR .BOX_SIDEBAR.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
}

/* ─── BOX_SRC ────────────────────────────────────────────── */

div.F4M_CALENDAR .BOX_SRC {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 4px 8px;
    border-bottom: 1px solid #e0e0e0;
}

div.F4M_CALENDAR .BOX_SRC select.sel_sources_group {
    flex: 1;
    min-width: 0;
}

/* ─── BOX_FILTER ─────────────────────────────────────────── */

div.F4M_CALENDAR .BOX_FILTER {
    display: none;
    padding: 6px 8px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

div.F4M_CALENDAR .BOX_FILTER_ACTION {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

div.F4M_CALENDAR .BOX_FILTER_DEFAULT .BOX_SRC_CHK {
    margin-top: 6px;
}

/* ─── MINI CALENDARIO ────────────────────────────────────── */

div.F4M_CALENDAR .BOX_MINI_CAL {
    padding: 8px 6px 4px 6px;
    border-bottom: 1px solid #e0e0e0;
}

div.F4M_CALENDAR .mini_cal_nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    margin-bottom: 4px;
    background-color: #019abc;
    height: 40px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 3px;
}

div.F4M_CALENDAR .mini_cal_nav select {
    font-size: 12px;
    padding: 1px 2px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #fff;
    appearance: none;
    -webkit-appearance: none;
}

div.F4M_CALENDAR .mini_cal_nav select option {
    background: #fff;
    color: #333;
}

div.F4M_CALENDAR .mini_cal_nav .mini_sel_month {
    min-width: 0;
    margin-left: auto;
    text-align: right;
}

div.F4M_CALENDAR .mini_cal_nav .mini_sel_year {
    width: 58px;
    flex-shrink: 0;
    margin-right: auto;
}

div.F4M_CALENDAR table.mini_cal_grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

div.F4M_CALENDAR .mini_cal_grid th {
    text-align: center;
    font-weight: 600;
    padding: 2px 0;
    color: #555;
}

div.F4M_CALENDAR .mini_cal_grid td {
    text-align: center;
    padding: 1px 0;
    vertical-align: top;
    line-height: 1.2;
    cursor: default;
}

div.F4M_CALENDAR .mini_cal_grid td.cal_mini_day {
    cursor: pointer;
    border-radius: 3px;
}

div.F4M_CALENDAR .mini_cal_grid td.cal_mini_day:hover {
    background: #e8f4f8;
}

div.F4M_CALENDAR .mini_cal_grid td.today .cal_mini_num {
    display: inline-block;
    background: #3788d8;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-weight: 700;
}

div.F4M_CALENDAR .mini_cal_grid td.selected {
    background: #d0eaf8;
}

div.F4M_CALENDAR .mini_cal_grid td.has_events .cal_mini_count {
    display: block;
    font-size: 10px;
    color: #3788d8;
    line-height: 1;
}

div.F4M_CALENDAR .mini_cal_grid td .cal_mini_count {
    display: block;
    font-size: 10px;
    min-height: 11px;
}

/* ─── BOX_DAY_LIST ───────────────────────────────────────── */

div.F4M_CALENDAR .BOX_DAY_LIST {
    padding: 6px 8px;
    font-size: 13px;
}

div.F4M_CALENDAR .cal_day_list_header {
    font-weight: 600;
    padding: 4px 0 6px 0;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
}

div.F4M_CALENDAR .cal_day_item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 4px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    border-radius: 2px;
}

div.F4M_CALENDAR .cal_day_item:hover {
    background: #f0f7fb;
}

div.F4M_CALENDAR .cal_day_time {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
    min-width: 34px;
}

div.F4M_CALENDAR .cal_day_title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── BOX_CALENDAR (main EC) ─────────────────────────────── */

div.F4M_CALENDAR .BOX_CALENDAR {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* EC full height */
div.F4M_CALENDAR .BOX_CALENDAR .ec {
    height: 100%;
    font-family: inherit;
}

div.F4M_CALENDAR .BOX_CALENDAR .ec-toolbar {
    background-color: #fff;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    margin-block-end: 0;
}

div.F4M_CALENDAR .BOX_CALENDAR .ec-toolbar .ec-title {
    color: #019abc;
    font-size: 15px;
    font-weight: 600;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

@media only screen and (max-width: 768px) {
    div.F4M_CALENDAR .BOX_SIDEBAR {
        width: 200px;
        min-width: 200px;
    }
}

/* ─── PULSANTI ICONE ─────────────────────────────────────── */

div.F4M_CALENDAR span.button.btnRefresh i,
div.F4M_CALENDAR span.button.btnSidebar i,
div.F4M_CALENDAR span.button.btnFilter i {
    font-size: 22px !important;
}

div.F4M_CALENDAR .BTN_VIEWS span.button.btnView {
    font-size: 13px;
    padding: 2px 6px;
}

div.F4M_CALENDAR .BOX_SIDEBAR .BOX_MINI_CAL span.button {
    color: #fff;
}

div.F4M_CALENDAR .BOX_SIDEBAR span.button {
    color: #019abc;
    border-left: none;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}
div.F4M_CALENDAR .BOX_SIDEBAR span.button > i {
    font-size: 18px !important;
    top: 0;
    left: 0;
}