/* ------------ Base / layout ------------ */
:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --muted: #6b7280;
    --accent-1: #ff6900;
    /* level 1 orange */
    --accent-2: #ff6900;
    /* level 2 blue */
    --accent-3: #28a745;
    /* level 3 green */
    --primary: #28A745;
    --radius: 10px;
    --shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    --maxwidth: 1100px;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

body {
    background: linear-gradient(180deg, #f6f8fb, #ffffff);
    color: #111827;
    padding: 28px;
    display: flex;
    justify-content: center;
}

.page {
    width: 100%;
    max-width: var(--maxwidth);
}

header.title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

header.title h1 {
    font-size: 20px;
    margin: 0;
}

header.title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

header.title img {
    height: 36px;
}

/* Two column layout */
.grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

@media (max-width:980px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

/* Form sections */
.section {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid #eef2f6;
}

.section .header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section .header .pill {
    font-weight: 600;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    color: white;
}

.section .body {
    padding: 14px;
    background: #fff;
}

/* Input styles */
.row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.col {
    flex: 1;
    min-width: 0;
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

input,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e6edf3;
    font-size: 14px;
    box-sizing: border-box;
    background: #fbfdff;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.small {
    font-size: 13px;
    color: var(--muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.ghost {
    background: transparent;
    border: 1px solid #e6edf3;
    color: var(--primary);
}

/* Collapsible toggle */
.toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle small {
    color: var(--muted);
}

/* Line items */
table.line-items {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

table.line-items th,
table.line-items td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.icon-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--muted);
}

/* Summary panel */
.summary .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border-color: green;
    color: white;
    font-weight: 600;
}

.summary .badge.l1 {
    background: var(--accent-1);
}

.summary .badge.l2 {
    background: var(--accent-2);
}

.summary .badge.l3 {
    background: var(--accent-3);
}

.summary .line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eef2f6;
    color: var(--muted);
}

.summary .total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    font-weight: 700;
    font-size: 18px;
}

.muted-small {
    font-size: 13px;
    color: var(--muted);
}

.payment-types {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-option img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 4px;
    background: #fff;
    transition: border 0.3s;
}

.payment-option input:checked+img {
    border: 2px solid #007bff;
}

.payment-option label {
    margin-top: 6px;
    font-size: 13px;
    color: #333;
}

/* Footer */
.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

@media (max-width:980px) {
    .actions {
        flex-direction: column-reverse;
    }
}