/* ========================================
   MODERN SIDEBAR LAYOUT STYLES
   ======================================== */

/* Body Layout with Sidebar */
body.modern-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation Bar - Fixed */
body.modern-layout #header.navbar,
#header.navbar {
    height: 64px;
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

/* Force horizontal alignment for navbar items */
.navbar .d-flex,
#header .d-flex {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.navbar .d-flex > *,
#header .d-flex > * {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    align-items: center !important;
}

.navbar .dropdown,
#header .dropdown {
    display: inline-flex !important;
    position: relative;
}

.navbar .icon_wrap,
#header .icon_wrap {
    display: inline-flex !important;
    align-items: center !important;
}

.navbar .navbar-brand,
#header .navbar-brand {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar .navbar-brand img,
#header .navbar-brand img {
    height: 50px !important;
    width: auto !important;
}

/* Sidebar - Fixed Left - Zynix Style */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 240px;
    height: calc(100vh - 64px);
    overflow-y: hidden;
    overflow-x: hidden;
    z-index: 1020;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.875rem 1.5rem;
    font-size: 15px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    margin: 0.25rem 0.75rem;
    border-radius: 6px;
}

.sidebar .nav-link i,
.sidebar .nav-link svg {
    width: 24px;
    margin-right: 28px;
    font-size: 17px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-link::after {
    content: '›';
    font-size: 20px;
    color: #dee2e6;
    margin-left: auto;
    transition: all 0.2s ease;
    pointer-events: none;
    line-height: 1;
}

.sidebar .nav-link:hover::after {
    color: #F85914;
    transform: translateX(3px);
}

.sidebar .menu_item.current_item .nav-link::after,
.sidebar .menu_item .nav-link.current_item::after {
    color: #F85914;
}

/* Hide arrow for dropdown menu items */
.sidebar .dropdown_toggle .nav-link::after {
    display: none;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #F85914;
    border-left-color: transparent;
    text-decoration: none;
    transform: translateX(2px);
    border-left: 3px solid #F85914;
}

.sidebar .menu_item.current_item .nav-link,
.sidebar .menu_item .nav-link.current_item {
    background-color: #fff5f0;
    color: #F85914;
    border-left-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(248, 89, 20, 0.1);
}

/* Sidebar Dropdown */
.sidebar .dropdown {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
}

.sidebar .dropdown_inner_wrap {
    position: relative;
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: 0.25rem;
}

.sidebar .dropdown_inner_wrap::before {
    display: none;
}

.sidebar .dropdown_list_item {
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    border-bottom: none;
    font-size: 14px;
}

.sidebar .dropdown_list_item:hover {
    background-color: #e9ecef;
}

/* Main Content Area */
body.modern-layout .main-content {
    margin-left: 240px;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    background-color: #f5f7fb;
    padding: 0;
}

.content-wrapper {
    padding: 2rem;
}

/* Footer Adjustment */
body.modern-layout footer {
    margin-left: 240px;
}

/* ========================================
   ZYNIX-STYLE CARD CONTAINERS
   ======================================== */

/* Enhanced Card Design */
.card,
.table-container {
    background: #ffffff;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.card:hover,
.table-container:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Card Header */
.card-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

/* Card Body */
.card-body {
    padding: 1.5rem;
}

/* Table Container - Zynix Style */
.table-container {
    overflow: hidden;
}

/* Universal Table Card Wrapper */
table {
    width: 100%;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

/* Modern Table Styling */
table.fully_mobile,
table {
    border: none;
    margin-bottom: 0;
}

table.fully_mobile th,
table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem 0.75rem !important;
}

table.fully_mobile td,
table td {
    border-top: 1px solid #f0f0f0;
    padding: 0.875rem 0.75rem !important;
    vertical-align: middle;
}

table.fully_mobile tr:nth-child(2n),
table tbody tr:nth-child(2n) {
    background-color: #fafafa;
}

table.fully_mobile tr:hover,
table tbody tr:hover {
    background-color: #f0f7ff;
    transition: background-color 0.15s ease;
}

/* Remove heavy borders */
table.fully_mobile,
table.fully_mobile th,
table.fully_mobile td,
table,
table th,
table td {
    border-color: #f0f0f0;
}

/* Wrapper for tables to add card styling */
.page_wrap table,
.content-wrapper table,
.main-content table {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

/* ========================================
   BUTTON STYLES - Orange Accent Only
   ======================================== */

.btn {
    background: #F85914;
    border: 2px solid #F85914;
    color: #fff;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #d24d14;
    border-color: #d24d14;
    color: #fff;
    box-shadow: 0 4px 8px rgba(248, 89, 20, 0.25);
}

/* ========================================
   BOOTSTRAP DROPDOWN OVERRIDES
   ======================================== */

/* Sidebar collapse submenu styling */
.sidebar .collapse {
    background: #f8f9fa;
    padding: 0.25rem 0;
}

.sidebar .submenu-item {
    padding: 0.5rem 1.5rem 0.5rem 3.5rem !important;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent !important;
    margin: 0.25rem 0.75rem;
    border-radius: 6px;
}

.sidebar .submenu-item:hover {
    background-color: #e9ecef;
    color: #F85914;
    text-decoration: none;
}

.sidebar .submenu-item::after {
    display: none !important;
}

/* Top bar dropdown styling - Proper positioning */
.navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    margin-top: 0.5rem;
    z-index: 1050;
}

.navbar .dropdown-item {
    padding: 0.75rem 1rem;
    color: #464646;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

.navbar .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #F85914;
}

/* Dropdown toggle arrow */
.dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* Hide arrow for sidebar dropdowns */
.sidebar .dropdown-toggle::after {
    display: none;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 991px) {
    /* Hide sidebar on mobile */
    .sidebar {
        transform: translateX(-100%);
    }
    
    /* Remove sidebar margin on mobile */
    body.modern-layout .main-content,
    body.modern-layout footer {
        margin-left: 0;
    }
    
    /* Mobile menu overlay (existing burger menu) */
    .menu_wrap {
        position: fixed;
        display: flex;
        flex-direction: column;
        background: #fff;
        max-width: 320px;
        width: 100%;
        height: calc(100% - 64px);
        top: 64px;
        overflow-y: auto;
        right: -370px;
        transition: all 0.3s ease-in-out;
        border-left: 1px solid #dbd9d2;
        z-index: 1025;
    }
    
    .menu_wrap.active {
        right: 0;
    }
    
    .mobile-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu .menu_item a {
        display: block;
        padding: 1rem 1.5rem;
        color: #464646;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-menu .menu_item a:hover {
        background-color: #f8f9fa;
        color: #F85914;
        text-decoration: none;
    }
}

@media (min-width: 992px) {
    /* Hide mobile menu on desktop */
    .menu_wrap {
        display: none;
    }
}

/* ========================================
   CONTENT SPACING & CARDS
   ======================================== */

.page_wrap {
    max-width: 100%;
    padding: 0;
}

/* Card-style containers for content sections */
.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: box-shadow 0.2s ease;
}

/* ========================================
   FORM IMPROVEMENTS
   ======================================== */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
select.form-control {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #F85914;
    box-shadow: 0 0 0 0.2rem rgba(248, 89, 20, 0.15);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.bg-light {
    background-color: #f5f5f5 !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}

.border-light {
    border-color: #e0e0e0 !important;
}

/* Orange accent for active states */
.text-primary,
.text-orange {
    color: #F85914 !important;
}

.border-primary,
.border-orange {
    border-color: #F85914 !important;
}

.bg-primary-light {
    background-color: #fff5f0 !important;
}

/* ========================================
   DASHBOARD SPECIFIC STYLES
   ======================================== */

.dashboard-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Equal height dashboard columns */
.row > [class*='col-'] {
    display: flex;
}

.row > [class*='col-'] > .dashboard-card {
    width: 100%;
}

.dashboard-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.dashboard-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.dashboard-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dashboard-menu-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.dashboard-menu-item:hover {
    background: #fff5f0;
    color: #F85914;
    text-decoration: none;
    transform: translateX(4px);
}

.dashboard-menu-item i {
    font-size: 12px;
    color: #F85914;
}

.btn-outline-primary {
    color: #F85914;
    border-color: #F85914;
}

.btn-outline-primary:hover {
    background: #F85914;
    border-color: #F85914;
    color: #fff;
}
