/* SendFast Valex-inspired Theme Stylesheet */

:root {
    --primary-color: #0162e8;
    --primary-hover: #0156cb;
    --bg-color: #f0f3fa;
    --sidebar-width: 240px;
    --header-height: 64px;
    --card-border-color: #e9edf4;
    --text-main: #3c4858;
    --text-muted: #8f9fbc;
    --sidebar-bg: #ffffff;
    --sidebar-text: #4d5875;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout Framework */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* app-header */
.app-header {
    background: #ffffff;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--card-border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* app-sidebar */
.app-sidebar {
    background: var(--sidebar-bg);
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 101;
    border-right: 1px solid var(--card-border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(19, 24, 44, 0.05);
}

/* main-content app-content */
.main-content.app-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px 24px;
    flex-grow: 1;
    min-height: calc(100vh - var(--header-height) - 60px);
    transition: all 0.3s ease;
}

/* app-footer */
.app-footer {
    margin-left: var(--sidebar-width);
    background: #ffffff;
    border-top: 1px solid var(--card-border-color);
    transition: all 0.3s ease;
    padding: 20px 24px;
    z-index: 99;
}

/* Sidebar Branding Header */
.main-sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--card-border-color);
}

.main-sidebar-header .brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.35rem;
    color: #1a233a;
}

.main-sidebar-header .brand-logo i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 1.5rem;
}

/* Sidebar Menu Navigation */
.main-sidebar .side-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
}

.main-sidebar .side-menu__label-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: #a8afc7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 15px 5px 15px;
}

.main-sidebar .side-menu__item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.main-sidebar .side-menu__item:hover {
    color: var(--primary-color);
    background-color: #f3f6fc;
}

.main-sidebar .side-menu__item.active {
    color: #ffffff;
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(1, 98, 232, 0.2);
}

.main-sidebar .side-menu__icon {
    font-size: 1.1rem;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.main-sidebar .side-menu__item.active .side-menu__icon {
    color: #ffffff !important;
}

/* Custom switchers and active buttons styling */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

/* Card Styling */
.card {
    background-color: #ffffff;
    border: 1px solid var(--card-border-color) !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(19, 24, 44, 0.02) !important;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border-color);
    padding: 18px 24px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a233a;
}

/* Breadcrumb Styling */
.breadcrumb-item a {
    color: var(--primary-color);
}

/* Responsive CSS & Slide Drawer with Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 105;
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-header, .main-content.app-content, .app-footer {
        margin-left: 0 !important;
        left: 0 !important;
    }
    
    /* Touch target optimizations */
    .btn, .form-control, .form-select, .side-menu__item, .dropdown-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .side-menu__item {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

/* Mobile Responsive Cards and Forms */
@media (max-width: 767.98px) {
    .card-header {
        padding: 12px 16px !important;
    }
    .card-body {
        padding: 16px !important;
    }
    .main-content.app-content {
        padding: 16px 12px !important;
    }
    
    /* Tables Card conversion */
    .table-responsive-cards table,
    .table-responsive-cards thead,
    .table-responsive-cards tbody,
    .table-responsive-cards th,
    .table-responsive-cards td,
    .table-responsive-cards tr {
        display: block;
        width: 100% !important;
    }
    .table-responsive-cards thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .table-responsive-cards tr {
        border: 1px solid var(--card-border-color);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 12px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    }
    .table-responsive-cards td {
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding-left: 42% !important;
        padding-right: 12px !important;
        text-align: right !important;
        white-space: normal;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        word-break: break-all;
        overflow-wrap: break-word;
    }
    .table-responsive-cards td:last-child {
        border-bottom: 0;
    }
    .table-responsive-cards td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 38%;
        padding-right: 5px;
        text-align: left;
        font-weight: 700;
        color: #4d5875;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .table-responsive-cards td code,
    .table-responsive-cards td small,
    .table-responsive-cards td span,
    .table-responsive-cards td div,
    .table-responsive-cards td a {
        word-break: break-all !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }
}

/* Safety Pagination SVG Override */
nav svg {
    width: 24px !important;
    height: 24px !important;
    display: inline-block !important;
}

.pagination svg {
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
}

/* Sidebar sub-menus toggle states */
.app-sidebar .slide-menu {
    display: none;
    list-style: none;
    padding-left: 15px;
}

.app-sidebar .slide.open .slide-menu {
    display: block;
}

/* PWA Network Banners Styling */
.pwa-network-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    text-align: center;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pwa-network-banner.offline {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}
.pwa-network-banner.online {
    background-color: #198754 !important;
    color: #ffffff !important;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid #e9edf4;
    display: none !important; /* Managed by media query */
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    padding: 0 10px;
}

/* Dark theme support */
[data-bs-theme="dark"] .mobile-bottom-nav {
    background: rgba(20, 27, 45, 0.9);
    border-top-color: #27314f;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    height: 100%;
    min-height: 44px;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: #0162e8;
}

.mobile-nav-item.active {
    color: #0162e8;
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

[data-bs-theme="dark"] .mobile-nav-item {
    color: #a8b6cc;
}
[data-bs-theme="dark"] .mobile-nav-item.active {
    color: #0162e8;
}

/* PWA Install Promotion Banner Mobile */
.pwa-install-banner-mobile {
    position: fixed;
    bottom: 75px;
    left: 16px;
    right: 16px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.16);
    padding: 14px 18px;
    display: none; /* Controlled dynamically by JS */
    align-items: center;
    justify-content: space-between;
    z-index: 1030;
    border: 1px solid #e9edf4;
    animation: slideUpPwa 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
[data-bs-theme="dark"] .pwa-install-banner-mobile {
    background-color: #1a233a;
    border-color: #27314f;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.pwa-install-banner-mobile.open {
    display: flex !important;
}
.pwa-install-banner-mobile .pwa-banner-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0162e8, #00c6ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(1, 98, 232, 0.3);
}
.pwa-install-banner-mobile .pwa-banner-text {
    flex: 1;
    margin: 0 14px;
}
.pwa-install-banner-mobile .pwa-banner-text h6 {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 800;
    color: #1a233a;
}
[data-bs-theme="dark"] .pwa-install-banner-mobile .pwa-banner-text h6 {
    color: #ffffff;
}
.pwa-install-banner-mobile .pwa-banner-text p {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}
.pwa-install-banner-mobile .pwa-banner-actions {
    display: flex;
    align-items: center;
}
.pwa-install-banner-mobile .pwa-install-btn {
    background-color: #0162e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(1, 98, 232, 0.3);
    white-space: nowrap;
}
.pwa-install-banner-mobile .pwa-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #adb5bd;
    margin-left: 12px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

@keyframes slideUpPwa {
    from { transform: translateY(150px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 991.98px) {
    body, .main-content {
        padding-bottom: 75px !important;
    }
    .mobile-bottom-nav {
        display: flex !important;
    }
    body.modal-open .mobile-bottom-nav,
    body.modal-open .pwa-install-banner-mobile {
        display: none !important;
    }
}



