/* Dashboard Layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--background-color);
    overflow-x: hidden;
    /* Ensure dashboard pages align to the top-left so the fixed sidebar
       doesn't overlap centered content coming from the global body rule */
    align-items: flex-start;
    justify-content: flex-start;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--card-background);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed {
    left: -100%;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.sidebar-header span {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-section {
    margin: 1.5rem 0;
}

.menu-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.menu-item i {
    font-size: 1.25rem;
}

.menu-item:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.menu-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    /* Reserve space for the fixed sidebar using width calc to avoid horizontal overflow
       when margin-left is applied. This keeps a stable 30/70 split instead of
       allowing the content to expand beyond the viewport. */
    width: calc(100% - 260px);
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease, width 0.3s ease;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 0;
    width: 100%;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar Styles */
.topbar {
    height: 64px;
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: var(--background-color);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    width: 200px;
}

.search-bar i {
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background-color: var(--background-color);
}

.user-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

/* Dashboard Content Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.stats-icon {
    background-color: var(--primary-color-light);
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-icon-element {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 25px;
    color: var(--primary-color);
}

.stats-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stats-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.stats-change.positive {
    color: #10b981;
}

.stats-change.negative {
    color: #ef4444;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

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

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.time-select {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    font-size: 0.875rem;
}

.chart-placeholder img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--background-color);
}

.activity-icon {
    background-color: var(--primary-color-light);
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.view-all {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-all:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        left: -100%;
        width: 280px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar:not(.collapsed) {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        margin-left: 0;
    }

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .search-bar {
        display: none;
    }

    .user-info {
        display: none;
    }

    .topbar {
        padding: 0 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        padding: 1rem;
    }
}

/* New Application Page Styles */
.application-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Loan Type Selection Styles */
.loan-type-section {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    width: 100%;
}

.loan-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Fixed 3 columns for desktop */
    gap: 1rem;
    margin-top: 1rem;
}

.loan-type-option {
    cursor: pointer;
}

.loan-type-option input {
    display: none;
}

.loan-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    height: 150px;
    justify-content: center;
}

.loan-type-card i {
    font-size: 2rem;
    color: var(--text-muted);
}

.loan-type-option input:checked+.loan-type-card {
    border-color: var(--primary-color);
    background-color: var(--primary-color-light);
}

.loan-type-option input:checked+.loan-type-card i {
    color: var(--primary-color);
}

.loan-type-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.disabled-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-section {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.section-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.section-toggle {
    font-size: 1.5rem;
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.section-header.collapsed .section-toggle {
    transform: rotate(0deg);
}

.section-content {
    padding: 1.5rem;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1),
        padding 0.3s ease,
        opacity 0.3s ease;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 1.5rem;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(1, 0, 1, 0),
        padding 0.3s ease,
        opacity 0.3s ease;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 0.5rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-value {
    font-weight: 500;
    color: var(--text-color);
    word-break: break-word;
}

.button-group {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.primary-button,
.secondary-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

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

.secondary-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

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

@media (max-width: 768px) {
    .form-grid {
        display: block !important;
    }

    h2 {
        font-size: 17px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .button-group {
        flex-direction: column;
    }

    .loan-type-options {
        grid-template-columns: 1fr;
        /* Stack vertically on mobile */
    }
}

/* Passport Photo Upload Styles */
.passport-upload {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background-color: var(--background-color);
    overflow: hidden;
}

.passport-upload:hover {
    border-color: var(--primary-color);
}

.passport-upload input[type="file"] {
    display: none;
}

.passport-upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.passport-upload-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0 0.5rem;
}

.passport-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.passport-upload.has-image .passport-upload-icon,
.passport-upload.has-image .passport-upload-text {
    display: none;
}

.passport-upload.has-image:hover::after {
    content: 'Click to change';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem;
    text-align: center;
}

.form-grid-with-photo {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .form-grid-with-photo {
        grid-template-columns: 1fr;
    }

    .passport-upload {
        margin: 0 auto;
    }
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
}

/* Select Input Styles */
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    width: 100%;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Full Width Fields */
.form-group[style*="grid-column: span 2"] input {
    width: 100%;
}

/* Number Input Styles */
.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Official Use Section Styles */
.official-use-section {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.official-use-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Currency Input Styles */
.form-group input[type="number"] {
    padding-left: 2rem;
    position: relative;
}

.form-group.currency {
    position: relative;
}

.form-group.currency::before {
    content: "₦";
    position: absolute;
    left: 0.75rem;
    top: 2.25rem;
    color: var(--text-muted);
}

/* Update the existing form-group styles */
.form-group input[type="number"],
.form-group input[type="text"] {
    width: 100%;
}

/* Guarantor Type Selection Styles */
.guarantor-type-selection {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Undertaking Section Styles */
.undertaking-section {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.undertaking-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.undertaking-section p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.undertaking-section .form-group {
    margin-bottom: 1rem;
}

/* Transition for field switching */
.business-fields,
.civil-servant-fields {
    transition: all 0.3s ease;
    grid-column: span 2;
}

/* Signature Upload Styles */
.signature-upload-section {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.signature-upload-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.signature-instruction {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.signature-upload {
    width: 300px;
    height: 100px;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background-color: white;
    overflow: hidden;
}

.signature-upload:hover {
    border-color: var(--primary-color);
}

.signature-upload input[type="file"] {
    display: none;
}

.signature-upload-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.signature-upload-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.signature-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.signature-upload.has-image .signature-upload-icon,
.signature-upload.has-image .signature-upload-text {
    display: none;
}

.signature-upload.has-image:hover::after {
    content: 'Click to change';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem;
    text-align: center;
}

@media (max-width: 768px) {
    .signature-upload {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Add overlay styles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1025px) {
    .sidebar-overlay {
        display: none;
    }
}

/* Menu Toggle Icon Transition */
.menu-toggle i {
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    background-color: var(--background-color);
}

/* Applications Page Styles */
.applications-container {
    padding: 1.5rem 1.5rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Filter Section */
.filter-section {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.filter-group {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.filter-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.875rem;
}

.filter-tab i {
    font-size: 1.25rem;
}

.filter-tab .count {
    background-color: var(--background-color);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.filter-tab.active {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}

.filter-tab.active .count {
    background-color: var(--primary-color);
    color: white;
}

.filter-actions {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.search-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    flex: 1;
}

.search-filter input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
}

.search-filter i {
    color: var(--text-muted);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-button:hover {
    background-color: var(--background-color);
}

/* Applications Table */
.applications-table-wrapper {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.applications-table {
    width: 100%;
    border-collapse: collapse;
    min-width: auto;
}

.applications-table th,
.applications-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.applications-table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.client-info div {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 500;
}

.client-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.approved {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.rejected {
    background-color: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

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

/* Pagination */
.pagination-section {
    /* Two-column grid: info keeps its natural width, controls take remaining space */
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 1rem;
    /* slightly larger for readability */
    white-space: nowrap;
    /* prevent the info text from wrapping/shrinking */
    flex: 0 0 auto;
    /* don't allow the info to shrink when controls are wide */
}

.pagination-controls {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    /* keep page buttons right-aligned */
    flex-wrap: wrap;
    /* allow wrapping on narrow screens */
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: none;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

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

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .applications-table-wrapper {
        overflow-x: auto;
    }

    .applications-table {
        min-width: 1000px;
    }

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

    .filter-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .filter-button {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .pagination-section {
        flex-direction: column;
        gap: 0;
        align-items: unset;
        text-align: center;
    }

    .pagination-controls {
        gap: 0;
    }
}

/* Client Selection Styles */
.client-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: white;
    font-size: 0.875rem;
    color: var(--text-color);
}

.notice-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.notice-box.warning {
    background-color: #fff7ed;
    border: 1px solid #fdba74;
}

.notice-box.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
}

.notice-box i {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.notice-box.warning i {
    color: #f97316;
}

.notice-box.info i {
    color: #3b82f6;
}

.notice-box p {
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0;
}

.notice-box.warning p {
    color: #9a3412;
}

.notice-box.info p {
    color: #1e40af;
}

.notice-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notice-extra {
    font-size: 0.813rem;
    opacity: 0.9;
}

.notice-box a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.notice-box a:hover {
    opacity: 0.8;
}

/* Client Form Container */
.client-form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Client Selection Spacing */
.client-selection {
    margin-bottom: 2rem;
}

/* Client Pages Common Styles */
.clients-container,
.client-profile-container,
.client-loans-container,
.repayment-history-container {
    padding: 1.5rem;
}

/* Client Table Styles */
.clients-table-wrapper {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
    min-width: auto;
}

.clients-table th,
.clients-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.clients-table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.client-contact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Client Profile Styles */
.client-header {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-basic-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.client-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.client-details h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.client-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.separator {
    color: var(--border-color);
}

.client-actions {
    display: flex;
    gap: 1rem;
}

/* Tabs Styles */
.tabs-container {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    flex: 1;
    text-align: center;
    min-width: fit-content;
}

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    padding: 1.5rem;
}

/* Info Grid Styles */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background-color: var(--background-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-card-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.info-card-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 500;
}

/* Client Mini Profile */
.client-mini-profile {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-mini-profile .client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-mini-profile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.client-mini-profile h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Loans Summary */
.loans-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.summary-title {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
}

/* Date Range Styles */
.date-range {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.date-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

/* Status Badge Styles */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .client-header {
        flex-direction: column;
        gap: 1rem;
    }

    .client-actions {
        width: 100%;
    }

    .client-actions button {
        flex: 1;
    }

    .date-range {
        flex-direction: column;
        width: 100%;
    }

    .date-range .form-group {
        width: 100%;
    }

    .date-input {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .loans-summary {
        grid-template-columns: 1fr;
    }

    .client-mini-profile {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .client-mini-profile .client-info {
        flex-direction: column;
    }
}

/* Mobile Responsive Tables */
@media (max-width: 768px) {

    .applications-table tbody tr,
    .clients-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }

    .applications-table thead,
    .clients-table thead {
        display: none;
    }

    .applications-table td,
    .clients-table td {
        border: none;
        padding: 0.5rem 0;
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .applications-table td::before,
    .clients-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        min-width: 100px;
        flex-shrink: 0;
    }

    .applications-table td[data-label="Select"],
    .clients-table td[data-label="Select"] {
        display: none;
    }

    .applications-table td[data-label="Actions"],
    .clients-table td[data-label="Actions"] {
        padding: 0.5rem 0 0 0;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .applications-table td[data-label="Actions"]::before,
    .clients-table td[data-label="Actions"]::before {
        display: none;
    }

    .applications-table td[data-label="Status"],
    .clients-table td[data-label="Status"] {
        margin-right: 0;
    }

    .action-buttons {
        display: flex;
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        padding: 0.5rem;
        background-color: var(--background-color);
    }

    /* Client Mini Profile Responsive Styles */
    .client-mini-profile {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }

    .client-mini-profile .client-info {
        flex-direction: column;
        align-items: center;
    }

    .client-mini-profile .secondary-button {
        width: 100%;
        text-align: center;
    }

    /* Filter Section Mobile Styles */
    .filter-group {
        padding: 0.75rem 1rem;
    }

    .filter-tabs {
        margin: 0;
        padding: 0.5rem;
        gap: 0.5rem;
        flex-direction: column;
        width: 100%;
    }

    .filter-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: space-between;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        background-color: var(--background-color);
    }

    .filter-tab.active {
        border-color: var(--primary-color);
        background-color: var(--primary-color-light);
    }

    .filter-tab i {
        font-size: 1.25rem;
    }

    .filter-tab .count {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        background-color: white;
        border-radius: 999px;
    }

    /* Smaller screens */
    @media (max-width: 480px) {
        .filter-tab {
            padding: 0.625rem 0.875rem;
            font-size: 0.813rem;
        }
    }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
    .applications-container {
        padding: 1rem;
    }

    .client-mini-profile h2 {
        font-size: 1.25rem;
    }

    .action-btn {
        padding: 0.375rem;
        font-size: 1.125rem;
    }

    .pagination-section {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}

/* Reports Container Styles */
.reports-container {
    padding: 1.5rem;
}

/* Reports Grid */
.reports-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.summary-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background-color: var(--primary-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.card-info .amount {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-info .period {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Reports Table */
.reports-table-wrapper {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
}

.reports-table th,
.reports-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.reports-table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Statistics Page Styles */
.statistics-container {
    padding: 1.5rem;
}

.period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

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

.stat-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.stat-period {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.stat-chart {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    color: var(--text-muted);
}

/* Metrics Section */
.metrics-section {
    margin-top: 2rem;
}

.metrics-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.metric-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background-color: var(--primary-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

/* Responsive Styles */
@media (max-width: 1024px) {

    .summary-cards,
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filter-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .period-selector {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .period-btn {
        white-space: nowrap;
    }

    .reports-table-wrapper {
        overflow-x: auto;
    }

    .reports-table {
        min-width: 800px;
    }
}

@media (max-width: 640px) {

    .summary-cards,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .stat-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .stat-period {
        width: 100%;
    }
}

/* Settings Page Styles */
.settings-container {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

.settings-nav {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    text-align: left;
}

.settings-nav-item i {
    font-size: 1.25rem;
}

.settings-nav-item:hover {
    background-color: var(--background-color);
}

.settings-nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

.settings-content {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.settings-header {
    margin-bottom: 2rem;
}

.settings-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.settings-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.company-logo-upload {
    width: 150px;
    height: 150px;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.company-logo-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.company-logo-upload:hover .upload-overlay {
    opacity: 1;
}

.upload-overlay i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Staff Management Styles */
.staff-management-container {
    padding: 1.5rem;
}

.staff-table-wrapper {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
}

.staff-table th,
.staff-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.staff-table th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.staff-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.staff-info div {
    display: flex;
    flex-direction: column;
}

.staff-name {
    font-weight: 500;
}

.staff-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-info .email {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s ease;
}

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

.action-btn.delete {
    color: #ef4444;
}

.action-btn.delete:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .filter-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .staff-table-wrapper {
        overflow-x: auto;
    }

    .staff-table {
        min-width: 800px;
    }

    .staff-table td[data-label="Contact"] {
        white-space: nowrap;
    }
}

/* Add/Update these styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-content {
    flex: 1;
}

.header-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.header-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Update the responsive styles */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-header .primary-button {
        width: 100%;
        justify-content: center;
    }
}

/* Update the Settings Page Styles */
.settings-container {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

/* Add/Update Responsive Styles for Settings */
@media (max-width: 1024px) {
    .settings-container {
        grid-template-columns: 200px 1fr;
        gap: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .settings-nav {
        margin-bottom: 1rem;
    }

    .settings-nav-item {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .settings-content {
        padding: 1rem;
    }

    .settings-header {
        margin-bottom: 1.5rem;
    }

    .settings-header h2 {
        font-size: 1.125rem;
    }

    .company-logo-upload {
        width: 120px;
        height: 120px;
        margin: 0 auto 1rem;
    }

    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .button-group button {
        width: 100%;
    }

    .form-section {
        padding: 0.75rem;
    }

    /* Adjust form groups that span 2 columns */
    .form-group[style*="grid-column: span 2"] {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .settings-container {
        padding: 0.75rem;
    }

    .settings-nav-item {
        font-size: 0.813rem;
    }

    .settings-header p {
        font-size: 0.813rem;
    }

    .form-group label {
        font-size: 0.813rem;
    }

    .form-group input,
    .form-group select {
        padding: 0.625rem;
        font-size: 0.813rem;
    }
}

/* Add media query for mobile */
@media (max-width: 768px) {
    .loan-type-options {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }
}

/* Add responsive padding for mobile */
@media (max-width: 768px) {
    .application-container {
        padding: 0 1rem;
    }
}

/* Toast Container */
.submit-btn {
    display: flex;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast Notification */
.toast {
    background-color: #1a5f7a;
    /* Darker blue background */
    border-left: 4px solid #66fcf1;
    /* Bright cyan accent */
    padding: 12px 24px 12px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    color: #66fcf1;
    /* Bright cyan */
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 2px;
    color: white;
    /* White text */
}

.toast-message {
    font-size: 0.813rem;
    color: rgba(255, 255, 255, 0.8);
    /* Slightly transparent white */
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: #66fcf1;
    /* Bright cyan */
    width: 100%;
    transform-origin: left;
    animation: progress 5s linear;
    /* Update to 5 seconds */
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.validation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.validation-content {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    /* Maximum height of 80% of viewport height */
}

.validation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #ef4444;
}

.validation-header i {
    font-size: 1.5rem;
}

.validation-body {
    margin-bottom: 1.5rem;
    max-height: calc(80vh - 140px);
    /* Account for header and button */
    overflow-y: auto;
    padding-right: 0.5rem;
}

#validationList {
    margin-top: 1rem;
    padding-left: 1.5rem;
    color: #ef4444;
}

.submit-btn {
    width: 100%;
}

.validation-dialog button {
    width: auto;
    margin-left: auto;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.form-group.error input,
.form-group.error select {
    border-color: #ef4444;
}

.form-group.error label {
    color: #ef4444;
}

/* Add custom scrollbar styles */
.validation-body::-webkit-scrollbar {
    width: 6px;
}

.validation-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.validation-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.validation-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Amount Input Styles */
.form-group.currency {
    position: relative;
}

.form-group.currency input {
    padding-left: 30px;
    /* Make room for the currency symbol */
}

.form-group.currency::before {
    content: "₦";
    position: absolute;
    left: 10px;
    top: 37px;
    /* Adjust based on your layout */
    color: var(--text-muted);
    font-weight: 500;
}

/* Phone Input Styles */
.form-group.phone input {
    font-family: monospace;
    /* Makes it easier to read phone numbers */
}

.form-group.phone input::placeholder {
    font-family: var(--font-family);
    /* Reset placeholder font */
}

.remaining-errors {
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
    list-style-type: none;
}

/* Add these styles for the dialog */
.dialog-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.dialog-header.success {
    color: #28a745;
}

.dialog-header.error {
    color: #dc3545;
}

.dialog-header .bx {
    font-size: 24px;
}

.dialog-body {
    margin-bottom: 1rem;
}

#dialogMessage {
    margin-bottom: 1rem;
}

/* Application View Styles */
.application-view-container {
    padding: 1.5rem;
}

.status-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.status-banner.draft {
    background-color: #fff7ed;
    border: 1px solid #fdba74;
}

.status-banner.pending {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
}

.status-banner.approved {
    background-color: #d1fae5;
    border: 1px solid #6ee7b7;
}

.status-banner.rejected {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-content i {
    font-size: 1.5rem;
}

.status-details h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.status-details p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.submit-application-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.details-section {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.details-section .section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.details-section .section-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.details-section .section-header h3 {
    font-size: 1rem;
    margin: 0;
}

.details-content {
    padding: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Pagination layout guard (override any conflicting rules) */
.pagination-section {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    gap: 1rem !important;
}

.pagination-info {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

.pagination-controls {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.25rem !important;
    flex-wrap: wrap !important;
}

@media (max-width: 480px) {
    .pagination-section {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .pagination-controls {
        justify-content: center !important;
    }
}

.detail-item .value {
    font-weight: 500;
    text-align: right;
}

.client-header,
.guarantor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.client-photo,
.guarantor-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.client-basic-info h4,
.guarantor-basic-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.client-basic-info p,
.guarantor-basic-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.guarantor-signature {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .status-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .status-content {
        flex-direction: column;
    }

    .submit-application-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Status Control Styles */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-control {
    position: relative;
}

.status-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-background);
    appearance: none;
    font-size: 0.875rem;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.status-control::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-color);
    pointer-events: none;
}

/* Print Styles */
@media print {

    .header-actions,
    .sidebar,
    .topbar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .details-grid {
        display: block !important;
    }

    .details-section {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}

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

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

/* Update the existing header-actions styles */
.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Add these new responsive styles */
@media (max-width: 768px) {
    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* Two buttons per row */
        width: 100%;
        gap: 0.75rem;
    }

    .header-actions>* {
        width: 100%;
        /* Make all buttons full width within their grid cell */
    }

    .status-control {
        grid-column: 1 / -1;
        /* Make status control span full width */
    }

    .status-select {
        width: 100%;
    }

    /* Make buttons consistent height and layout */
    .header-actions .primary-button,
    .header-actions .secondary-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem;
        white-space: nowrap;
        text-align: center;
    }
}

/* Additional adjustments for very small screens */
@media (max-width: 480px) {
    .header-actions {
        gap: 0.5rem;
    }

    .header-actions .primary-button,
    .header-actions .secondary-button {
        font-size: 0.813rem;
        padding: 0.625rem;
    }
}

/* Loan Repayments Styles */
.repayments-container {
    padding: 1.5rem;
}

.loan-summary-header {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.client-img img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.loan-details {
    display: flex;
    gap: 2rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Loan Summary Header Mobile Styles */
    .loan-summary-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }

    .client-info {
        width: 100%;
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }

    .loan-details {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Repayments Table Mobile Styles */
    .repayments-table {
        border: 0;
    }

    .repayments-table thead {
        display: none;
    }

    .repayments-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        background: white;
    }

    .repayments-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }

    .repayments-table td:last-child {
        border-bottom: 0;
    }

    .repayments-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        text-align: left;
    }

    .repayments-table td .action-buttons {
        margin-left: auto;
    }

    /* Status Badge Adjustments */
    .repayments-table td .status-badge {
        margin-left: auto;
    }

    /* Action Buttons Adjustments */
    .action-header {
        padding: 0 0 1rem 0;
    }

    .action-header .primary-button {
        width: 100%;
        justify-content: center;
    }
}

/* Additional adjustments for very small screens */
@media (max-width: 480px) {
    .loan-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .detail-item {
        width: 100%;
    }
}

/* Update the Repayments Table Mobile Styles */
@media (max-width: 768px) {
    .repayments-table-wrapper {
        overflow-x: auto;
    }

    .repayments-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }

    .repayments-table thead {
        display: none;
    }

    .repayments-table td {
        border: none;
        padding: 0.5rem 0;
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .repayments-table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        min-width: 120px;
        flex-shrink: 0;
    }

    .repayments-table td[data-label="Actions"] {
        padding: 0.5rem 0 0 0;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    .repayments-table td[data-label="Actions"]::before {
        display: none;
    }

    .repayments-table td[data-label="Status"] {
        margin-right: 0;
    }

    .action-buttons {
        display: flex;
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        padding: 0.5rem;
        background-color: var(--background-color);
    }
}

.action-header {
    display: flex;
    width: 100%;
}

.action-header button {
    margin-left: auto;
}

/* Add these styles after the existing .loan-details styles */

.loan-breakdown {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.breakdown-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breakdown-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.breakdown-item.total {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color);
}

.breakdown-item.total .breakdown-value {
    color: var(--primary-color);
}

.breakdown-item.monthly {
    background-color: #d1fae5;
    border-color: #6ee7b7;
}

.breakdown-item.monthly .breakdown-value {
    color: #065f46;
}

/* Update the existing loan-summary-header styles */
.loan-summary-header {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.loan-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .loan-summary-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }

    .loan-details {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

@media (max-width: 480px) {
    .loan-details {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .detail-item {
        width: 100%;
        align-items: center;
    }
}

/* Imprest Page Styles */
.imprest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.balance-overview {
    margin-bottom: 2rem;
}

.balance-card {
    background-color: var(--background-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-info h3 {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
}

.balance-actions {
    display: flex;
    gap: 1rem;
}

.transactions-section {
    background-color: var(--background-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

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

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.transactions-table-wrapper {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.transactions-table th {
    font-weight: 500;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .balance-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .balance-actions {
        width: 100%;
        justify-content: center;
    }

    .transactions-table {
        display: block;
    }

    .transactions-table thead {
        display: none;
    }

    .transactions-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
    }

    .transactions-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border-bottom: none;
    }

    .transactions-table td::before {
        content: attr(data-label);
        font-weight: 500;
    }
}

/* Add these styles to the existing dashboard.css */

/* Imprest Styles */
.imprest-container {
    padding: var(--content-padding);
    width: 100%;
}

.balance-overview {
    margin-bottom: 2rem;
}

.balance-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-info h3 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
}

.balance-actions {
    display: flex;
    gap: 1rem;
}

.transactions-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

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

.section-header h2 {
    font-size: 1.25rem;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Dialog Styles */
.dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.dialog-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.25rem;
}

/* Form Currency Input */
.form-group.currency {
    position: relative;
}

.form-group.currency input {
    padding-left: 2rem;
}

.form-group.currency:before {
    content: "₦";
    position: absolute;
    left: 0.75rem;
    top: 2.75rem;
    color: var(--text-muted);
}

/* Status Badge Modifiers */
.status-badge.credit {
    background-color: var(--success-light);
    color: var(--success-dark);
}

.status-badge.debit {
    background-color: var(--danger-light);
    color: var(--danger-dark);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .balance-card {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }

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

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

    .dialog-content {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
}

.no-access-card {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
    width: 90%;
    /* Set width to 90% of its container */
    margin-left: auto;
    margin-right: auto;
}

.no-access-card h3 {
    color: #721c24;
    margin-bottom: 0.5rem;
}

.no-access-card p {
    color: #721c24;
}