/* Override body styles for invoices page */
body {
    overflow: auto !important; /* Enable scrolling on invoices page */
    height: auto !important;
}

/* Fix gap for invoices page */
.billing-main {
    margin-top: 60px !important; /* Remove gap completely - exact header height */
}

/* Invoices Page Specific Styles */

.invoices-content {
    background: #2d2d44;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

/* Invoices Controls */
.invoices-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d54;
    background: #2d2d44;
}

.invoices-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-btn {
    background: transparent;
    border: 1px solid #3d3d54;
    color: #cccccc;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #3d3d54;
    color: #ffffff;
}

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

.pagination-info {
    color: #ffffff;
    font-size: 0.95rem;
    min-width: 1.5rem;
    text-align: center;
}

.invoices-settings {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.invoices-settings label {
    color: #cccccc;
}

.items-select {
    background: #1a1a2e;
    border: 1px solid #3d3d54;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 60px;
}

.items-select:focus {
    outline: none;
    border-color: #667eea;
}

.settings-btn {
    background: transparent;
    border: 1px solid #3d3d54;
    color: #cccccc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: #3d3d54;
    color: #ffffff;
}

/* Invoices Table */
.invoices-table-container {
    overflow-x: auto;
}

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

.invoices-table th {
    background: #1a1a2e;
    color: #ffffff;
    font-weight: 600;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #3d3d54;
    font-size: 0.9rem;
}

.invoices-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d54;
    color: #cccccc;
    font-size: 0.95rem;
    vertical-align: middle;
}

.invoices-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

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

/* Invoice Status */
.invoice-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-status.paid {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.invoice-status.pending {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.invoice-status.failed {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* View Invoice Link */
.view-invoice-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-invoice-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Empty State */
.invoices-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #cccccc;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.invoices-empty h3 {
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.invoices-empty p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Table Loading Skeleton */
.invoice-row-skeleton {
    animation: loading 1.5s infinite;
    background: linear-gradient(90deg, #3d3d54 25%, #4a4a5e 50%, #3d3d54 75%);
    background-size: 200% 100%;
}

.invoice-skeleton-cell {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d54;
}

.invoice-skeleton-text {
    height: 1rem;
    background: #3d3d54;
    border-radius: 4px;
    width: 70%;
}

.invoice-skeleton-text.short {
    width: 40%;
}

.invoice-skeleton-text.long {
    width: 90%;
}

/* Responsive */
@media (max-width: 768px) {
    .invoices-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .invoices-pagination {
        justify-content: center;
    }
    
    .invoices-settings {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .invoices-table th,
    .invoices-table td {
        padding: 0.75rem 1rem;
    }
    
    .invoices-table {
        font-size: 0.9rem;
    }
    
    .invoices-table th {
        font-size: 0.8rem;
    }
    
    /* Stack table on very small screens */
    @media (max-width: 600px) {
        .invoices-table-container {
            overflow-x: scroll;
        }
        
        .invoices-table {
            min-width: 600px;
        }
    }
}