/* ==================== SIDEBAR STYLES ==================== */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#sidebar {
    min-width: 280px;
    max-width: 280px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
}

#sidebar.active {
    margin-left: -280px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-header h5 {
    color: #fff;
}

#sidebar .sidebar-logo {
    font-size: 2.5rem;
    color: #ffd700;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

#sidebar ul li a i {
    font-size: 1.2rem;
    width: 25px;
    margin-right: 15px;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #ffd700;
    text-decoration: none;
}

#sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #ffd700;
    font-weight: 600;
}

#sidebar ul li a.active-sub {
    background: rgba(255, 215, 0, 0.1);
    border-left-color: #ffd700;
}

/* Submenu items */
#sidebar ul ul a {
    padding: 10px 20px 10px 60px !important;
    font-size: 0.85rem !important;
    background: rgba(0, 0, 0, 0.2);
}

#sidebar ul ul a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Dropdown arrow animation */
#sidebar .dropdown-toggle::after {
    display: block;
    position: absolute;
    right: 20px;
    transition: transform 0.3s;
}

#sidebar .active > .dropdown-toggle::after {
    transform: rotate(90deg);
}

/* Sidebar scrollbar */
#sidebar::-webkit-scrollbar {
    width: 5px;
}

#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 footer */
#sidebar .sidebar-footer {
    margin-top: auto;
}

/* ==================== CONTENT STYLES ==================== */
#content {
    width: calc(100% - 280px);
    margin-left: 280px;
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

#content.active {
    width: 100%;
    margin-left: 0;
}

/* ==================== NAVBAR STYLES ==================== */
.navbar {
    padding: 15px 20px;
    border-bottom: 1px solid #e3e6f0;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-badge {
    font-size: 0.6rem !important;
    padding: 0.25em 0.4em !important;
}

.notification-dropdown {
    width: 300px;
    padding: 0;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.notification-item i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 35px;
    border-radius: 20px;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* ==================== DASHBOARD CARDS ==================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background: none;
    border-bottom: 1px solid #e3e6f0;
    padding: 15px 20px;
}

.border-left-primary {
    border-left: 4px solid #4e73df;
}

.border-left-success {
    border-left: 4px solid #1cc88a;
}

.border-left-warning {
    border-left: 4px solid #f6c23e;
}

.border-left-info {
    border-left: 4px solid #36b9cc;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -280px;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: 280px;
    }
    
    .search-box input {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .navbar-brand span {
        font-size: 0.9rem;
    }
    
    .search-box {
        display: none;
    }
}

/* ==================== TABLE STYLES ==================== */
.table th {
    background-color: #f8f9fc;
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* ==================== FORM STYLES ==================== */
.form-control:focus, .form-select:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* ==================== BUTTON STYLES ==================== */
.btn {
    border-radius: 5px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    background: none;
    padding: 10px 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: #4e73df;
    text-decoration: none;
}

/* ==================== FOOTER ==================== */
.footer {
    margin-top: auto;
    border-top: 1px solid #e3e6f0;
}
/* Icon circles for stat cards */
.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle i {
    font-size: 1.5rem;
}

.bg-primary-light {
    background-color: rgba(78, 115, 223, 0.1);
}

.bg-success-light {
    background-color: rgba(28, 200, 138, 0.1);
}

.bg-warning-light {
    background-color: rgba(246, 194, 62, 0.1);
}

.bg-info-light {
    background-color: rgba(54, 185, 204, 0.1);
}

/* Gradient background for welcome card */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Card with left border */
.border-left-primary {
    border-left: .25rem solid #4e73df !important;
}

.border-left-success {
    border-left: .25rem solid #1cc88a !important;
}

.border-left-warning {
    border-left: .25rem solid #f6c23e !important;
}

.border-left-info {
    border-left: .25rem solid #36b9cc !important;
}

/* Text sizing */
.text-xs {
    font-size: .7rem;
}

/* Smooth transitions */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15) !important;
}

/* Table improvements */
.table-sm td, .table-sm th {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* List group improvements */
.list-group-item {
    border-left: 0;
    border-right: 0;
    padding: 0.75rem 1.25rem;
}

.list-group-item:first-child {
    border-top: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .h5 {
        font-size: 1rem;
    }
}
/* ==================== PAGE LAYOUT FIX ==================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

#content {
    width: calc(100% - 280px);
    margin-left: 280px;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    background: #f8f9fc;
    position: relative;
}

#content.active {
    width: 100%;
    margin-left: 0;
}

/* Main content area that grows to push footer down */
.main-content {
    flex: 1 0 auto;
    padding-bottom: 30px;
}

/* Container fluid inside main content */
.main-content .container-fluid {
    padding-left: 25px;
    padding-right: 25px;
}

/* Footer stays at bottom */
.sacco-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Fix for chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Fix for cards with fixed heights */
.content-card {
    display: flex;
    flex-direction: column;
}

.content-card .content-card-body {
    flex: 1;
    overflow: hidden;
}

/* Fix for scrollable areas */
.scrollable-list {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fix for table responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fix for row gutters */
.row.g-3 {
    --bs-gutter-y: 1rem;
}

/* Ensure cards don't overflow */
.card, .content-card, .stat-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive fixes */
@media (max-width: 768px) {
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: 280px;
    }
    
    .main-content .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
}