/* Custom Properties */
:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fc;
    color: #5a5c69;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar Styles */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 10%, #224abe 100%);
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
    transform: translateX(0);
}

#sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
    transform: translateX(-100%);
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li {
    position: relative;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.9rem;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
}

/* Enhanced Active State Styling */
#sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Active state for dropdown parent when child is active */
#sidebar ul li.has-active-child > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* Active state for dropdown items */
#sidebar ul li ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.25);
    border-left-color: #fff;
    font-weight: 600;
    padding-left: 25px;
}

/* Hover effect for active items */
#sidebar ul li.active > a:hover,
#sidebar ul li.has-active-child > a:hover,
#sidebar ul li ul li.active > a:hover {
    background: rgba(255, 255, 255, 0.3);
    border-left-color: #fff;
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Enhanced icon styling for active items */
#sidebar ul li.active > a i,
#sidebar ul li.has-active-child > a i,
#sidebar ul li ul li.active > a i {
    color: #fff;
    font-weight: 600;
}

/* Dropdown Styles */
#sidebar ul li .dropdown-toggle {
    position: relative;
}

#sidebar ul li .dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

#sidebar ul li .dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
}

#sidebar ul li ul {
    background: rgba(0, 0, 0, 0.1);
    padding-left: 20px;
}

#sidebar ul li ul li a {
    padding: 8px 20px;
    font-size: 0.85rem;
    border-left: 2px solid transparent;
}

#sidebar ul li ul li a:hover {
    border-left-color: rgba(255, 255, 255, 0.5);
}

#sidebar ul li ul li a i {
    font-size: 0.8rem;
}

/* Content Styles */
#content {
    width: 100%;
    padding: 0px;
    min-height: 100vh;
    transition: all 0.3s ease;
    background-color: #f8f9fc;
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#content.active {
    margin-left: 0;
    width: 100%;
    flex: 1;
}

/* Ensure container-fluid takes full width */
#content .container-fluid {
    width: 100%;
    max-width: none;
    padding: 10px;
    margin: 0;
}

/* Ensure content takes full available space */
#content > * {
    width: 100%;
}

/* Navbar Styles */
.navbar {
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.2rem;
    width: 100%;
    flex-shrink: 0;
}

.navbar .btn {
    border: none;
    background: transparent;
    color: #5a5c69;
}

.navbar .btn:hover {
    color: var(--primary-color);
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.35rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fc;
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
}

.table td {
    vertical-align: middle;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 0.35rem;
    font-weight: 600;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.35rem;
    border-bottom-left-radius: 0.35rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.35rem;
    border-bottom-right-radius: 0.35rem;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 0.35rem;
    border: 1px solid #d1d3e2;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.35rem;
    font-weight: 600;
}

/* Pagination Styles */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border: none;
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 0;
    border-radius: 0;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
    font-weight: 600;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #224abe;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Enhanced Pagination Controls */
.pagination-sm .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pagination-sm .page-item:first-child .page-link,
.pagination-sm .page-item:last-child .page-link {
    border-radius: 0.2rem;
}

/* Page Size Selector */
.form-select-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Pagination Info */
.pagination-info {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        transform: translateX(-100%);
        position: fixed;
        height: 100vh;
        z-index: 1050;
    }
    
    #sidebar.active {
        margin-left: 0;
        transform: translateX(0);
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    #content.active {
        margin-left: 0;
        width: 100%;
    }
    
    /* Add overlay when sidebar is open on mobile */
    #content.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
}

/* Animation Classes */
.collapse {
    transition: height 0.35s ease;
}

.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Scrollbar Styles */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Card Color Variants */
.card.bg-primary {
    background: linear-gradient(45deg, var(--primary-color), #224abe) !important;
}

.card.bg-success {
    background: linear-gradient(45deg, var(--success-color), #17a673) !important;
}

.card.bg-warning {
    background: linear-gradient(45deg, var(--warning-color), #f4b619) !important;
}

.card.bg-danger {
    background: linear-gradient(45deg, var(--danger-color), #c23d2b) !important;
}

.card.bg-info {
    background: linear-gradient(45deg, var(--info-color), #2a96a4) !important;
}

/* Text Colors */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

/* Background Colors */
.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

/* Border Left Classes for Statistics Cards */
.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 0.25rem solid var(--danger-color) !important;
}

/* Loading Button */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 