/* =========================================================
   CSS DE BASE OIKO
========================================================= */
body {
    color: #000000;
    font-family: arial, serif;
    font-size: 14px;
    background-color: #FFFFFF !important;
}

.page-title {
    color: #f6b6a2;
    font-family: arial, serif;
    font-weight: bold;
    font-size: 22px;
}

.pagination>li>a,
.pagination>li>a:hover,
.pagination>li>span {
    background: #eae8e8;
    color: #000000;
}

.fc-view-container * {
    max-height: 780px;
}

.fc-month-view .fc-body .fc-row {
    max-height: 130px;
}

.app-chat-button,
.fc-highlight {
    background: #eae8e8;
    color: #000000;
}

.fc-title {
    font-weight: bold;
    font-size: 16px;
}

@media all and (max-device-width: 1000px) {

    .navbar-inverse .navbar-brand {
        color: black;
        padding-left: 15px;
    }
}



/* =========================================================
   GENERAL INTERFACE ADJUSTMENTS
========================================================= */

/* Add 1px space between statuses in fields and comments sections when are on top of each other */
.comments-history th,
td {
    padding: 0.5px;
}

.fieldtype_dropdown_multiple div {
    margin-top: 1px;
}


/* =========================================================
   MOBILE INPUT ZOOM PREVENTION
========================================================= */

/* Prevent auto zoom on iOS and Android mobile devices */
@media only screen and (max-width: 768px) {

    input,
    select,
    textarea {
        touch-action: manipulation;
        font-size: 16px;
    }

    /* For iOS, it's important to disable focus zoom on inputs */
    input:focus,
    select:focus,
    textarea:focus {
        -webkit-appearance: none;
        outline: none;
        font-size: 16px;
    }
}


/* =========================================================
   MOBILE BOTTOM NAVIGATION

   Buttons:
   1. Dashboard
   2. Messages
   3. Notifications
   4. Profile

   The navigation bar is visible only on mobile phones.
========================================================= */

/* Hide the mobile navigation on desktop and tablets */
.st-mobile-navigation {
    display: none;
}

/* Show the navigation only on screens up to 768px wide */
@media screen and (max-width: 768px) {

    .st-mobile-navigation {
        display: flex;

        /* Keep the navigation fixed at the bottom */
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;

        /* Navigation bar dimensions */
        height: 68px;

        /* Navigation bar appearance */
        background: #ffffff;
        border-top: 1px solid #d9d9d9;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);

        /* Arrange all four buttons horizontally */
        align-items: center;
        justify-content: space-around;

        /* Keep the navigation above other page elements */
        z-index: 99999;

        /* Extra space for iPhones with the home indicator */
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Style for every navigation button */
    .st-mobile-navigation a {
        flex: 1;
        height: 100%;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        color: #666666;
        text-decoration: none;

        font-size: 11px;
        font-weight: 500;

        transition: color 0.2s ease;
    }

    /* Disable the native long-press menu on mobile navigation buttons */
    .st-mobile-navigation,
    .st-mobile-navigation a,
    .st-mobile-navigation a * {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* Navigation button icon */
    .st-mobile-navigation .st-nav-icon {
        position: relative;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        font-size: 23px;
        line-height: 25px;

        margin-bottom: 3px;
    }

    /* Active navigation button */
    .st-mobile-navigation a.st-active {
        color: #1677ff;
        font-weight: 600;
    }

    /* Visual feedback when a button is pressed */
    .st-mobile-navigation a:active {
        background: #f3f3f3;
    }

    /* Prevent the navigation bar from covering page content */
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    }
}


/* =========================================================
   AUTOMATIC LIGHT / DARK MODE
   Uses the phone's system appearance.
========================================================= */

@media (prefers-color-scheme: dark) {

    .st-mobile-navigation {
        background: #1c1c1e;
        border-top: 1px solid #3a3a3c;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, .35);
    }

    .st-mobile-navigation a {
        color: #a1a1aa;
    }

    .st-mobile-navigation a.st-active {
        color: #4da3ff;
    }

    .st-mobile-navigation a:active {
        background: #2c2c2e;
    }

    .st-mobile-navigation .st-count-badge {
        border-color: #1c1c1e;
    }
}


/* =========================================================
   MOBILE MODAL ABOVE BOTTOM NAVIGATION
========================================================= */

@media screen and (max-width: 768px) {

    #ajax-modal {
        max-height: calc(100vh - 76px - env(safe-area-inset-bottom)) !important;
    }

    #ajax-modal .items-form-container,
    #ajax-modal form {
        max-height: calc(100vh - 76px - env(safe-area-inset-bottom)) !important;
    }

    #ajax-modal .modal-body {
        max-height: calc(100vh - 130px - 76px - env(safe-area-inset-bottom)) !important;

        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #ajax-modal .modal-footer {
        position: relative;
        z-index: 2;

        background: inherit;
    }
}


/* =========================================================
   MESSAGE COUNT BADGE
========================================================= */

/* Red unread message badge */
.st-mobile-navigation .st-count-badge {
    position: absolute;

    /* Badge position relative to the icon */
    top: -8px;
    right: -13px;

    /* Badge dimensions */
    min-width: 18px;
    height: 18px;
    padding: 0 5px;

    /* Badge appearance */
    background: #e60023;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 10px;

    /* Number alignment */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 10px;
    font-weight: 700;
    line-height: 1;

    /* Keep the badge above other elements */
    z-index: 2;

    box-sizing: border-box;
}

/* Hide the badge when there are no unread messages */
.st-mobile-navigation .st-count-badge[hidden] {
    display: none !important;
}


/* =========================================================
   ORIGINAL RUKOVODITEL USER MENU ON MOBILE
========================================================= */

@media screen and (max-width: 768px) {

    li.dropdown.user.open>ul.dropdown-menu {
        position: fixed !important;

        top: auto !important;
        left: auto !important;
        right: 8px !important;

        bottom: calc(76px + env(safe-area-inset-bottom)) !important;

        margin: 0 !important;
        transform: none !important;

        max-height: calc(100vh - 110px - env(safe-area-inset-bottom));

        overflow-y: auto;

        z-index: 100000 !important;
    }
}


/* =========================================================
   HIDE ONLY THE ORIGINAL TOP PROFILE BUTTON ON MOBILE
   Keep the dropdown menu available for the bottom button.
========================================================= */

@media screen and (max-width: 768px) {

    li.dropdown.user>a.dropdown-toggle {
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
}


/* =========================================================
   MOBILE COLLAPSIBLE FILTERS
========================================================= */

.st-mobile-filters-toggle {
    display: none;
}

@media screen and (max-width: 768px) {

    .st-mobile-filters-toggle {
        display: flex;
        width: 100%;
        min-height: 48px;

        align-items: center;
        justify-content: space-between;

        margin-bottom: 12px;
        padding: 10px 14px;

        background: #ffffff;
        border: 1px solid #d9d9d9;
        border-radius: 5px;

        color: #333333;
        font-size: 16px;
        font-weight: 500;

        cursor: pointer;
    }

    .filters-panels.horizontal-filters-panels {
        display: none;
    }

    .filters-panels.horizontal-filters-panels.st-filters-open {
        display: block;
    }

    /* Filter button label */
    .st-mobile-filters-toggle .st-filters-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* Active filters badge */
    .st-mobile-filters-toggle .st-filters-badge {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        background: #e60023;
        color: #ffffff;
        border-radius: 10px;

        font-size: 11px;
        font-weight: 700;
        line-height: 1;

        box-sizing: border-box;
    }

    /* Hide the badge when there are no active filters */
    .st-mobile-filters-toggle .st-filters-badge[hidden] {
        display: none !important;
    }

    /* Active filter button */
    .st-mobile-filters-toggle.st-filters-active {
        border-color: #e60023;
        color: #e60023;
    }
}

@media screen and (max-width: 768px) and (prefers-color-scheme: dark) {

    .st-mobile-filters-toggle {
        background: #1c1c1e;
        border-color: #3a3a3c;
        color: #ffffff;
    }

    .st-mobile-filters-toggle.st-filters-active {
        border-color: #ff453a;
        color: #ff453a;
    }
}


/* =========================================================
   MOBILE SIDEBAR REPORTS
========================================================= */

@media screen and (max-width: 768px) {

    #stSidebarReports {
        display: flex !important;
        width: 100%;

        align-items: center;
        justify-content: flex-start;
        gap: 8px;

        overflow-x: auto;
        overflow-y: hidden;

        padding: 10px 1px !important;
        margin: 0 !important;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);

        box-sizing: border-box;
    }

    #stSidebarReports>li {
        display: block !important;
        position: relative !important;
        float: none !important;

        width: auto !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    #stSidebarReports>li>a {
        display: flex !important;

        min-width: 42px;
        min-height: 42px;

        align-items: center;
        justify-content: center;

        padding: 6px !important;
        margin: 0 !important;

        background: transparent !important;
    }

    #stSidebarReports>li>a>i {
        margin: 0 !important;
        font-size: 20px !important;
    }

    #stSidebarReports>li>a>.badge {
        position: absolute;
        top: 0;
        right: 2px;

        margin: 0 !important;
    }

    #stSidebarReports>li>ul.dropdown-menu {
        position: fixed !important;

        top: 120px !important;
        left: 8px !important;
        right: 8px !important;

        width: auto !important;
        max-height: calc(100vh - 210px);

        overflow-y: auto;

        z-index: 100001 !important;
    }
        .page-sidebar ul {
        margin-bottom: 120px;
    }
}