:root {
    --primary-color: #8a66b7;
    --secondary-color: #66b7b1;
    --body-bg-color: #ececed;
    --card-title-color: #8a66b7;
    --card-text-color: #666;
    --link-color: #8a66b7;

    --icon-color: #66b7b1;
    --table-header-bg: #000;
    --table-header-text: #fff;

    --table-row-hover-bg: #f8f9fa;

}

body {
    background-color: var(--body-bg-color);
    color: var(--secondary-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    width: 100%;
    background-color: var(--primary-color);
}

.navbar {
    width: 100%;
    padding: 0rem;
    margin: 0;
    background-color: var(--primary-color);
}

.navbar .navbar-brand {
    font-size: 1.5rem;
}

.navbar .nav-link {
    line-height: 2rem;
}

.dropdown-menu {
    min-width: 10rem;
}

.navbar-nav {
    display: flex;
    align-items: center;
}

footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    position: relative;
    margin-top: auto;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}


.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}



a {
    color: var(--link-color);
    text-decoration: none;
}

a:disabled,
a[disabled] {
    pointer-events: none;
    cursor: default;
    color: #999;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul li,
ol li {
    padding: 0;
    margin: 0;
}

/* Styles for content section */
.content .card-title {
    color: var(--card-title-color);
}

.content .card-text {
    color: var(--card-text-color);
}

.content .card-body i {
    color: var(--icon-color);
}

/* Table styling */
table.table-hover {
    width: 100%;
    margin-bottom: 40px;
    color: #212529;
    background-color: transparent;
}

table.table-hover th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    padding: 0.75rem;
    text-align: left;
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

table.table-hover td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

table.table-hover tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

/*  */
input.datepicker {
    background-image: url('https://img.icons8.com/ios/50/000000/calendar.png');
    background-size: 20px;
    background-position: right 8px center;
    background-repeat: no-repeat;
    padding-right: 10px;
    /* Adjust padding for icon */
}

/* Timepicker with Clock Icon */
.timepicker {
    background-image: url('https://img.icons8.com/ios/50/000000/clock--v1.png');
    /* Clock icon */
    background-size: 20px;
    background-position: right 8px center;
    background-repeat: no-repeat;
    padding-right: 35px;
    ;
    /* Adjust padding for better spacing */
    cursor: pointer;
}



.readonly-input {
    background-color: #bbb6b6;
    /* Dark gray background */
    color: #fcf8f8;
    /* Light gray text for contrast */
    cursor: not-allowed;
    /* Disable cursor */
    border: 1px solid #444;
    /* Dark border */
    padding: 8px;
    border-radius: 5px;
}

.icon {
    color: var(--icon-color);
    font-size: 25px;
}

/* ========== SIDEBAR STYLES ========== */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    transition: all 0.3s ease;
    position: fixed;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hide overflow on sidebar container */
}

.sidebar.collapsed {
    margin-left: -260px;
}

.sidebar-header {
    padding: 1.5rem;
    /* background-color: hsl(0, 0%, 100%); */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    /* Prevent header from shrinking */
    min-height: 80px;
    /* Ensure minimum height */
}

.sidebar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    margin-right: 0.75rem;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    flex: 1;
    /* Take remaining space */
    overflow-y: auto;
    /* Make menu scrollable */
    overflow-x: hidden;
    /* Hide horizontal scroll */
    max-height: calc(100vh - 80px);
    /* Ensure it doesn't exceed viewport height minus header */
}

/* Custom scrollbar for sidebar */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.sidebar-menu .menu-item {
    position: relative;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu .menu-link:hover,
.sidebar-menu .menu-item.active .menu-link {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.sidebar-menu .menu-icon {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-menu .menu-arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.sidebar-menu .menu-arrow.rotated {
    transform: rotate(90deg);
}

.sidebar-submenu {
    list-style: none;
    padding-left: 3rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-submenu.show {
    max-height: 1000px;
}

.sidebar-submenu .submenu-item {
    position: relative;
}

.sidebar-submenu .submenu-link {
    display: block;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sidebar-submenu .submenu-link:hover,
.sidebar-submenu .submenu-item.active .submenu-link {
    color: white;
}

/* ========== MAIN WRAPPER STYLES ========== */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* margin-left: 260px; */
    transition: margin-left 0.3s ease;
}

.main-wrapper.expanded {
    margin-left: 0;
}

/* ========== TOP NAV STYLES ========== */
.top-nav {
    height: 60px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    width: 100%;
}

/* .top-nav-search {
    max-width: 400px;
    margin-left: 1.5rem;
} */

/* .top-nav-search .form-control {
    border-radius: 20px;
    padding-left: 1.5rem;
} */

.top-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ========== MAIN CONTENT STYLES ========== */
.main-content {
    margin-left: 260px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    position: relative;
    flex: 1;
}

.main-content .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.main-content.expanded {
    margin-left: 0;
}

/* ========== DASHBOARD STYLES ========== */
.dashboard-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    margin-bottom: 1rem;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card .card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.dashboard-card .card-value {
    font-size: 1.75rem;
    font-weight: 600;
}

.dashboard-card .card-change {
    font-size: 0.875rem;
}

/* Responsive styles */
/* For mobile view */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        height: 100vh;
        width: 260px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Prevent scrolling when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* ========== DATATABLES STYLING ========== */
/* Enhanced DataTables Styling */
.dataTables_wrapper {
    padding: 1rem;
}

/* Search Box Styling */
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
}

.dataTables_filter input {
    margin-left: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dataTables_filter input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Length Selector Styling */
.dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_length label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
}

.dataTables_length select {
    margin: 0 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    font-size: 0.875rem;
}

/* Table Styling */
.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background-color: #212529;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #fff;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.data-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Pagination Styling */
.dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #007bff;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #0056b3;
}

.dataTables_paginate .paginate_button.current {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.dataTables_paginate .paginate_button.disabled {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Info Styling */
.dataTables_info {
    margin-top: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dataTables_filter {
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .dataTables_length {
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper {
        padding: 0.5rem;
    }
}

/* Card styling for consistent design */
.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.btn-group .btn {
    border-radius: 0.25rem;
    margin: 0 1px;
}

.fw-medium {
    font-weight: 500;
}

.text-muted {
    color: #6c757d !important;
}

/* muliform stepper */
.custom-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.custom-stepper .step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
    transition: background 0.3s, color 0.3s;
}

.custom-stepper .step.active,
.custom-stepper .step.completed {
    background: #0d6efd;
    color: #fff;
}

.custom-stepper .step-line {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    margin: 0 4px;
    z-index: 1;
    border-radius: 2px;
}

.custom-stepper .step.completed+.step-line {
    background: #0d6efd;
}

.card {
    border-radius: 18px;
}