.finance-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.finance-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-finance-action {
    background: rgba(0, 0, 0, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-finance-action:hover {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-income {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.btn-income:hover {
    background: linear-gradient(135deg, #0d8070 0%, #2dd968 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.btn-outcome {
    background: linear-gradient(135deg, #ff5252 0%, #f48fb1 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.btn-outcome:hover {
    background: linear-gradient(135deg, #ff3838 0%, #f47ba1 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.4);
}

.finance-search-wrapper {
    position: relative;
    margin-bottom: 25px;
}

.finance-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
    pointer-events: none;
}

.finance-search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.finance-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    outline: none;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-top: -2px;
}

.finance-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.finance-search-result-item:hover {
    background: #f8f9ff;
}

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

.finance-search-result-item.already-loaded {
    opacity: 0.7;
    background: #f0f0f0;
}

.result-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #667eea;
}

.search-result-info {
    flex: 1;
}

.search-result-info h5 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-result-info h5 .badge-sm {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.search-result-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

/* Highlight card animation */
.highlight-card {
    animation: highlightPulse 2s ease-in-out;
    border-left-width: 6px !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.finance-user-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.finance-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.finance-user-card.teacher-card {
    border-left-color: #11998e;
}

.finance-user-card.admin-card {
    border-left-color: #ff5252;
}

.finance-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #e9ecef;
}

.finance-user-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-role-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.user-role-badge.student {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
}

.user-role-badge.teacher {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
    color: #11998e;
}

.user-role-badge.admin {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.1) 0%, rgba(244, 143, 177, 0.1) 100%);
    color: #ff5252;
}

.contact-area {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #555;
}

.contact-item i {
    color: #667eea;
    width: 20px;
}

.btn-show-students {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-show-students:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.kids-area {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    border: 2px solid #e9ecef;
}

.kid-card {
    background: #f8f9ff;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.kid-card i {
    color: #667eea;
    font-size: 1.1rem;
}

.payment-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.btn-payment-action {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-payment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-add-payment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-toggle-summary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-toggle-summary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.payment-card {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.payment-header {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-body {
    padding: 10px 0;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-label {
    font-weight: 600;
    color: #666;
}

.payment-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
}

.payment-success {
    color: #11998e;
}

.payment-danger {
    color: #ff5252;
}

.section-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    margin: 20px 0 15px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .finance-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .finance-actions {
        width: 100%;
    }

    .btn-finance-action {
        width: 100%;
        justify-content: center;
    }
}

.payment-transaction-group{
    border: 1px solid #999;
    border-left: 4px solid #444;
    border-bottom: 3px solid #444;
    border-radius: 5px;
    margin-bottom: 2px;
}

.transaction-date{
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Ensure payment items render as clear blocks in general history */
.payment-transaction{
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}
.transaction-amount{
    font-weight: 600;
    color: #28a745;
    margin: 5px 0;
}
.transaction-amount-danger{
    font-weight: 600;
    color: #dc3545;
    margin: 5px 0;
}
.transaction-description{
    font-size: 0.9em;
    color: #6c757d;
}
.transaction-more-details{
    font-size: 0.9em;
    color: #444;
    white-space: pre-wrap;
}
.transaction-attachment img{
    display: block;
    margin-top: 6px;
    border-radius: 4px;
}

.finance-section-container {
    padding: 20px;
    background: #f8f9fa;
    min-height: 500px;
}
