.invoice-sheet {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.invoice-head {
    padding: 32px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    background: radial-gradient(circle at 90% 0%, rgba(255, 61, 119, .14), transparent 60%);
}

.invoice-head .invoice-number {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 6px;
}

.invoice-head .invoice-dates {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.invoice-head .invoice-dates strong {
    color: var(--text-muted);
    font-weight: 500;
}

.invoice-status-large {
    text-align: right;
}

.invoice-status-large .badge {
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 18px;
}

.invoice-status-large .invoice-total {
    font-family: var(--font-display);
    font-size: 28px;
    margin-top: 12px;
}

.invoice-parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    padding: 30px 32px;
    border-bottom: 1px solid var(--line);
}

.invoice-party h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-family: var(--font-body);
    font-weight: 600;
}

.invoice-party address {
    font-style: normal;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.9;
}

.invoice-party address strong {
    color: #fff;
    font-size: 14px;
}

.invoice-items {
    padding: 0;
}

.invoice-items table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.invoice-items th {
    text-align: left;
    padding: 16px 32px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.invoice-items th:last-child,
.invoice-items td:last-child {
    text-align: right;
}

.invoice-items td {
    padding: 16px 32px;
    border-bottom: 1px solid var(--line);
    color: var(--text-muted);
}

.invoice-items tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, .02);
}

.invoice-items td.desc {
    color: #fff;
}

.invoice-items td.amount,
.invoice-totals .summary-line span:last-child,
.transactions-panel td.amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.invoice-totals {
    padding: 24px 32px;
    display: flex;
    justify-content: flex-end;
}

.invoice-totals-inner {
    width: 100%;
    max-width: 340px;
}

.invoice-totals .summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.invoice-totals .summary-line.grand {
    background: linear-gradient(90deg, rgba(255, 61, 119, .16), rgba(255, 122, 92, .08));
    border: 1px solid rgba(255, 61, 119, .35);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: var(--font-display);
    font-size: 19px;
    color: #fff;
}

.invoice-actions {
    padding: 22px 32px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, .15);
}

/* ===== TIMELINE ===== */
.timeline {
    list-style: none;
    position: relative;
    padding-left: 26px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--line-strong);
}

.timeline li {
    position: relative;
    padding-bottom: 22px;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--line-strong);
}

.timeline li.is-done::before {
    border-color: var(--success);
    background: var(--success-bg);
}

.timeline li.is-current::before {
    border-color: var(--rose);
    background: var(--rose);
    box-shadow: 0 0 0 4px rgba(255, 61, 119, .18);
}

.timeline .tl-title {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
}

.timeline .tl-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 3px;
}

/* ===== TRANSACTIONS ===== */
.transactions-panel table {
    font-size: 13px;
}

.payment-panel {
    background: var(--bg-featured);
    border: 1px solid rgba(255, 61, 119, .3);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 22px;
}

.payment-panel h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-panel h3 i {
    color: var(--rose);
}

.payment-panel p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ===== GATEWAY SELECTOR ===== */
.gateway-change-form {
    margin-bottom: 20px;
}

.gateway-box {
    background: rgba(0, 0, 0, .2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 18px;
}

.gateway-box .form-label {
    margin-bottom: 10px;
}

.gateway-box .form-label i {
    color: var(--rose);
    margin-right: 7px;
}

.gateway-box-select select {
    background: rgba(0, 0, 0, .25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23FF3D77' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center;
    background-size: 11px;
    padding-right: 40px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.gateway-box-select select:focus {
    background-color: rgba(0, 0, 0, .3);
}

.paid-stamp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--success);
    color: var(--success);
    border-radius: var(--radius);
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transform: rotate(-3deg);
}

@media print {
    header.site-header,
    footer.site-footer,
    .sidebar,
    .invoice-actions,
    .breadcrumb,
    .page-head,
    .mobile-nav,
    .overlay,
    /* The payment panel now sits above the document, so it has to be excluded
       explicitly or it would head the printed invoice. */
    .payment-panel,
    .skip-link {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111;
    }

    .invoice-sheet {
        border: 1px solid #ddd;
        background: #fff;
    }

    .invoice-sheet *,
    .invoice-items td,
    .invoice-party address,
    .invoice-totals .summary-line {
        color: #111 !important;
    }

    .invoice-head {
        background: none;
    }

    .layout {
        display: block;
    }
}
