/* Custom Properties */
:root {
    --primary-color: #387090;
    --primary-color-dark: #2c3e50;
    --secondary-color: #415b76;
    --secondary-color-dark: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --sidebar-width: 280px;
}

/* Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--text-color);
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.3rem;
}

.mobile-close {
    display: block;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-color);
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: var(--primary-color);
    color: white;
}

.nav-links .active a {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem;
    width: 100%;
    transition: margin-left 0.3s ease-in-out;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.quick-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.quick-actions .btn i {
    font-size: 1.5rem;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-section .lead {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Feature Section */
.feature-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
}

.card-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    color:white;
}

.card-container-title {
    font-weight: 600;
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .card-container-title {
        font-size: 1.2rem;
    }
}

@media (min-width: 768px) {
    .card-container-title {
        font-size: 1.5rem;
    }
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
}

.card-title {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}
.card-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.card-footer .btn {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
}

.card-footer .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.card-footer .btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
}

.card-footer .btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid #ddd;
}

.card-footer .btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: var(--success-color);
    color: white;
}

.alert-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

/* Badge Styles */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.bg-success {
    background-color: var(--success-color);
    color: white;
}

.bg-danger {
    background-color: var(--danger-color);
    color: white;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-color-dark);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Utility Classes */
.mt-4 {
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

/* Row and Column Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-md-6 {
    width: 100%;
    padding: 0.75rem;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-section {
        grid-template-columns: 1fr;
    }

    .table {
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        padding-right: 1rem;
    }
}

/* Desktop Styles */
@media (min-width: 768px) {
    .sidebar {
        left: 0;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .col-md-6 {
        width: 50%;
    }

    .mobile-close {
        display: none;
    }
}

/* Form Styles */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
}

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

.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Select Styles */
select.form-control {
    padding-right: 2.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Textarea Styles */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Form Row */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.form-row > .form-group {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    flex: 1;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Form Validation */
.form-control.is-invalid {
    border-color: var(--danger-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--danger-color);
}

/* Date Input Styles */
input[type="date"].form-control {
    min-height: 2.5rem;
}

/* Checkbox and Radio Styles */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.25rem;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid #ddd;
    appearance: none;
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25rem;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Small Screens */
@media (max-width: 767px) {
    .form-row {
        flex-direction: column;
    }

    .form-row > .form-group {
        margin-right: 0;
        margin-left: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-form .form-group {
    flex: 1;
    min-width: 200px;
}

.filter-form .form-group a, .filter-form .form-group button {
    width: auto;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color:white;
    text-decoration: none;
    transition: all 0.2s;
    height: 50px;
}

.filter-form .form-group a:hover, .filter-form .form-group button:hover {
    background-color: var(--primary-color);
    color: white;
}

.search-container {
    display: flex;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem 0 0 0.375rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0 0.375rem 0.375rem 0;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 2px solid var(--primary-color);
}

.search-button:hover {
    background-color: var(--primary-color-dark);
}
/* search container for mobile */
@media (max-width: 767px) {
    .search-container {
        flex-direction: column;
    }
    .search-input,
    .search-button {
        border-radius: 0.25rem;
    }
    .search-container .form-group {
        width: 100%;
    }

    .search-form {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        margin-left: 0.5rem;
    }

    .search-form input {
        width: 90%;
    }

    .search-form button {
        width: 10%;
    }
}

.transaction-form-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.transaction-form-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
}




/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: #f7fafc;
    color: var(--text-color);
}

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


/* Transaction Type Styles */
.transaction-type-buttons {
    display: flex;
    gap: 1rem;
}

.transaction-type-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.transaction-type-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.transaction-type-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.transaction-type-input {
    display: none;
}

/* --- Style Select2 to look like the input field --- */

/* Main container and selected value display */
.select2-container--default .select2-selection--single {
    background-color: #fff;                     /* White background */
    border: 1px solid #ced4da;              /* Light grey border */
    border-radius: 0.25rem;                 /* Slightly rounded corners (adjust as needed) */
    height: auto;                           /* Adjust height automatically based on content and padding */
    min-height: calc(1.5em + 0.75rem + 2px);/* Set a minimum height (like Bootstrap's default input height) */
    padding: 0.375rem 0.75rem;              /* Standard padding (adjust as needed) */
    line-height: 1.5;                       /* Line height for vertical alignment */
    box-shadow: none;                       /* Remove default Select2 shadows */
    outline: 0;                             /* Remove outline */
    box-sizing: border-box;                 /* Include padding and border in the element's total width and height */
}

/* Text of the selected item */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057;                         /* Dark grey text color */
    line-height: 1.5;                       /* Match container line height */
    padding-left: 0;                        /* Reset default padding */
    padding-right: 20px;                    /* Ensure space for the dropdown arrow */
    overflow: hidden;                       /* Hide overflow */
    text-overflow: ellipsis;                /* Add ellipsis (...) if text is too long */
    white-space: nowrap;                    /* Prevent text wrapping */
}

/* Placeholder text style */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;                         /* Lighter grey for placeholder */
}

/* Dropdown arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.75rem);          /* Match the calculated height */
    position: absolute;
    top: 1px;                               /* Position adjustment */
    right: 5px;                              /* Position adjustment */
    width: 20px;
}

/* Adjust arrow symbol position */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #888 transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

/* Style when the dropdown is open/focused */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #888 transparent;
    border-width: 0 4px 5px 4px; /* Arrow points up */
}

/* Focus style - mimics Bootstrap's focus outline */
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); /* Blue glow */
}

/* Ensure the Select2 container takes available width */
.select2-container {
    width: 100% !important; /* Force full width */
    box-sizing: border-box;
}

/* --- Optional: Basic Dropdown Styling --- */

/* Dropdown panel */
.select2-dropdown {
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); /* Subtle shadow */
    box-sizing: border-box;
    margin-top: 2px; /* Small gap */
}

/* Search input inside dropdown */
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    margin: 5px;
    box-sizing: border-box;
}

/* Options list */
.select2-results__options {
    max-height: 200px;
    overflow-y: auto;
}

/* Individual result option */
.select2-results__option {
    padding: 0.375rem 0.75rem;
    user-select: none;
    -webkit-user-select: none;
}

/* Hovered/highlighted option */
.select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd; /* Example blue highlight */
    color: white;
}

/* Mobile Styles for Filter Form */
@media (max-width: 767px) {
    .filter-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-form .form-group {
        width: 100%;
        min-width: unset;
        margin-bottom: 0.5rem;
    }

    .filter-form .form-group label {
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }

    .filter-form .form-control {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .filter-form .form-group:last-child {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .filter-form .form-group:last-child button,
    .filter-form .form-group:last-child a {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.9rem;
        text-align: center;
    }
}

/* Remove old date range button styles */
.date-range-buttons {
    display: none;
}

/* Date range select styles */
.date-range-inputs {
    display: none;
    margin-bottom: 1rem;
}

/* Mobile styles for date range select */
@media (max-width: 767px) {
    .date-range-inputs {
        width: 100%;
    }
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    background-color: white;
}

.auth-container button {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1rem;
    padding: 15px 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label{
    margin-bottom: 0.5rem;
}
