﻿/* =========================================================
   ReMeBox – Layout CSS
   ERP Standard
   ========================================================= */

/* =========================
   BASE RESET
========================= */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7f8;
}

    /* =========================
   APP ROOT
========================= */

    body.app-layout {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
        background: transparent;
    }

/* =========================
   BACKGROUND LAYER
========================= */

.app-bg {
    position: fixed;
    inset: 0;
    /*background: url('/images/remeboxback.png') center center / cover no-repeat;*/
    z-index: -2;
    background: #F5F7FA;
    /*filter: grayscale(25%) brightness(0.95);*/
}

    .app-bg::before {
        display: none;
/*        content: "";
        position: absolute;
        inset: 0;
        background: rgba(248,250,252,.92);
*/    }
/* =========================
   HEADER
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1300;
    width: 100%;
    min-height: 64px;
    height: auto;
    flex-shrink: 0;
    isolation: isolate;
}

.inner-app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
}
/* =========================
   PAGE STRUCTURE
========================= */

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.page-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
}

/* =========================
   MAIN CONTAINER
========================= */

main.container-fluid {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
    flex: 1;
    padding: 16px;
    overflow: auto;
    min-width: 0;
}

/* =========================
   ERP WIDTH CONTROL
========================= */

.rb-navbar .container-fluid,
.footer-custom .container-fluid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.rb-navbar-header,
.rb-navbar-brand {
    min-width: 0;
}

.rb-navbar-logo {
    width: 2in;
    height: .6in;
    object-fit: contain;
    flex: 0 0 auto;
}

.navbar-nav > li.nav-item {
    margin-right: .75rem;
}
/* =========================
   DROPDOWNS (ERP MODE)
========================= */

.dropdown-menu {
    min-width: 220px;
    max-width: 340px;
    border: 1px solid #d8e4e2;
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,.10);
    background: #fff;
}

.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu > .dropdown-menu {
        position: absolute;
        top: -1px;
        left: calc(100% - 1px);
        display: none;
        min-width: 220px;
        border-radius: 0 8px 8px 0;
        margin-left: 0;
        border-left: none;
        box-shadow: 6px 6px 16px rgba(0,0,0,.18);
        z-index: 1200;
    }


        .dropdown-submenu:hover > .dropdown-menu,
        .dropdown-submenu > .dropdown-menu.show {
            display: block;
        }

/* =========================
   DROPDOWN ITEMS
========================= */

.navbar .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    transition: all .2s ease;
}

    .navbar .dropdown-menu .dropdown-item:hover {
        background: #EAF6FF;
        color: #0F4C81
    }

        .navbar .dropdown-menu .dropdown-item:hover svg {
            color: #0F4C81;
            stroke: #0F4C81;
        }

/* =========================
   BOOTSTRAP COLLAPSE FIX
========================= */

@media (min-width:992px) {

    .navbar-nav {
        flex-direction: row;
        width: auto;
    }

        .navbar-nav .nav-item {
            width: auto;
        }

        .navbar-nav .dropdown-menu {
            position: absolute;
        }
}

@media (max-width:991px) {

    .header {
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1300;
    }

    .rb-navbar {
        position: relative;
        z-index: 1100;
    }

    .rb-navbar .container-fluid {
        position: relative;
        flex-wrap: nowrap;
    }

    .rb-navbar-header {
        gap: 10px;
    }

    .rb-navbar-brand {
        flex: 1 1 auto;
        overflow: hidden;
    }

    .rb-navbar-logo {
        width: clamp(130px, 28vw, 192px);
        height: auto;
        max-height: 58px;
    }

    .rb-depot-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(.82rem, 2.2vw, 1.15rem);
    }

    #mainNavbarToggle {
        display: block;
        flex: 0 0 auto;
        border-color: rgba(0, 0, 0, .55);
    }

    .rb-navbar #mainNavbar {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 12px 14px;
        background: linear-gradient(180deg, #174a8b 0%, #087e9b 100%);
        border-top: 1px solid rgba(255, 255, 255, .35);
        box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
        z-index: 1200;
    }

    .rb-navbar #mainNavbar:not(.show) {
        display: none !important;
    }

    .rb-navbar #mainNavbar.show {
        display: block !important;
    }

    .rb-navbar .navbar-nav {
        width: 100%;
        flex-direction: column !important;
        align-items: stretch;
        margin: 0 !important;
        gap: 4px;
    }

        .rb-navbar .navbar-nav .nav-item {
            width: 100%;
            margin: 0;
        }

        .rb-navbar .navbar-nav .nav-link {
            display: flex;
            width: 100% !important;
            height: auto;
            min-height: 44px;
            margin: 0;
            padding: 10px 14px;
            justify-content: flex-start;
            color: #fff !important;
            white-space: normal;
            border: 1px solid rgba(255, 255, 255, .28);
            background: rgba(255, 255, 255, .08);
        }

        .rb-navbar .navbar-nav .dropdown-menu {
            position: static !important;
            width: 100%;
            max-width: none;
            margin: 4px 0 8px;
            box-shadow: none;
            border: 1px solid #d8e4e2;
            transform: none !important;
        }

        .rb-navbar .dropdown-submenu > .dropdown-menu {
            margin-left: 12px;
            width: calc(100% - 12px);
            border-left: 3px solid #0d9488;
        }
}

/* =========================
   MOBILE
========================= */

@media (max-width:575px) {

    .rb-navbar .container-fluid,
    main.container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-center {
        padding: 10px;
    }

    .rb-navbar-logo {
        width: clamp(118px, 42vw, 165px);
    }

    .rb-depot-name {
        font-size: clamp(.7rem, 3.2vw, .92rem);
    }

    /* Touch devices have no hover; keep the shortcut links directly tappable. */
    #floatingButtons {
        right: 12px;
        bottom: 16px;
        gap: 8px;
    }

    #floatingButtons .float-btn {
        width: 48px;
        height: 48px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}

/* =========================
   FORM CONTAINER
========================= */

.form-container {
    width: 100%;
    background: #fff;
    border: 1px solid #d7e3e1;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    padding: 16px;
    box-sizing: border-box;
}

    .form-container h2 {
        margin: -16px -16px 16px;
        padding: 12px 18px;
        background: linear-gradient(90deg,#1E4F4A,#2F7A73);
        color: #fff;
        font-size: 18px;
        font-weight: 600;
        border-radius: 10px 10px 0 0;
    }

/* =========================
   FORM SCROLL
========================= */

.form-scroll-wrapper {
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================
   FLOATING BUTTONS
========================= */

#floatingButtons {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 1050;
}

/* =========================
   FILTER ROW
========================= */

.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

    .filter-row input {
        width: auto;
    }

main.container-fluid {
    flex: 1;
}

.footer-custom {
    margin-top: auto;
}
