body {
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: linear-gradient(to right, #e9ecef 1px, transparent 1px), linear-gradient(to bottom, #e9ecef 1px, transparent 1px);
    background-size: 40px 40px;
}

.invoice-container {
    max-width: 850px;
    margin: 50px auto;
    padding: 45px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    border-top: 5px solid #01386E;
}

.status-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 130px;
    font-weight: 700;
    opacity: 0.07;
    z-index: 0;
    text-transform: uppercase;
    letter-spacing: 8px;
    pointer-events: none;
}
.status-stamp.paid { color: #28a745; }
.status-stamp.credited { color: #dc3545; }
.status-stamp.partially.paid { color: #ffc107; }
.status-stamp.refunded { color: #17a2b8; }
.status-stamp.partially.refunded { color: #17a2b8; }
.status-stamp.partially.credited { color: #dc3545; }

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}
.invoice-header .logo { max-width: 150px; margin-top: 5px; }
.invoice-header .header-right-block { text-align: right; }
.invoice-header h1 { font-size: 38px; margin: 0; font-weight: 600; color: #0660B2; font-family: 'Montserrat', sans-serif; }
.invoice-header .invoice-meta p { margin: 5px 0 0; font-size: 14px; color: #6c757d; }

.customer-details-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.customer-details-section strong { font-weight: 600; color: #343a40; }
.customer-details-section p, .customer-details-section div { margin: 0; color: #495057; }
.customer-details-section .company-address { text-align: right; }
.customer-details-section .company-address strong {
    font-size: 16px;
    font-weight: 700;
}

.item-table, .schedule-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}
.item-table th, .schedule-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #495057;
    padding: 16px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.6px;
}
.item-table td, .schedule-table td {
    padding: 16px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}
.item-table .item-description {
    font-weight: 600;
    color: #212529;
}
.item-table .item-meta {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}
.item-table .item-meta .discount { color: #c82333; }

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #0660B2;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e9ecef;
    font-family: 'Montserrat', sans-serif;
}

.notes-section {
    margin-top: 40px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.notes-content {
    background-color: transparent;
    border: none;
    border-left: 3px solid #0660B2;
    padding: 16px 20px;
    padding-left: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #495057;
    min-height: 50px;
}

.summary-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}
.summary-table {
    width: 50%;
    max-width: 350px;
    font-size: 14px;
}
.summary-table td { padding: 12px; }
.summary-table .label { color: #495057; }
.summary-table .value { text-align: right; font-weight: 500; color: #212529; }
.summary-table .total-row td {
    font-weight: 700;
    font-size: 18px;
    border-top: 2px solid #dee2e6;
    padding-top: 18px;
}

.payment-button-container {
    text-align: right;
    margin-top: 35px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}
.pay-button {
    display: inline-block;
    background: linear-gradient(135deg, #0660B2 0%, #054E91 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(6, 96, 178, 0.25);
}
.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 96, 178, 0.35);
}
.secondary-button {
    background-color: #6c757d;
}
.secondary-button:hover {
    background-color: #5a6268;
}

.payment-locked-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    color: #856404;
    text-align: center;
}

.payment-locked-message p {
    margin: 0;
    font-size: 14px;
}

.invoice-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
    position: relative;
    z-index: 1;
}

/* Manage Payment Methods Button */
.manage-pm-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #0660B2;
    text-decoration: none;
    border: 2px solid #0660B2;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.manage-pm-button:hover {
    background: #0660B2;
    color: white;
    box-shadow: 0 4px 12px rgba(6, 96, 178, 0.25);
    transform: translateY(-1px);
}

.manage-pm-button .material-symbols-outlined {
    font-size: 18px;
}
