﻿/**************************************************************
    GLOBAL FONT
**************************************************************/

@font-face {
    font-family: 'Poppins';
    src: url('/dist/fonts/Poppins-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/dist/fonts/Poppins-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/dist/fonts/Poppins-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/**************************************************************
    ROOT
**************************************************************/

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-main);
    color: var(--text-main);
}

/**************************************************************
    MAIN APP LAYOUT
**************************************************************/

.page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Main Body */

.app-wrapper {
    flex: 1;
    display: flex;
    min-width: 0;
    height: calc(100vh - 56px - 28px);
    overflow: hidden;
}

/* Sidebar */

.sidebar {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    background: #fff;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

/* Main Content */

.content {
    flex: 1;
    padding: 10px;
    background: var(--bg-main);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/**************************************************************
    NAVBAR
**************************************************************/

.navbar {
    flex-shrink: 0;
    z-index: 1050;
}

.navbar.sticky-top {
    z-index: 1030 !important;
}

#navbar-menu {
    position: relative;
    z-index: 1035;
    background: #fff;
}

/**************************************************************
    FOOTER
**************************************************************/

.footer {
    flex-shrink: 0;
}

.app-footer {
    height: 28px;
    min-height: 28px;
    background: #ffffff;
    border-top: 1px solid #d9d9d9;
    color: #64748b;
    font-size: 11px;
    display: flex;
    align-items: center;
    padding: 0;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
}

.brand-name {
    color: var(--primary);
    font-weight: 600;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

    .footer-link:hover {
        text-decoration: underline;
    }

.footer-separator {
    color: #cbd5e1;
}

.footer-version {
    background: #419d18;
    color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 500;
}

@media (max-width: 768px) {

    .app-footer {
        height: auto;
        min-height: 32px;
        padding: 4px 0;
        font-size: 10px;
    }

    .footer-left,
    .footer-right {
        justify-content: center;
        width: 100%;
    }

    .footer-right {
        margin-top: 2px;
    }
}

/**************************************************************
    PAGE WRAPPER
**************************************************************/

.modern-page {
    background: #f5f7fb;
    min-height: 100%;
}

/**************************************************************
    PAGE HEADER
**************************************************************/

.page-header-modern {
    background: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.header-text {
    margin-left: 1rem;
}

.page-title-modern {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.record-info {
    font-size: .9rem;
    opacity: .8;
}

.page-header-modern .btn-primary {
    padding: 8px 15px;
    border-radius: 6px;
}

.header-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: #f8f9fc;
    border: 1px solid #e5e7ef;
    margin-right: 12px;
    transition: .2s ease;
}

    .header-icon i {
        transition: .2s ease;
    }

    .header-icon:hover {
        background: #eef0f5;
        border-color: #d6d9e4;
    }

        .header-icon:hover i {
            transform: scale(1.08);
        }

/**************************************************************
    MODALS
**************************************************************/

.modal-dialog {
    position: relative;
}

body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-fullscreen .modal-content {
    height: 100dvh;
}

.modal-fullscreen .modal-body {
    overflow-y: auto;
}

/* iOS Safari modal fix */

.modal-open .page,
.modal-open .app-wrapper,
.modal-open .content {
    transform: none !important;
    filter: none !important;
}

/**************************************************************
    OTHERS
**************************************************************/

.offcanvas {
    z-index: 1045;
}


/**************************************************************
    MODERN SCROLLBAR STYLES 
**************************************************************/

* {
    scrollbar-width: thin;
    scrollbar-color: #60a5fa transparent;
}

::-webkit-scrollbar {
    width: 6px; 
    height: 6px; 
}

::-webkit-scrollbar-track {
    background: transparent; 
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: #60a5fa;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease;
}

    ::-webkit-scrollbar-thumb:hover {
        background-color: #10b981;
    }

/* Optional: Only apply to containers with scroll content (like content & table wrappers) */
.content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

/**************************************************************
    MOBILE
**************************************************************/

@media (max-width: 991px) {

    .navbar.sticky-top {
        z-index: 1030 !important;
    }

    #navbar-menu {
        position: fixed;
        z-index: 1035;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
        background: #fff;
        padding: 10px;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .app-wrapper {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: -240px;
        width: 240px;
        height: calc(100dvh - 60px);
        z-index: 1040;
        transition: left .3s ease;
    }

        .sidebar.show {
            left: 0;
        }

    .content {
        width: 100%;
    }
}

/**************************************************************
    SMALL DEVICES
**************************************************************/

@media (max-width: 768px) {

    .page-header-modern {
        padding: 18px;
        text-align: center;
    }

    .header-icon {
        margin: 0 auto 10px;
    }

    .header-actions {
        justify-content: center;
    }

    .d-flex.align-items-center.mt-3 {
        justify-content: center;
    }
}
