/* Invoices Section Styles */

.invoices-container h3 {
    margin-bottom: 1rem;
}

.invoice-count {
    font-size: 0.8rem;
    font-weight: normal;
    color: #6c757d;
}

/* Show more button styling */
.invoices-container .show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e9ecef;
    grid-column: 1 / -1;
    width: 100%;
}

.invoices-container .show-more-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invoices-container .show-more-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 1.5rem;
}

.invoice-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #ffd32f;
}

.invoice-card[style*="cursor: pointer"]:hover {
    border-color: #ffd32f;
    box-shadow: 0 8px 25px rgba(255, 211, 47, 0.2);
}

.invoice-card.paid {
    border-color: #22c55e;
    background: #f0fdf4;
}

.invoice-card.outstanding {
    border-color: #f59e0b;
    background: #fffbeb;
}

.invoice-card.overdue {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.invoice-card.overdue:hover {
    border-color: #b91c1c;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.25);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.invoice-card.voided {
    border-color: #6b7280;
    background: #f9fafb;
    opacity: 0.7;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.invoice-number h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
}

.invoice-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.status-authorised,
.status-submitted {
    background: #fef3c7;
    color: #92400e;
}

.status-draft {
    background: #e5e7eb;
    color: #374151;
}

.status-voided {
    background: #fecaca;
    color: #991b1b;
}

.invoice-card.overdue .status-authorised,
.invoice-card.overdue .status-submitted {
    background: #dc2626;
    color: #ffffff;
    animation: pulse-overdue 2s infinite;
}

.invoice-card.overdue .amount-due {
    color: #dc2626;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

.invoice-card.overdue .detail-value.overdue {
    color: #dc2626;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

@keyframes pulse-overdue {
    0%, 100% { 
        background: #dc2626;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% { 
        background: #b91c1c;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
    }
}

.invoice-amount {
    text-align: right;
}

.amount-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.amount-due {
    font-size: 0.9rem;
    color: #f59e0b;
    font-weight: 600;
}

.invoice-details {
    margin-top: 1rem;
}

.invoice-dates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dates-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.75rem;
}

.date-field {
    flex: 0 1 auto;
    display: inline-flex;
    flex-direction: column;
    white-space: nowrap;
}

.detail-item {
    margin-top: 0.5rem;
}

.detail-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .invoices-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .invoices-grid {
        grid-template-columns: 1fr;
    }
    
    .invoice-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .invoice-amount {
        text-align: left;
        width: 100%;
    }
}
