.spi-invoice {
    max-width: 720px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111827;
}

.spi-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    margin-bottom: 6px;
}
.spi-muted { color: #6b7280; }

/* ---------- Header ---------- */
.spi-invoice__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 24px;
    margin-bottom: 28px;
}
.spi-from { font-size: 18px; }
.spi-invoice__heading { text-align: right; }
.spi-invoice-word {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #111827;
}
.spi-invoice__number { color: #6b7280; margin-top: 4px; }
.spi-invoice__date   { color: #6b7280; font-size: 13px; }

.spi-invoice__bill-to { margin-bottom: 28px; }
.spi-invoice__bill-to strong { display: block; font-size: 16px; }

/* ---------- Items table ---------- */
.spi-invoice__items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}
.spi-invoice__items th {
    background: #f9fafb;
    text-align: left;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
.spi-invoice__items td {
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.spi-invoice__items th.spi-col-num,
.spi-invoice__items td.spi-col-num { text-align: right; width: 90px; }
.spi-invoice__items th.spi-col-desc { width: auto; }
.spi-item-desc { font-size: 13px; margin-top: 4px; line-height: 1.5; }

/* ---------- Totals ---------- */
.spi-invoice__totals {
    margin-left: auto;
    max-width: 280px;
    margin-top: 8px;
}
.spi-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #6b7280;
}
.spi-totals-grand {
    color: #111827;
    font-weight: 700;
    font-size: 18px;
    border-top: 2px solid #111827;
    margin-top: 8px;
    padding-top: 14px;
}

/* ---------- Notes ---------- */
.spi-invoice__notes {
    margin-top: 32px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- CTA / states ---------- */
.spi-cta { text-align: center; margin-top: 36px; }
.spi-pay-button {
    display: inline-block;
    background: #0070ba;
    color: #fff !important;
    padding: 16px 40px;
    border-radius: 28px;
    font-weight: 600;
    text-decoration: none !important;
    font-size: 17px;
    transition: background 0.15s ease;
}
.spi-pay-button:hover { background: #005a96; color: #fff !important; }
.spi-cta-hint { margin-top: 14px; font-size: 13px; }

.spi-paid {
    margin-top: 32px;
    background: #d8f5dc;
    color: #1e7a36;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
}
.spi-paid strong { display: block; font-size: 22px; margin-bottom: 4px; }

.spi-cancelled {
    margin-top: 24px;
    background: #fff4d4;
    color: #8a6a00;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
}

@media (max-width: 600px) {
    .spi-invoice { padding: 24px; margin: 16px; }
    .spi-invoice__items th.spi-col-num,
    .spi-invoice__items td.spi-col-num { width: 60px; padding: 10px 4px; }
}
