/* แถบเมนูล่าง + sticky footer (system_summary + Incident) */

/* เนื้อหาน้อย — ดัน footer copyright ให้อยู่ล่าง viewport */
.container-scroller {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container-scroller > .container.content-wrapper {
    flex: 1 1 auto;
}

.container-scroller > .footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

.inc-bottom-nav {
    display: none;
}

.inc-bottom-nav-sheet {
    display: none;
}

/* มือถือ / แท็บเล็ต (รวม iPhone 430px และ iPad แนวตั้ง) */
@media (max-width: 991px) {
    .sys-controls.sys-controls-portal {
        display: none !important;
    }

    body.eoffice-mobile-nav-active .container-scroller {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    body.eoffice-mobile-nav-active .footer {
        display: none;
    }

    .inc-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        align-items: stretch;
        justify-content: space-around;
        gap: 2px;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid rgba(148, 163, 184, 0.35);
        box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
    }

    .inc-bottom-nav-item {
        flex: 1 1 0;
        min-width: 0;
        max-width: 88px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        border: none;
        background: transparent;
        color: #64748b;
        text-decoration: none !important;
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.15;
        border-radius: 10px;
        transition: color 0.15s, background 0.15s;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        font-family: 'Sarabun', sans-serif;
    }

    .inc-bottom-nav-item .typcn {
        font-size: 1.6rem;
        line-height: 1;
    }

    .inc-bottom-nav-icon-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .inc-bottom-nav-badge {
        position: absolute;
        top: -4px;
        right: -10px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 800;
        line-height: 16px;
        text-align: center;
        color: #fff;
        background: #ef4444;
        box-shadow: 0 0 0 1.5px #fff;
    }

    .inc-bottom-nav-item > span:last-child {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inc-bottom-nav-item:hover,
    .inc-bottom-nav-item:focus {
        color: #2563eb;
        background: rgba(37, 99, 235, 0.06);
        text-decoration: none;
    }

    .inc-bottom-nav-item.active {
        color: #2563eb;
    }

    .inc-bottom-nav-item.active .typcn {
        transform: scale(1.05);
    }

    .inc-bottom-nav-sheet:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10050;
    }

    .inc-bottom-nav-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
    }

    .inc-bottom-nav-sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: calc(52px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 16px 16px 20px;
        box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.15);
        animation: incSheetUp 0.25s ease-out;
        z-index: 1;
    }

    @keyframes incSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .inc-bottom-nav-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e2e8f0;
    }

    .inc-bottom-nav-sheet-close {
        border: none;
        background: #f1f5f9;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 1.4rem;
        line-height: 1;
        color: #64748b;
        cursor: pointer;
    }

    .inc-bottom-nav-sheet-links {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .inc-bottom-nav-sheet-link,
    .inc-bottom-nav-sheet-action {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 12px;
        color: #1e293b;
        text-decoration: none !important;
        font-weight: 600;
        border: none;
        background: transparent;
        width: 100%;
        text-align: left;
        font-family: 'Sarabun', sans-serif;
        font-size: 1.0625rem;
        cursor: pointer;
    }

    .inc-bottom-nav-sheet-link .typcn,
    .inc-bottom-nav-sheet-action .typcn {
        font-size: 1.45rem;
        color: #2563eb;
    }

    .inc-bottom-nav-sheet-link.active,
    .inc-bottom-nav-sheet-link:hover,
    .inc-bottom-nav-sheet-action:hover {
        background: rgba(37, 99, 235, 0.08);
        color: #2563eb;
    }

    body.inc-bottom-sheet-open {
        overflow: hidden;
    }
}
