.next-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 12px;
    color: #166534;
}

.next-badge .info-icon {
    width: 32px;
    height: 32px;
    background: #dcfce7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #15803d;
    flex-shrink: 0;
}

.next-text strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #15803d;
    margin-bottom: 2px;
}

.text-ms {
    font-size: 0.9rem;
    font-weight: 500;
}@import url('profile.css');

:root {
    --primary-color: #4f46e5;
    --secondary-color: #4338ca;
    --text-color: #1f2937;
    --light-bg: #f3f4f6;
    --white: #ffffff;
    --sidebar-width: 250px;
    --danger-color: #e53e3e; /* Rojo para deudas */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1.5rem;
    z-index: 1100;
    background: #4f46e5;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    background: #4338ca;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Responsive Styles - Moved to bottom */

/* Responsive Styles - Moved to main block */

/* Sidebar base styles */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    z-index: 1000;
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 1.5rem 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 20px;
}

.sidebar.sidebar-animated {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 0 2rem 2rem 2rem;
    background-color: #f8fafc; /* Lighter base */
    background-image: 
        radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    /* Transition removed from base */
}

.main-content.sidebar-animated {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar styles - Moved to main block */

/* Responsive Styles */
@media screen and (max-width: 600px) {
    /* Sidebar handling consolidated in 768px block */
        
    .notes-form {
        flex-direction: column;
    }
    
    .add-note-btn {
        width: 100%;
        padding: 12px;
    }

    .btn-calc   {
        top: 0 !important;
    }

    .tlt-btn-create h3 {
        text-align: left!important;
        width: 100%;
    }

    .tlt-btn-create {
        flex-direction: column;
        gap: 1rem;
    }

    .calculator-form, .form-group {
        gap: 0 !important;
    }

}

.sidebar-header {
    padding: 0 1.75rem 1.25rem 1.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 0.12em;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.logo::before {
    content: 'KREDIX';
    position: absolute;
    top: 0;
    left: 0;
    color: var(--secondary-color);
    z-index: -1;
    filter: blur(6px);
    opacity: 0.4;
    transform: scale(1.02);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--primary-color) 100%);
    border-radius: 1px;
    opacity: 0.6;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.2);
}

.sidebar-nav {
    padding: 1.25rem 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.4rem;
    margin: 0.1rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.22s ease;
    gap: 0.75rem;
    border-radius: 0.9rem;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-item .nav-icon i,
.nav-item .nav-icon svg,
.nav-item i {
    color: #6b7280;
    transition: inherit;
}

.nav-item::before {
    content: "";
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 0.22s ease, height 0.22s ease;
}

.nav-item:hover {
    background: #eef2ff;
    transform: translateX(4px);
    color: #111827;
}

.nav-item:hover .nav-icon i,
.nav-item:hover .nav-icon svg,
.nav-item:hover i {
    color: #4f46e5;
}

.nav-item:hover::before {
    background: rgba(165, 180, 252, 0.85);
}

.nav-item.active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

.nav-item.active .nav-icon i,
.nav-item.active .nav-icon svg,
.nav-item.active i {
    color: #f9fafb;
}

.nav-item.active::before {
    background: #bfdbfe;
    height: 24px;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.nav-icon i,
.nav-icon svg {
    font-size: 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
}

.btn-primary i {
    margin-right: 0.5rem;
}

.sidebar-footer {
    padding: 1.25rem 1.75rem 1.75rem 1.75rem;
    border-top: 1px solid #e5e7eb;
}

.btn-logout {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    background: #f3f4f6;
    color: #374151;
    border-radius: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.22s ease;
}

.btn-logout .nav-icon i {
    color: inherit;
}

.btn-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -2rem 2rem -2rem;
    padding: 2.5rem 3rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #ffffff;
    /* Professional 'Graph Paper' Grid Background - Cleaner & Larger */
    background-image: 
        linear-gradient(to right, #f1f5f9 1px, transparent 1px),
        linear-gradient(to bottom, #f1f5f9 1px, transparent 1px);
    background-size: 40px 40px; /* Larger squares for elegance */
    position: relative;
}

/* Elegant accent gradient line at top */
.content-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.header-welcome {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.name-username h1 {
    font-size: 2.25rem;
    color: #0f172a; /* Darker slate for contrast */
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

/* Remove previous side bar element */
.name-username h1::before {
    display: none;
}

#user {
    font-size: 0.75rem; /* Reduced from 0.9rem */
    color: #4f46e5;
    font-weight: 600;
    background: #eef2ff;
    padding: 0.15rem 0.5rem; /* Reduced padding significantly */
    border-radius: 999px;
    width: fit-content;
    border: 1px solid #e0e7ff;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

#user::before {
    content: none; /* Removed duplicate '@' */
}

.date {
    color: #64748b;
    font-size: 0.75rem; /* Reduced from 0.8rem */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.3rem 0.6rem; /* Further reduced padding */
    border-radius: 6px; /* Tighter radius */
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    width: fit-content;
    margin-top: 0.25rem; /* Reduced margin */
    transition: transform 0.2s;
}

.date:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.date::before {
    content: '\f073'; /* Calendar icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900; /* Solid style */
    color: #6366f1;
    font-size: 0.85rem; /* Smaller icon */
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 0.45rem;
}

.modal .btn-sm { height: 40px; }

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

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Recent Activity */
.recent-activity {
    background: #fff;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.recent-activity h2 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 1rem;    
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: scroll;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
    opacity: 1;
    visibility: visible;
    display: block;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 0.75rem;
    position: relative;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
    border: 1px solid #e5e7eb;
}

#updateLoanModal .modal-content {
    max-width: 560px;
}

#updateLoanModal .modal-content h2 {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

#updateLoanModal .form-group.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

#updateLoanModal .form-group.two-cols .col {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

#updateLoanModal input[type="number"],
#updateLoanModal input[type="date"] {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#updateLoanModal input[type="number"]:focus,
#updateLoanModal input[type="date"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

#updateLoanModal .btn-primary {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

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

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Responsive Design - Consolidated */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.profile-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-info h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.info-group label {
    display: block;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.info-group p {
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

/* Estilos para el botón de búsqueda */
.btn-secondary {
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 40px;
    background-color: var(--light-bg);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    gap: .5rem;
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

.search-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: relative;
}

/* Improved Suggestions Dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    max-height: 250px;
    overflow-y: auto;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s;
}

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

.suggestion-item:hover {
    background-color: #f8fafc;
    padding-left: 1.25rem; /* Slight shift effect */
}

/* Selected Client Card Styling */
#selectedClientInfo .wizard-input-container {
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

#selectedClientInfo .wizard-input-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#selectedClientInfo .wizard-input-icon i {
    color: #16a34a !important;
    font-size: 1.75rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#selectedClientInfo .form-control-static {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: #14532d;
    line-height: 1.2;
}

#selectedClientInfo #clientUsername {
    margin-top: 0.25rem;
    display: block;
    color: #4f46e5 !important;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
    font-size: 0.85rem !important;
}

.suggestion-meta {
    color: #6b7280;
    font-size: 0.875rem;
}

.search-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.search-container input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}
.info-display {
    padding: 0.5rem;
    background: #f3f4f6;
    border-radius: 0.375rem;
    margin-top: 0.25rem;
}

.borrower-info {
    background: #fff;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

.activity-item {
    background: #f9fafb;
    padding: 0.9rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    border: 1px solid #f0f0f0;
}

.activity-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.activity-date {
    color: #6b7280;
    font-size: 0.75rem;
}

.loans-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 1.5rem;
    padding: 1rem;
}

.loans-section {
    display: flex;
    flex-direction: column;
    gap: .5rem !important;
}

.loans-cards-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .loans-cards-container { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}

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

@media (max-width: 600px) {
    .loans-grid {
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    .no-loans {
        font-size: .9rem;
        color: #333333b6;
    }

}

.payments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.loan-card {
    background: white;
    border-radius: 16px;
    padding: 1rem 1rem 0.75rem 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.payment-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e5e7eb;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
}

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

.payment-info-label {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.payment-info-value {
    font-size: 0.85rem;
    color: #334155;
    font-weight: 600;
    word-break: break-all;
    line-height: 1.4;
}

.payment-key-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-family: monospace;
    font-size: 0.9em;
}

.loan-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #22c55e);
}

.loan-card.archived {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
    width: 100%;
}

.loan-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.archive-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: .25rem;
    border-radius: .5rem;
}

.archive-btn:hover {
    background-color: #f3f4f6;
}

.loan-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.loan-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.loan-status.paid {
    background: #e5e7eb;
    color: #4b5563;
}

.loan-status.archived {
    background: #fee2e2;
    color: #b91c1c;
}

.loan-details {
    margin-bottom: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.loan-details p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.installments {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.installments .pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
}

.installments .count {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: .8rem;
    font-weight: 600;
}

.loan-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    justify-content: flex-start;
}

.progress {
    background: #e5e7eb;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin: .5rem 0 .75rem 0;
}

.progress .bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    width: 0%;
    transition: width .3s ease;
}

.progress.emphasized {
    /* box-shadow and background removed to allow per-bar styling */
}

.progress.emphasized.green-phase {
    /* Removed global green phase glow */
}

.progress.emphasized .bar {
    background: linear-gradient(90deg, #22c55e, #16a34a, #15803d);
}

.installments-line .count-label {
    font-weight: 600;
    color: #0f172a;
    margin-right: .25rem;
}

.installments-line .percent-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    margin-left: .35rem;
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.installments-line .percent-pill.green-pill {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.highlight-paid {
    font-size: 1rem;
    font-weight: 800;
}

.btn-restore {
    margin-left: .5rem;
    padding: .25rem .5rem;
    border: none;
    border-radius: .375rem;
    background: #10b981;
    color: #fff;
    font-size: .75rem;
    cursor: pointer;
}

.btn-restore:hover {
    background: #059669;
}

.btn-payment, .btn-status, .btn-delete, .btn-update, .btn-notes {
    flex: 0 0 auto;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn {
    width: 40px;
    height: 40px;
}

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

.btn-status {
    background: var(--light-bg);
    color: var(--text-color);
}

.btn-delete {
    background: #dc2626;
    color: #fff;
}

.btn-update {
    background: #059669;
    color: white;
}

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

.btn-status:hover {
    background: #e5e7eb;
}

.btn-update:hover {
    background: #047857;
}

/* Estilos para el select de método de pago */
select#paymentMethod {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.3s ease;
}

select#paymentMethod:hover {
    border-color: #4f46e5;
}

select#paymentMethod:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

select#paymentMethod option {
    padding: 8px;
    font-size: 14px;
}

/* CARD */

.debt {
    color: #dc2626;
    background-color: #dc262615;
    padding: .5rem 0;
    text-align: center;
    border-radius: 10px;
}

.mi {
    color: var(--primary-color);
    background-color: #4338ca15;
    padding: .5rem 0;
    text-align: center;
    border-radius: 10px;
}

/* Estilos para la sección de inversiones */
.investments-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(auto, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Estilos mejorados para la tabla */
.investment-table-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.table-header h3 {
    color: var(--primary-color);
    margin: 0;
}

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

@media (max-width: 768px) {
    .table-container-calc {
        overflow-x: scroll;
        width: 340px;
    }

    .content-section.active {
        padding: 0 .5rem;
    }
}

.btn-export, .btn-refresh {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-export {
    background: #10b981;
    color: white;
}

.btn-refresh {
    background: #6366f1;
    color: white;
}

.btn-export:hover {
    background: #059669;
}

/* Payments Section Styles */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.section-title-wrapper h2 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
}

.empty-state-custom {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-state-text {
    font-size: 1.1rem;
}

.btn-refresh:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.investment-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

.investment-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0.75rem;
    text-align: center;
    font-weight: 600;
    border: none;
}

.investment-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.investment-table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.totals-row th {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
}

.summary-row td {
    background: #f3f4f6;
    font-weight: 600;
    color: var(--primary-color);
    padding: 1rem 0.75rem;
}

.grand-total-value {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    font-size: 1.1rem;
    font-weight: bold;
}

.investment-table tfoot {
    font-weight: 600;
    background-color: #f3f4f6;
}

.investment-table tfoot th {
    border-top: 2px solid #e5e7eb;
    color: var(--primary-color);
}

/* Estilos para el footer de la tabla de cuentas */
.investment-table tfoot th:first-child {
    text-align: right;
}

/* Estilos para el total ganancia */
.investment-table tfoot th.total-ganancia {
    color: #10b981;
}

/* Estilos para los valores en COP */
.investment-table .cop-value {
    font-size: 0.95rem;
    color: #374151;
}

/* Resumen de cuentas */
.accounts-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.summary-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Updated Button Styles and Action Layout */
.loan-actions {
    display: flex !important;
    gap: 0.5rem !important;
    padding-top: 0.5rem !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
}

.btn-payment, .btn-status, .btn-delete, .btn-update, .btn-notes {
    flex: 0 0 auto;
    padding: 0 !important;
    border: none;
    border-radius: 12px !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 40px !important;
    height: 40px !important;
}

.btn-payment svg, .btn-status svg, .btn-delete svg, .btn-update svg, .btn-notes svg {
    width: 20px;
    height: 20px;
}

.icon-btn {
    width: 40px !important;
    height: 40px !important;
}

.btn-payment {
    background: #e0e7ff !important;
    color: #4338ca !important;
}

.btn-status {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.btn-delete {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.btn-update {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.btn-notes {
    background: #f3f4f6 !important;
    color: #374151 !important;
}

.btn-payment:hover, .btn-status:hover, .btn-delete:hover, .btn-update:hover, .btn-notes:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.method-box .value {
    font-size: 0.85rem !important;
}

.days-late-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.summary-card.personal {
    border-left: 4px solid #3b82f6;
}

.summary-card.madre {
    border-left: 4px solid #ec4899;
}

.summary-card.hermano {
    border-left: 4px solid #10b981;
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.summary-card.personal .summary-icon {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.summary-card.madre .summary-icon {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: white;
}

.summary-card.hermano .summary-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.summary-content h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.summary-amount {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    color: var(--primary-color);
}

.summary-content small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Mobile Responsive Styles - MUST BE AT THE END */
@media screen and (max-width: 768px) {
    .sidebar-toggle {
        display: flex !important;
        position: fixed;
        bottom: 1rem;
        right: 15px;
        z-index: 1100;
        background: #4f46e5;
        color: white;
        width: 45px;
        height: 45px;
        border-radius: 12px;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
        border: none;
        cursor: pointer;
        z-index: 995;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 250px; /* Ensure width is fixed */
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0,0,0,0.1);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 0 0 2rem 0;
    }

    .users-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .users-filter-bar input,
    .users-filter-bar select,
    .users-filter-bar button {
        width: 100% !important;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        margin: 0 0 2rem 0;
    }
    
    .loan-header h3 {
        font-size: 1rem;
    }
    
    /* Modal defaults on mobile */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }

    /* Full-width modals on mobile (sin bordes redondeados) */
    #shareModal .modal-content,
    #paymentModal .modal-content,
    #deleteLoanModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
    }
}

.pending-income {
    font-size: 0.75rem;
    color: #059669;
    margin: 0.25rem 0 0 0;
    font-weight: 500;
    opacity: 0.8;
}

/* Estilos responsive */
@media screen and (max-width: 768px) {
    .investments-container {
        grid-template-columns: 1fr;
    }

    .investment-table {
        display: block;
        overflow-x: auto;
    }

    .investment-table th,
    .investment-table td {
        min-width: 150px;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .accounts-summary {
        grid-template-columns: 1fr;
    }
}

/* PAGOS */

.empty-state {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notifications-container {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.upcoming-payments {
    margin-top: 15px;
    font-size: .9rem;
}

.notification-client {
    display: flex;
    flex-direction: column;
}

.client-username {
    font-size: .9rem;
    color: var(--secondary-color);
    margin-top: -.4rem;
}

.payment-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin: 10px 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eef2ff;
    box-shadow: 0 3px 8px rgba(15,23,42,0.04);
    transition: transform 0.12s ease;
}

.payment-notification.urgent {
    border-left-color: #ef4444;
    background: #fff5f5;
}

.payment-notification:hover {
    transform: translateY(-2px);
}

.payment-notification .notification-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef2ff 0%, #f8f9ff 100%);
    color: #4f46e5;
    margin-right: 12px;
    font-size: 18px;
}

.payment-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-notification .notification-client {
    display: flex;
    flex-direction: column;
}

.payment-notification .notification-header h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
}

.payment-notification .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    margin-left: 8px;
}

.payment-notification .badge.today {
    background: linear-gradient(90deg,#ffd6a5,#ffb4a2);
    color: #7c2d12;
}

.notification-amount {
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(90deg,#f0f9ff,#eef2ff);
    padding: 8px 12px;
    border-radius: 10px;
}

.notification-info {
    flex: 1;
}

.notification-time {
    color: #64748b;
    font-size: 0.9em;
}

.notification-amount {
    font-weight: 600;
    color: #4f46e5;
}

.notification-amount.urgent {
    color: #ef4444;
}


/* NOTAS */

.btn-notes {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notes-container {
    padding: 20px;
}

.notes-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .notes-form {
        flex-direction: column;
    }
    .add-note-btn {
        width: 100%;
        padding: 12px; /* Larger touch target */
    }
}

@media (max-width: 480px) {
    .notes-form {
        flex-direction: column;
    }
    .add-note-btn {
        width: 100%;
        padding: 12px; /* Área de toque más grande para móvil */
    }
}

.note-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.add-note-btn {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.notes-list {
    max-height: 300px;
    overflow-y: auto;
}

.note-item {
    background-color: #f8f9fa;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-item small {
    color: #666;
    font-size: 0.8em;
}

.delete-note {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
}

.no-notes {
    text-align: center;
    color: #666;
}
.loan-calculation {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
    border: 1px solid #e5e7eb;
}

.calculation-title {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.calculation-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.calc-item:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.calc-label {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.calc-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1rem;
}

.calc-item.total {
    background: #4f46e5;
    color: white;
}

.calc-item.total .calc-label,
.calc-item.total .calc-value {
    color: white;
}

.calc-item.highlight {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
}

.calc-item.highlight .calc-value {
    color: #0369a1;
}

.daily-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 6px;
    border-left: 4px solid #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.daily-note p {
    line-height: 1;
    font-size: .8rem;
}

.daily-note i {
    color: #d97706;
}

.daily-note small {
    color: #92400e;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .content-header {
        padding: 0rem;
    }

    .calc-item {
        flex-direction: column;
    }

    .daily-note p {
        line-height: 1;
        font-size: .9rem;
    }

    .loan-calculation {
        padding: 1rem;
    } 

    .notes-container {
        padding: 0;
    }

    .notes-list {
        max-height: 300px;
        overflow-y: auto;
    }

    .notes-list p {
        font-size: .9rem;
    }

    .note-item {
        flex-direction: column;
    }

    .note-item p {
        font-size:.9rem;
        text-align: start;
        line-height: 1;
        margin-bottom: .5rem;
    }

    .note-item small {
        font-size: .7rem;
    }

    .delete-note {
        position: absolute;
        bottom: .1rem;
        right: .5rem;
        margin-top: 0.5rem;
    }

    .no-notes {
        text-align: start;
    }

    .swal2-title {
        font-size: 1.2rem;
        text-align: start;
    }

    .swal2-html-container {
        padding: 1.2rem;
    }

}

.search-lender {
    margin-bottom: 2rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-container input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.result-info span {
    color: #666;
    font-size: 0.9em;
}

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

.no-results, .no-loans, .error {
    padding: 1rem;
    text-align: center;
    color: #666;
}

.error {
    color: #dc3545;
}

/* CHAT */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    margin: 1rem 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.chat-input {
    display: flex;
    gap: 1rem;
}

.chat-input textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
}

.message {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    max-width: 80%;
}

.own-message {
    background: #007bff;
    color: white;
    margin-left: auto;
}

.other-message {
    background: #e9ecef;
    margin-right: auto;
}

.message-sender {
    font-size: 0.8rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.2rem;
}

.message-content {
    margin: 0;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.2rem;
    text-align: right;
}

/* CALC */

.calculator-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(79,70,229,0.08);
    border: 1px solid #eef2ff;
    margin-bottom: 20px;
}


.calculator-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-bottom: 0.75rem;
    }

    .name-username h1 {
        font-size: 2.2rem;
        flex-wrap: wrap;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    #user {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .date {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .calculator-form { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .calculator-form { grid-template-columns: 1fr; }
}

.calculation-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
    display: none;
}

.calculation-result.show {
    display: block;
}


.btn-calc   {
    background: linear-gradient(90deg, #5b4ff0 0%, #6c43f2 100%);
    color: white;
    padding: 0.6rem 1.2rem;
    height: 44px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    align-self: center;
    box-shadow: 0 6px 18px rgba(79,70,229,0.12);
}

.btn-calc:active { transform: translateY(1px); }

.calculator-form .form-group input::placeholder {
    font-size: 0.8rem;
    color: #9ca3af;
}

.calculator-form .form-group input,
.calculator-form .form-group select {
    height: 44px;
    border-radius: 10px;
    padding: 0 12px;
    border: 1px solid #e8eaef;
    background: #fff;
}

/* Style date inputs to match others */
.calculator-form input[type="date"] {
    height: 44px;
    padding: 0 12px;
}


/* Usuario temporal */

.tlt-btn-create {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.temp-user-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(17,24,39,0.06);
    margin-bottom: 20px;
}

.temp-users-list {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.input-group {
    text-align: start;
}

.input-group label {
    font-size: .9rem;
}

.temp-user-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .3rem .75rem;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fafafa;
    transition: background-color 0.2s;
}

.temp-user-item:hover {
    background-color: #f8fafc;
}

.temp-user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.temp-user-name {
    font-weight: 600;
    color: #2c3e50;
}

.temp-user-phone {
    color: #666;
    font-size: 0.9em;
}

.temp-user-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.status-temporal {
    background: #fde68a;
    color: #92400e;
    height: 24px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .75rem;
}

.temp-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.btn-delete-temp {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-delete-temp:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-delete-temp:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-item.disabled {
    cursor: not-allowed;
    position: relative;
}

.nav-item.disabled::after {
    content: '🔒';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

.nav-item.disabled:hover {
    background: rgba(0, 0, 0, 0.05);
}


/* USERS */

.users-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.user-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-right: 1.5rem;
}

.user-info {
    width: 100%;
}

.user-info h3 {
    margin: 0;
    color: #1f2937;
}

.username {
    color: #6b7280;
    font-size: 0.9rem;
}

.user-details {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-details span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    background: #e5e7eb;
    color: #374151;
}

.status-badge.active {
    background: #c7d2fe;
    color: #4f46e5;
}

.btn-toggle-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background: #4f46e5;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.btn-toggle-status:hover {
    background: #4338ca;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-delete {
    background: #ef4444;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-delete i {
    font-size: 0.875rem;
}

.current-user-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.875rem;
}

.phone-tipoUser {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.phone-tipoUser span {
    font-size: .9rem;
}

.nut {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 600px) {
    .users-container {
        padding: 0;
    }
    .user-details {
        flex-direction: column;
        gap: 0;
    }
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    width: 100%;
}

.no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.no-results p {
    font-size: 1rem;
}

.search-container input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-container input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* RECARGAR PAGE */

.reload-button {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease, pulseShadow 2s infinite;
}

@keyframes pulseShadow {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

.reload-button:hover {
    background: #4338ca;
    transform: translateX(-50%) translateY(-2px);
    animation: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.reload-button i {
    font-size: 1rem;
}

.reload-button:hover {
    background: #4338ca;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
    .reload-button {
        top: 1.5rem;
        z-index: 0;
    }
}

/* Estilos para formularios de inversión */
.investment-form-container,
.accounts-form-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.investment-form, .accounts-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.investment-form-container h3,
.accounts-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4b5563;
    font-weight: 500;
}

/* Estilos para filas de formulario */
.form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Vista previa de inversión */
.investment-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.investment-preview h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

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

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-item.total {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    font-weight: 600;
}

.preview-label {
    font-weight: 500;
    color: #64748b;
}

.preview-item.total .preview-label {
    color: rgba(255, 255, 255, 0.9);
}

.preview-value {
    font-weight: 600;
    color: var(--primary-color);
}

.preview-item.total .preview-value {
    color: white;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.form-input:disabled,
.form-input[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-submit:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* Estilos para el select de alquiler */
.accounts-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

/* Resumen de cuentas */
.account-summary-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.account-summary-container h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.summary-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #6366f1);
}

/* ==========================================================================
   Financial Analysis Section Modern Styles
   ========================================================================== */

/* Financial Section Header */
.financial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.financial-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin: 0;
}

/* Modern Refresh Button */
.btn-refresh-modern {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto;
}

.btn-refresh-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.15);
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.btn-refresh-modern:active {
    transform: translateY(0);
}

.btn-refresh-modern i {
    font-size: 1rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .financial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .financial-header h2 {
        width: 100%;
    }
    
    .financial-header .btn-refresh-modern {
        width: 100%;
        justify-content: center;
    }
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.card-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.metric.total {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.metric .label {
    color: #64748b;
    font-size: 0.9rem;
}

.metric .value {
    font-weight: 600;
    color: #1e293b;
}

.metric .value.gain {
    color: #10b981;
}

.percentage {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.percentage-value {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

/* Responsive form styles */
@media screen and (max-width: 768px) {
    .investment-form-container,
    .accounts-form-container {
        margin-bottom: 1.5rem;
    }

    .investment-form, .accounts-form {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin: 0.3rem;
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .btn-submit {
        margin-top: 1rem;
    }

    .investment-table-container {
        overflow-x: scroll;
    }

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

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

/* Savings Section */
.savings-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.total-saved-card {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.total-saved-card:hover {
    transform: translateY(-5px);
}

.total-saved-card .card-header {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.total-saved-card .card-value {
    font-size: 2.5rem;
    font-weight: bold;
}

.savings-form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.savings-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.savings-form .form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.savings-form .btn-submit {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.savings-form .btn-submit:hover {
    background: var(--primary-color);
}

.savings-form .btn-submit:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.buttons-savings, .buttons-credits {
    display: flex;
    gap: 10px;
    align-items: center;
}

.savings-table-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.savings-table {
    width: 100%;
    margin-top: 1.5rem;
}

.savings-table th,
.savings-table td {
    padding: 1rem;
    text-align: left;
}

.savings-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.savings-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.savings-table .cop-value {
    font-weight: 500;
}

.savings-table tfoot tr:first-child {
    background: #f8f9fa;
    font-weight: 600;
}

.savings-table tfoot tr:last-child {
    background: white;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .savings-container {
        grid-template-columns: 1fr;
    }

    .total-saved-card {
        padding: 1.5rem;
    }

    .total-saved-card .card-value {
        font-size: 2rem;
    }

    .buttons-savings {
        flex-direction: column;
    }
}

/* Debts Section */
.debts-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.total-debt-card {
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.total-debt-card .card-header {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.total-debt-card .card-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.total-debt-card .card-description {
    font-size: 0.9rem;
    opacity: 0.8;
}

.debts-form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.debts-form h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.debts-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.debts-form .form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.debts-table-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: scroll;
}

.debts-table-container h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.table-actions {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.table-actions button {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-actions button:hover {
    background: var(--danger-color);
}

.debts-table {
    width: 100%;
    margin-top: 1rem;
}

.debts-table th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
}

.debts-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.debts-table .cop-value {
    font-weight: bold;
    color: var(--danger-color);
}

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

.debts-table .action-btn {
    padding: 0.3rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: opacity 0.2s;
}

.debts-table .edit-btn {
    background: var(--warning-color);
    color: white;
}

.debts-table .delete-btn {
    background: var(--danger-color);
    color: white;
}

.debts-table .action-btn:hover {
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .debts-container {
        grid-template-columns: 1fr;
    }
    
    .debts-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .debts-form-container,
    .debts-table-container {
        padding: 1rem;
    }
    
    .total-debt-card {
        padding: 1rem;
    }
    
    .total-debt-card .card-value {
        font-size: 2rem;
    }
}





/* Botones de acción mejorados - más pequeños y modernos */
.btn-edit, .btn-delete {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0.2rem;
    min-width: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-edit {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-edit:active, .btn-delete:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Iconos en los botones */
.btn-edit i, .btn-delete i {
    font-size: 0.7rem;
}

/* Contenedor de acciones para mejor alineación */
td .btn-edit, td .btn-delete {
    margin: 0.1rem;
}

.btn-action {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-action i {
    font-size: 12px;
}

.btn-action:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Estilos para la sección de Réditos */
.credits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    margin-left: auto;
    margin-right: auto;
}

.total-credits-card {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: fit-content;
    grid-column: 1 / 2;
    text-align: center;
}

.credits-form-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    grid-column: 2 / 3;
}

.credits-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.buttons-credits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.credits-table-container,
.credits-table,
.credits-table th,
.credits-table td {
    display: none;
}

/* Estilos para el botón de advertencia */
.btn-warning {
    background-color: var(--light-bg);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Estilos responsivos */
@media (max-width: 1024px) {
    .credits-container {
        display: flex;
        flex-direction: column;
    }
    
    .buttons-credits {
        flex-direction: column;
    }
    
    .btn-warning {
        width: 100%;
    }

}

@media (max-width: 768px) {
    #accountsTable {
        min-width: 800px;
    }
    
    #accountsTable th,
    #accountsTable td {
        padding: 4px 3px;
        font-size: 0.75em;
    }
    
    .status-badge {
        font-size: 0.7em;
        padding: 2px 6px;
        min-width: 60px;
    }
}

/* Estilos para campos automáticos (readonly) */
.form-input[readonly] {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.form-input[readonly]:focus {
    box-shadow: none;
    border-color: #e9ecef;
}

.form-group label small {
    font-size: 0.75em;
    color: #6c757d;
    font-weight: normal;
    margin-left: 5px;
}

/* Mejorar vista previa con campos automáticos */
.investment-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.investment-preview h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1em;
}

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

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.preview-item.total {
    font-weight: bold;
    background-color: rgba(76, 175, 80, 0.1);
    padding: 10px;
    border-radius: 4px;
    border-bottom: none;
}

.preview-label {
    font-weight: 500;
    color: #495057;
}

.preview-value {
    color: #28a745;
    font-weight: 600;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.credits-form-container,
.credits-table-container {
    animation: fadeIn 0.3s ease-out;
}
.modal-content h2 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

/* --- NEW DASHBOARD STYLES (PRESTAMOS SECTION) --- */

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.header-icon {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 1.5rem;
}

.header-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.header-text p {
    color: #6b7280;
    margin: 0;
    font-size: 0.9rem;
}

.btn-export {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-export:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-new-loan {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
    transition: all 0.2s;
}

.btn-new-loan:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

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

.stats-card-modern {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stats-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.blue-card .icon-box { background: #eff6ff; color: #3b82f6; }
.green-card .icon-box { background: #ecfdf5; color: #10b981; }
.orange-card .icon-box { background: #fff7ed; color: #f97316; }
.purple-card .icon-box { background: rgba(255, 255, 255, 0.2); color: white; }

.trend-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-badge.positive { background: #ecfdf5; color: #059669; }
.trend-badge.negative { background: #fef2f2; color: #dc2626; }
.purple-card .trend-badge { background: rgba(255, 255, 255, 0.2); color: white; }

.stats-card-modern .label {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stats-card-modern .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.stats-card-modern .sub-label {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Specific Card Styles */
.stats-card-modern.purple-card {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    border: none;
}

.stats-card-modern.purple-card .label,
.stats-card-modern.purple-card .value,
.stats-card-modern.purple-card .sub-label {
    color: white;
}

.stats-card-modern.purple-card .sub-label {
    opacity: 0.8;
}

/* Search & Filter Bar */
.search-filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-tabs {
    display: flex;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tab.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.count-badge {
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 99px;
}

.filter-tab.active .count-badge {
    background: #e0e7ff;
    color: #4f46e5;
}

/* WIZARD MODAL STYLES (Requested "Step by Step") */
/* Enhanced Wizard Modal Styles */
.wizard-modal .modal-content {
    padding: 0;
    border-radius: 20px;
    max-width: 650px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #ffffff;
}

.wizard-header {
    background: none;
    padding: 2.5rem 3rem 1.5rem;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: #334155 !important;
    margin-top: 2.5rem;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4f46e5 !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 900 !important;
    font-size: 1rem !important;
    margin-right: 0.75rem;
    transition: all 0.3s;
    border: 2px solid #4f46e5 !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
    position: relative !important;
    z-index: 10 !important;
}

.step-number::before {
    content: attr(data-number);
    color: white !important;
    font-weight: 900 !important;
    font-size: 1rem !important;
}

.step-indicator.active .step-number {
    background: white !important;
    color: #4f46e5 !important;
    border-color: white !important;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 4px 8px rgba(79, 70, 229, 0.4);
    font-weight: 900 !important;
    font-size: 1.1rem !important;
}

.step-indicator.active .step-number::before {
    color: #4f46e5 !important;
    font-weight: 900 !important;
    font-size: 1.1rem !important;
}

.step-indicator.completed .step-number {
    background: #4338ca !important;
    color: white !important;
    border-color: #4338ca !important;
    box-shadow: 0 2px 4px rgba(67, 56, 202, 0.3);
    font-weight: 900 !important;
    font-size: 1rem !important;
}

.step-indicator.completed .step-number::before {
    color: white !important;
    font-weight: 900 !important;
    font-size: 1rem !important;
}

.step-label {
    color: #1e293b !important;
    font-weight: 400 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s;
    display: block !important;
    margin-top: 0.5rem !important;
    text-align: center !important;
}

.step-indicator.active .step-label {
    color: #4f46e5 !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    display: block !important;
    margin-top: 0.5rem !important;
    text-align: center !important;
}

.step-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 1rem;
}

.step-line.active {
    background: rgba(255, 255, 255, 0.6);
}

/* Wizard Body */
.wizard-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

.wizard-step {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.wizard-step.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Form Fields */
.wizard-form-group {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.wizard-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

.wizard-input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.2s;
    overflow: hidden;
}

.wizard-input-container i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 10;
}

.wizard-form-group input,
.wizard-form-group select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 1rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #1e293b;
    outline: none;
    box-shadow: none;
}

.wizard-input-container.wizard-input-icon input {
    padding-left: 3rem;
}

.wizard-input-container:focus-within {
    background: white;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.wizard-form-group input:focus,
.wizard-form-group select:focus {
    /* Reset individual input focus styles as container handles it */
    box-shadow: none;
    border-color: transparent;
}

/* Footer Actions */
.wizard-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-wizard-cancel {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-wizard-cancel:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.btn-wizard-next,
.btn-wizard-submit {
    padding: 0.75rem 2rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

.btn-wizard-next:hover,
.btn-wizard-submit:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-wizard-prev {
    color: #6366f1;
    background: transparent;
    border: none;
    font-weight: 500;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
}

.btn-wizard-prev:hover {
    text-decoration: underline;
}

/* Summary Styles */
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.summary-item label {
    color: #64748b;
    font-size: 0.875rem;
}

.summary-item span {
    color: #0f172a;
    font-weight: 600;
}

.summary-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px dashed #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total label {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.summary-total span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6366f1;
}

.wizard-steps {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .modal.wizard-modal {
        padding: 0 !important;
        align-items: flex-end !important; /* Bottom sheet */
        justify-content: center !important;
    }

    .modal.wizard-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 92vh !important;
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border: none !important;
        display: flex;
        flex-direction: column;
        height: auto !important; /* Let content dictate height up to max */
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .wizard-header {
        padding: 1.5rem;
        flex-shrink: 0;
        border-radius: 24px 24px 0 0; /* Match modal content */
    }

    .wizard-header h2 {
        font-size: 1.25rem;
    }

    .wizard-header p {
        font-size: 0.8rem;
    }
    
    .wizard-body {
        padding: 1.5rem;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #f8fafc;
    }
    
    .wizard-footer {
        padding: 1rem 1.5rem;
        flex-shrink: 0;
        background: white;
        border-top: 1px solid #f1f5f9;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05); /* Subtle lift */
        padding-bottom: max(1rem, env(safe-area-inset-bottom)); /* Safe area */
    }
    
    .step-label {
        display: none; /* Keep clean on mobile */
    }
    
    .wizard-steps {
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
        justify-content: center; /* Center steps */
    }

    .step-indicator .step-number {
        margin-right: 0; /* Center number if label is hidden */
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .step-line {
        margin: 0 0.5rem;
    }
}

/* Enhanced Summary Card Styles */
.summary-card-enhanced {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-top: 4px solid #4f46e5;
    padding: 1.5rem;
    margin-top: 1rem;
    position: relative;
}

.summary-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.summary-client-section {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    border-right: 1px solid #e5e7eb;
    padding-right: 1.5rem;
}

.summary-label-small {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.summary-client-name {
    color: #111827;
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-details-section {
    display: flex;
    gap: 2rem;
    flex-grow: 1;
    justify-content: center;
}

.summary-detail-item {
    display: flex;
    flex-direction: column;
}

.summary-value-bold {
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
}

.summary-total-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
    padding-left: 1.5rem;
}

.summary-label-total {
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.summary-value-total {
    color: #4f46e5;
    font-weight: 800;
    font-size: 1.5rem;
}

/* Fix for static form controls in wizard */
.wizard-input-container .form-control-static {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.8rem !important; /* Extra left padding for icon */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #1e293b;
    background: #f8fafc;
    margin: 0;
    min-height: 48px; /* Ensure height matches inputs */
    display: flex;
    align-items: center;
}

/* Specific styles for success state */
.wizard-input-container .form-control-static.success {
    background: #f0fdf4;
    border-color: #10b981;
    color: #15803d;
}

/* Ensure icons are positioned correctly */
.wizard-input-container i {
    z-index: 10;
    left: 1rem;
}

/* Responsive adjustments for summary card */
@media (max-width: 768px) {
    .summary-row-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .summary-client-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-right: 0;
        padding-bottom: 1rem;
        width: 100%;
    }
    
    .summary-details-section {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .summary-total-section {
        width: 100%;
        align-items: flex-start;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px dashed #e5e7eb;
        padding-left: 0;
    }
    
    .summary-value-total {
        font-size: 1.25rem;
    }
}

/* Responsive Dashboard Adjustments */
@media (max-width: 768px) {
    /* Header Stacking */
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-actions {
        display: flex;
        gap: 0.75rem;
    }

    /* Search & Filter Bar Stacking */
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        overflow: hidden; /* Prevent container overflow */
    }

    .search-box {
        width: 100%;
        min-width: 0;
    }

    /* Scrollable Tabs */
    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px; /* Space for scrollbar if visible */
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
    }
    
    .filter-tab {
        flex: 0 0 auto; /* Prevent shrinking */
        white-space: nowrap;
    }

    /* Hide scrollbar for cleaner UI */
    .filter-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .filter-tabs::-webkit-scrollbar-thumb {
        background: #e5e7eb;
        border-radius: 4px;
    }
}

/* Modern Status Modal Styles */
#statusModal .modal-content {
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header-modern {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.badge-pill {
    background-color: #eff6ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.badge-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #2563eb;
    border-radius: 50%;
    margin-right: 8px;
}

.modal-body-modern {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.modal-body-modern h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 16px 0 8px 0;
}

.subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.status-transition-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.status-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    background-color: white;
}

.status-icon.current .inner-circle {
    width: 24px;
    height: 24px;
    background-color: #10b981;
    border-radius: 50%;
}

.status-icon.new {
    background-color: #eff6ff;
    border-color: #dbeafe;
    color: #2563eb;
    font-size: 1.5rem;
}

.status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.status-value {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
}

.status-value.highlight {
    color: #2563eb;
    font-weight: 600;
}

.arrow-container {
    color: #9ca3af;
    font-size: 1.25rem;
}

.info-warning-box {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.info-warning-box i {
    color: #3b82f6;
    background: #dbeafe;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 2px;
}

.info-warning-box span {
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.4;
}

.modal-footer-modern {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
    margin-top: 8px;
}

.btn-cancel-modern {
    background: none;
    border: none;
    color: #1f2937;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-confirm-modern {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-confirm-modern:hover {
    background-color: #1d4ed8;
}

/* Modern Notes Modal Styles */
#notesModal .modal-content {
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #f8fafc;
}

.notes-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    padding: 24px;
    color: white;
}

.notes-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.notes-icon-title {
    display: flex;
    gap: 16px;
    align-items: center;
}

.notes-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.notes-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.notes-info span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.close-notes {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close-notes:hover {
    opacity: 1;
}

.notes-search-container {
    margin-top: 8px;
}

.notes-search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    outline: none;
    transition: background 0.2s;
}

.notes-search-input:focus {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.notes-body {
    padding: 24px;
}

.add-note-section {
    background: white;
    padding: 4px;
    border-radius: 16px;
    margin-bottom: 24px;
    /* No shadow/border initially, minimal look */
}

.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 12px;
    align-items: center;
}

.note-main-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 1rem;
    outline: none;
    color: #334155;
}

.btn-add-note {
    width: 40px;
    height: 40px;
    background-color: #a855f7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.1s;
}

.btn-add-note:hover {
    background-color: #9333ea;
}

.btn-add-note:active {
    transform: scale(0.95);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 8px 8px;
}

.color-label {
    color: #64748b;
    font-size: 0.9rem;
}

.color-options {
    display: flex;
    gap: 8px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
    background-color: white; /* fallback */
    box-shadow: 0 0 0 1px #e2e8f0;
}

/* Color definitions */
.color-option[data-color="yellow"] { background-color: #fefce8; border-color: #fef08a; }
.color-option[data-color="blue"] { background-color: #eff6ff; border-color: #bfdbfe; }
.color-option[data-color="purple"] { background-color: #f3e8ff; border-color: #d8b4fe; }
.color-option[data-color="green"] { background-color: #f0fdf4; border-color: #bbf7d0; }
.color-option[data-color="pink"] { background-color: #fdf2f8; border-color: #fbcfe8; }

.color-option.selected {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px #8b5cf6; /* Focus ring */
    border-color: transparent; /* Reset internal border to show bg clearly or keep it */
}

/* Note List */
.notes-list-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; /* Hide horizontal scroll */
    padding-right: 16px; /* Ensure space for sticking out elements */
    padding-left: 4px;
    padding-bottom: 4px;
}

.note-card-modern {
    border-radius: 12px;
    padding: 16px;
    position: relative;
    border: 1px solid transparent;
    transition: transform 0.2s;
}

.note-card-modern:hover {
    transform: translateY(-1px);
}

.note-content {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.note-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-delete-note {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s;
}

.btn-delete-note:hover {
    color: #ef4444;
}

/* Note Colors in List */
.note-card-modern.color-yellow { background-color: #fefce8; border-color: #fef08a; }
.note-card-modern.color-blue { background-color: #eff6ff; border-color: #bfdbfe; }
.note-card-modern.color-purple { background-color: #f3e8ff; border-color: #d8b4fe; }
.note-card-modern.color-green { background-color: #f0fdf4; border-color: #bbf7d0; }
.note-card-modern.color-pink { background-color: #fdf2f8; border-color: #fbcfe8; }

.note-card-modern.color-yellow .note-content { color: #854d0e; }
.note-card-modern.color-blue .note-content { color: #1e40af; }
.note-card-modern.color-purple .note-content { color: #6b21a8; }
.note-card-modern.color-green .note-content { color: #166534; }
.note-card-modern.color-pink .note-content { color: #9d174d; }

/* Pinned Notes & Hover Actions */
.notes-section-title {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-section-title i {
    transform: rotate(45deg);
    font-size: 0.8rem;
}

.notes-section-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 16px 0;
}

/* Hover Actions Overlay */
.note-actions-hover {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    background: inherit; /* Blend with card bg if needed, or transparent */
    padding-left: 12px; /* Breathing room */
    /* Optional: gradient mask if text overlaps? For now simple absolute */
}

.note-card-modern:hover .note-actions-hover {
    opacity: 1;
}

.btn-action-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-action-icon:hover {
    background: rgba(0,0,0,0.05);
    color: #64748b;
}

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

.btn-action-icon.active {
    color: #f59e0b; /* Orange/Gold for active pin */
    transform: rotate(45deg);
}

.btn-action-icon.active:hover {
    background: #fef3c7;
}

/* Pinned Indicator (Corner) */
.pinned-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.pinned-indicator i {
    transform: rotate(45deg);
}

/* Adjust content padding if needed so actions don't overlap text too easily */
.note-card-modern {
    padding-right: 48px; /* Make room for actions on the right */
}

/* Modern Update Loan Modal Styles */
#updateLoanModal .modal-content {
    border-radius: 24px;
    padding: 0;
    max-width: 700px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.modal-header-modern {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.update-header {
    padding: 4px 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-header {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    padding: 12px 24px;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    font-weight: 600;
    letter-spacing: 0.025em;
}

.delete-warning-box {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.delete-warning-icon {
    color: #ef4444;
    font-size: 1.2rem;
    margin-top: 2px;
}

.delete-warning-text {
    color: #991b1b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.delete-list {
    margin: 16px 0 24px 0;
    padding-left: 0;
    list-style: none;
}

.delete-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.delete-list li i {
    color: #ef4444;
    font-size: 0.8rem;
}

.btn-delete-confirm {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-delete-confirm:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete-confirm:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.update-header-content {
    display: none;
}

.update-icon {
    font-size: 1.1rem;
    background: #eef2ff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.update-title {
    font-size: 1rem;
    font-weight: 700;
}

.close-btn-modern {
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
}

.close-btn-modern:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

.update-body {
    padding: 32px;
    background: white;
    flex: 1;
    overflow-y: auto;
}

.update-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.input-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group-modern label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 4px;
}

.input-wrapper-modern {
    background: white;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    transition: all 0.2s;
    height: 48px;
    overflow: hidden;
}

.input-wrapper-modern:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-icon-modern {
    color: #9ca3af;
    font-size: 1.1rem;
    padding-left: 1.25rem; /* Increased padding */
    padding-right: 0.75rem;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.input-wrapper-modern:focus-within .input-icon-modern {
    color: #4f46e5;
}

.input-field-modern {
    border: none !important; /* Force removal of border */
    background: transparent !important;
    height: 100%;
    flex: 1;
    padding: 0 16px 0 0;
    font-size: 1rem;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important; /* Force removal of shadow */
    font-weight: 500;
    width: 100%;
}

.input-field-modern:focus,
.input-field-modern:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.input-field-modern:disabled {
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed;
}

/* Adjustments for specific inputs like date that might need padding */
input[type="date"].input-field-modern {
    padding-right: 12px;
}

.summary-box-modern {
    background: #fbf7ff; /* Very light purple */
    border: 1px solid #f3e8ff;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

/* Responsive Users Filter Bar */
@media screen and (max-width: 768px) {
    .users-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .users-filter-bar input,
    .users-filter-bar select,
    .users-filter-bar button {
        width: 100% !important;
    }

    .note-main-input {
        width: 50%;
    }
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.summary-icon {
    width: 32px;
    height: 32px;
    background: #e9d5ff;
    color: #7e22ce;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.summary-title {
    color: #581c87;
    font-weight: 600;
    font-size: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.summary-item label {
    display: block;
    color: #9333ea;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.summary-item span {
    display: block;
    color: #3b0764;
    font-size: 1rem;
    font-weight: 600;
}

.update-footer {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-disclaimer {
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

.btn-cancel-modern {
    background: transparent;
    color: #0f172a;
    border: none;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.2s;
}

.btn-cancel-modern:hover {
    background: #f1f5f9;
}

.btn-save-modern {
    background: #a855f7;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(168, 85, 247, 0.4);
    transition: all 0.2s;
}

.btn-save-modern:hover {
    background: #9333ea;
    transform: translateY(-1px);
}

/* Mobile Full Screen Modals */
@media (max-width: 768px) {
    #statusModal .modal-content,
    #notesModal .modal-content,
    #updateLoanModal .modal-content {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #notesModal .notes-body, 
    #updateLoanModal .update-body {
        flex: 1;
        overflow-y: auto;
    }
    
    #statusModal .modal-content {
        justify-content: center; /* Status modal might be small, but if requested full screen, we stretch it */
    }
    
    .update-grid {
        grid-template-columns: 1fr; /* Stack inputs on mobile */
        gap: 16px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .update-footer {
        flex-direction: column-reverse;
        gap: 16px;
        align-items: stretch;
    }
    
    .footer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-save-modern {
        justify-content: center;
    }
    
    /* Hide icons in mobile modals */
    .modal-header .header-icon-box,
    .modal-header .wizard-header .header-icon-box,
    .modal-header-modern-blue .header-icon-box {
        display: none;
    }
    
    .modal-header .header-content-left,
    .modal-header .wizard-header .header-content-left,
    .modal-header-modern-blue .header-content-left {
        gap: 0;
    }
    
    /* Apply elegant title styling to all modal headers */
    .modal-header h3,
    .wizard-header h2,
    .modal-header-modern-blue .header-text-box h2 {
        font-size: 1.2rem;
        font-weight: 300;
        color: var(--primary-color);
        letter-spacing: 0.06em;
        text-transform: uppercase;
        position: relative;
        display: inline-block;
        margin: 0;
    }
    
    .modal-header h3::before,
    .wizard-header h2::before,
    .modal-header-modern-blue .header-text-box h2::before {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 40px;
        height: 2px;
        background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        border-radius: 1px;
    }
    
    .modal-header h3::after,
    .wizard-header h2::after,
    .modal-header-modern-blue .header-text-box h2::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 0;
        width: 25px;
        height: 1px;
        background: rgba(79, 70, 229, 0.3);
        border-radius: 1px;
    }
}

/* =========================================
   Modern Upcoming Payments Cards (Redesign)
   ========================================= */

.upcoming-payments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Slightly wider cards */
    gap: 1.5rem;
    margin-top: 1rem;
    width: 100%;
}

@media (max-width: 768px) {
    .upcoming-payments {
        grid-template-columns: 1fr;
    }
}

.payment-card-modern {
    background: #ffffff;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.payment-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* --- Theme Variations (Top Border Style) --- */
.payment-card-modern.pcm-blue {
    border-top: 4px solid #4f46e5;
}
.payment-card-modern.pcm-green {
    border-top: 4px solid #10b981;
}
.payment-card-modern.pcm-red {
    border-top: 4px solid #ef4444;
}

/* --- Header --- */
.pcm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

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

.pcm-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.pcm-blue .pcm-icon-circle { background: #f5f3ff; color: #4f46e5; }
.pcm-green .pcm-icon-circle { background: #ecfdf5; color: #10b981; }
.pcm-red .pcm-icon-circle { background: #fef2f2; color: #ef4444; }

.pcm-header-text h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.pcm-header-text span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.pcm-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcm-blue .pcm-badge { background: #e0e7ff; color: #4338ca; }
.pcm-green .pcm-badge { background: #d1fae5; color: #065f46; }
.pcm-red .pcm-badge { background: #fee2e2; color: #991b1b; }

/* --- Borrower Info Box --- */
.pcm-borrower-info {
    background: #f8fafc;
    border-radius: 18px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid #f1f5f9;
}

.pcm-borrower-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.pcm-avatar {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.pcm-borrower-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pcm-name {
    font-weight: 700;
    color: #334155;
    font-size: 0.95rem;
}

.pcm-username {
    font-size: 0.8rem;
    color: #94a3b8;
}

.pcm-date-line {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Amount Box --- */
.pcm-amount-box {
    border-radius: 18px;
    padding: 1.25rem;
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pcm-blue .pcm-amount-box {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
}
.pcm-green .pcm-amount-box {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.3);
}
.pcm-red .pcm-amount-box {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 16px -4px rgba(239, 68, 68, 0.3);
}

.pcm-amount-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.pcm-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pcm-amount-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Full Action Button --- */
.pcm-full-action-btn {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.pcm-blue .pcm-full-action-btn {
    color: #4f46e5;
    border-color: #e0e7ff;
    background: #eef2ff;
}
.pcm-blue .pcm-full-action-btn:hover {
    background: #4f46e5;
    color: white;
}

.pcm-green .pcm-full-action-btn {
    color: #059669;
    border-color: #d1fae5;
    background: #ecfdf5;
}
.pcm-green .pcm-full-action-btn:hover {
    background: #059669;
    color: white;
}

.pcm-red .pcm-full-action-btn {
    color: #dc2626;
    border-color: #fee2e2;
    background: #fef2f2;
}
.pcm-red .pcm-full-action-btn:hover {
    background: #dc2626;
    color: white;
}

/* =========================================
   MODERN MODAL & BUTTON STYLES (Blue Theme)
   ========================================= */

/* Main Button Style */
.btn-create-temp-modern {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    width: auto;
    max-width: fit-content;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-create-temp-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
}

.btn-create-temp-modern i {
    font-size: 1.1rem;
}

/* Modern Modal Wrapper */
.modal-modern-wrapper {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Collector Card Styles */
.collector-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.collector-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.collector-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.collector-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.collector-info h3 {
    font-size: 1.2rem;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    font-weight: 700;
}

.collector-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-active { background: #dcfce7; color: #15803d; }
.status-inactive { background: #fee2e2; color: #b91c1c; }

.collector-details {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.detail-row:last-child { margin-bottom: 0; }
.detail-label { color: #64748b; font-weight: 500; }
.detail-value { color: #334155; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

.password-display {
    font-family: 'Courier New', monospace;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: #475569;
}

.btn-toggle-pass {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    padding: 6px;
    border-radius: 50%;
}

.btn-toggle-pass:hover { color: #2563eb; background: #eff6ff; }

.collector-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    justify-content: flex-end; /* Align to right for cleaner look */
}

.btn-action-card {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.btn-edit { 
    background: #f0f9ff; 
    color: #0284c7;
    border: 1px solid #e0f2fe;
}
.btn-edit:hover { 
    background: #0284c7; 
    color: white;
    transform: translateY(-3px); 
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    border-color: #0284c7;
}

.btn-delete { 
    background: #fef2f2; 
    color: #dc2626;
    border: 1px solid #fee2e2;
}
.btn-delete:hover { 
    background: #dc2626; 
    color: white;
    transform: translateY(-3px); 
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    border-color: #dc2626;
}

/* Modal Header */
.modal-header-modern-blue {
    background: none;
    padding: 24px 28px;
    color: var(--slate-800);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    border-bottom: 1px solid var(--slate-200);
}

.modal-header-modern-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    padding: 24px 28px;
    color: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-icon-box.danger {
    background: #fff;
    color: #ef4444;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-confirm-modern.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-confirm-modern.danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.header-content-left {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.header-icon-box {
    background: var(--slate-100);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    backdrop-filter: none;
    border: 1px solid var(--slate-200);
    color: var(--slate-600);
}

.header-text-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

.header-text-box p {
    font-size: 0.9rem;
    color: var(--slate-600);
    line-height: 1.4;
    font-weight: 400;
}

.close-btn-modern {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.close-btn-modern:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modal Body */
.modal-body-modern-scroll {
    padding: 28px;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
    background: #ffffff;
    /* Hide scrollbar for Chrome/Safari/Opera */
}
.modal-body-modern-scroll::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.modal-body-modern-scroll {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Info Boxes */
.info-box-blue {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.info-box-blue .info-icon {
    color: #3b82f6;
    font-size: 18px;
    padding-top: 2px;
}

.info-box-blue .info-content strong {
    display: block;
    color: #1e40af;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-box-blue .info-content p {
    color: #1e3a8a;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.info-box-yellow {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.info-box-yellow .info-icon {
    color: #f59e0b;
    font-size: 18px;
    padding-top: 2px;
}

.info-box-yellow .info-content strong {
    display: block;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-box-yellow .info-content p {
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

/* Form Styles */
.form-group-modern {
    margin-bottom: 24px;
}

.form-group-modern label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 8px;
    margin-left: 4px;
}

.form-group-modern label .required {
    color: #ef4444;
    margin-left: 2px;
}

.input-wrapper-modern {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 4px 16px;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper-modern:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #fff;
}

.input-wrapper-modern.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-icon-modern {
    color: #9ca3af;
    font-size: 18px;
    margin-right: 14px;
    display: flex;
    align-items: center;
}

.input-wrapper-modern:focus-within .input-icon-modern {
    color: #3b82f6;
}

.input-field-modern {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1rem;
    color: #111827;
    background: transparent;
    font-weight: 400;
}

.input-field-modern::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.helper-text {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 4px;
}

.error-msg {
    display: none;
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
}

/* Modal Footer */
.modal-footer-modern {
    padding: 20px 28px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.btn-cancel-modern {
    padding: 12px 24px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-cancel-modern:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1f2937;
}

.btn-confirm-modern {
    padding: 12px 28px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: none;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-confirm-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 10px -2px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

/* Payment Info Container - Equal Height & Full Width */
.payment-info-container {
    display: flex;
    gap: 12px;
    margin: 0 0 12px 0;
    width: 100%;
    align-items: stretch; /* Ensures equal height */
}

.payment-info-card {
    flex: 1; /* Occupy remaining space equally */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Center content vertically if needed, or flex-start */
    min-height: 80px; /* Ensure a good minimum height */
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.payment-info-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.payment-label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.payment-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.payment-icon {
    color: #4f46e5;
    font-size: 0.9rem;
    background: rgba(79, 70, 229, 0.1);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.payment-card-value {
    color: #111827;
    font-weight: 500;
    font-size: .9rem;
    line-height: 1.3;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-late-badge {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #fef2f2;
    color: #ef4444;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    border: 1px solid #fecaca;
}

/* Key styling */
.key-card .payment-card-value {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: #334155;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
}

.btn-restore-mini {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: fit-content;
}

/* Key Card Specific Styles - Appended */
.key-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.key-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.key-card:active {
    transform: translateY(0);
}

.copy-btn-styled {
    background: #eef2ff;
    color: #4f46e5;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    opacity: 0.8;
}

.key-card:hover .copy-btn-styled {
    background: #4f46e5;
    color: white;
    opacity: 1;
}
