/* Invoice Page Styles - Aligned with Project Page */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: #ecf0f1;
}

/* Fixed Banner - Matching Project Page */
.fixed-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-placeholder {
    margin-left: 40px;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
}

.logo-placeholder::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    transition: width 0.3s ease;
}

.logo-placeholder:hover::after {
    width: 100%;
}

/* Main Content - Matching Project Page */
.main-content {
    margin-top: 80px;
    padding: 30px;
    min-height: calc(100vh - 80px);
}

/* Invoices Header - Matching Project Page */
.invoices-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoices-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #2ecc71);
    background-size: 300% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.invoices-title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.project-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

#project-name {
    color: #bdc3c7;
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0;
}

.back-to-project-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-to-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

/* Invoice Layout */
.invoices-layout {
    display: flex;
    gap: 30px;
    min-height: 600px;
}

.invoices-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoices-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.sidebar-btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    text-align: left;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #bdc3c7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-btn:hover::before {
    left: 100%;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

/* Invoice Viewport */
.invoices-viewport {
    flex: 1;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoices-viewport:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.invoice-section {
    display: none;
}

.invoice-section h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Financial Summary Cards - Matching Project Page */
.financial-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header i {
    font-size: 24px;
    color: #3498db;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #bdc3c7;
    margin: 0;
}

.card-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-amount.collected {
    color: #2ecc71;
}

.card-amount.outstanding {
    color: #e74c3c;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #95a5a6;
}

/* Tables - Matching Project Page */
.invoices-table-container,
.payments-table-container,
.history-table-container {
    margin-top: 30px;
}

.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.table-header-actions h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.new-invoice-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.new-invoice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.invoices-table,
.payments-table,
.history-table,
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.invoices-table th,
.payments-table th,
.history-table th,
.invoice-items-table th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 18px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoices-table td,
.payments-table td,
.history-table td,
.invoice-items-table td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #bdc3c7;
    transition: all 0.3s ease;
}

.invoices-table tr:hover td,
.payments-table tr:hover td,
.history-table tr:hover td,
.invoice-items-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.loading-text {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 30px;
}

/* Status Badges - Matching Project Page */
.status-badge {
    padding: 6px 15px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-draft {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
}

.status-sent {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.status-paid {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
}

.status-overdue {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.status-cancelled {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #bdc3c7;
}

/* Form Styles - Matching Project Page */
.invoice-form {
    max-width: 1000px;
}

.form-section {
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.form-section h3 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    color: #bdc3c7;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #95a5a6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Invoice Items - Matching Project Page */
.invoice-items-container {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.add-item-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-item-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: end;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.add-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.invoice-items-table tfoot td {
    font-weight: 600;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
}

.total-row td {
    font-size: 1.1rem;
    color: #fff;
    border-top: 2px solid #3498db;
    font-weight: 700;
}

/* Buttons - Matching Project Page */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* Action Buttons - Matching Project Page */
.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #bdc3c7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 3px;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.action-btn.edit {
    color: #3498db;
}

.action-btn.edit:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.action-btn.delete {
    color: #e74c3c;
}

.action-btn.delete:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.action-btn.view {
    color: #2ecc71;
}

.action-btn.view:hover {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* Filters - Matching Project Page */
.filter-controls {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Modals - Matching Project Page */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.modal-header h3 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.close {
    color: #bdc3c7;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #fff;
    background: rgba(231, 76, 60, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: #ecf0f1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 25px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Payment Form - Matching Project Page */
.quick-payment-form {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-payment-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}
}

.quick-payment-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .invoices-layout {
        flex-direction: column;
    }
    
    .invoices-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 16px;
    }
    
    .sidebar-btn {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    .financial-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-header-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .invoices-table,
    .payments-table,
    .history-table {
        font-size: 14px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
