/* payment-modals.css — Toast, cash/card payment modals (banknote grid, write-off), split bill sheet, service-charge edit modal, books export picker.
   Split from style.css (load order matters: see the stylesheet <link> order in index.html). */
/* -- Toast notification ------------------------------- */
#or-toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    background: var(--grey-800);
    padding: .75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    text-align: center;
    white-space: pre-line;
    word-break: break-word;
    color: var(--white);
}
#or-toast.or-toast-show   { opacity: 1; transform: translateY(0); }
#or-toast.or-toast-error   { background: #c33; color: var(--white); }
#or-toast.or-toast-success { background: color-mix(in srgb, var(--button-primary-admin) 12%, white); color: var(--button-primary-admin); }
#or-toast.or-toast-info    { background: var(--grey-700); color: var(--white); }

/* Sitting / paid timestamp in order group headers */
.sitting-paid-time { font-size: 0.8em; font-weight: 400; }

/* Bill split totals in part-pay panel */
.bill-total   { color: #790e6e; }
.bill-paying  { color: #02B1C4; }
.bill-unpaid  { color: var(--white); }

/* Cash payment modal */
.or-cash-modal .ues-header { margin: 0 0 12px; }
.or-cash-modal .ues-row p  { margin: 0 0 8px; }
.or-cash-change            { margin: 8px 0; font-weight: 600; }

/* Banknote quick-add grid */
.or-cash-total {
    margin: 0 0 12px;
}

.or-cash-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0 4px;
}

/* Landscape banknote shape */
.or-note-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 56px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    padding: 0 14px 0 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: transform 0.08s, box-shadow 0.08s;
}

.or-note-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* Coloured left stripe (like the polymer window band) */
.or-note-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28%;
    opacity: 0.55;
}

/* £5 — teal (Churchill note) */
.or-note-5  { background: #d4ede8; }
.or-note-5::before  { background: #1a7a6a; }
.or-note-5 .or-note-val  { color: #0d4d42; }

/* £10 — warm orange (Austen note) */
.or-note-10 { background: #fde8d0; }
.or-note-10::before { background: #c85a00; }
.or-note-10 .or-note-val { color: #7a3400; }

/* £20 — purple (Turner note) */
.or-note-20 { background: #e8d8f0; }
.or-note-20::before { background: #7030a0; }
.or-note-20 .or-note-val { color: #4a1a70; }

/* £50 — red (Watt & Boulton note) */
.or-note-50 { background: #fad8d8; }
.or-note-50::before { background: #b01010; }
.or-note-50 .or-note-val { color: #700808; }

.or-note-val {
    position: relative;
    font-size: 1.25rem;
    font-weight: 800;
    pointer-events: none;
    letter-spacing: -0.5px;
}

/* Confirm / prompt / cash-payment: shared white card inner */
.or-confirm-message {
    margin: 0 0 20px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.or-confirm-modal .ues-actions,
.or-prompt-modal .ues-actions,
.or-cash-modal .ues-actions {
    justify-content: flex-end;
    margin-top: 20px;
    gap: 12px;
}

.or-cash-modal #or-cash-confirm:disabled {
    opacity: 0.45;
    filter: grayscale(0.4);
    cursor: not-allowed;
    pointer-events: none;
}

/* Card payment confirm (with optional write-off) */
.or-card-confirm-modal .ues-header { margin: 0 0 12px; }
.or-card-confirm-modal .ues-actions { justify-content: flex-end; margin-top: 16px; gap: 12px; }

/* "Write off the rest" checkbox row (cash + card modals) */
.or-writeoff-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 14px 0;
    padding: 10px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: #faf7f9;
    font-size: 0.9em;
    line-height: 1.35;
    cursor: pointer;
    box-sizing: border-box;
}
.or-writeoff-row input[type="checkbox"] {
    visibility: visible;
    display: inline-block;
    appearance: auto;
    -webkit-appearance: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 18px;
    accent-color: var(--button-primary-admin, var(--brand-purple-deep));
}
.or-writeoff-row span { flex: 1; margin: 0; }

/* ---- Split bill sheet ---- */
.or-split-modal .modal-inner { width: min(520px, calc(100% - 32px)); }
.or-split-modal .ues-header { margin: 0 0 10px; }
.or-split-total { margin: 0 0 14px; font-size: 1.05em; }
.or-split-ways {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.or-split-ways-label { font-weight: 600; }
.or-split-way-btn {
    width: 40px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--grey-800);
    font-weight: 600;
    cursor: pointer;
}
.or-split-way-btn.on {
    background: var(--button-primary-admin, var(--brand-purple-deep));
    border-color: var(--button-primary-admin, var(--brand-purple-deep));
    color: var(--white);
}
.or-split-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.or-split-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
}
.or-split-share.paid { background: #f4faf4; border-color: #cfe8cf; }
.or-split-share-label { font-weight: 600; }
.or-split-share-ctrl { display: flex; align-items: center; gap: 6px; }
.or-split-pay-btn {
    width: 44px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--grey-800);
    cursor: pointer;
}
.or-split-pay-btn img { width: 20px; height: 20px; display: block; }
.or-split-pay-btn:hover { background: rgba(0,0,0,0.05); }
.or-split-paid-tag { font-weight: 600; color: #2e7d32; }
.or-split-undo {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
}
.or-split-progress { margin: 0 0 4px; color: var(--grey-700); }
.or-split-progress--warn { color: #a00; font-weight: 600; }
/* Editable per-share amount */
.or-split-amount-wrap {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    background: var(--white);
}
.or-split-amount-prefix { color: #777; }
.or-split-amount {
    width: 64px;
    min-width: 0;
    height: auto;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    text-align: left;
    padding: 0;
}
.or-split-amount.manual { font-weight: 700; color: var(--button-primary-admin, var(--brand-purple-deep)); }
.or-split-modal .ues-actions { justify-content: flex-end; margin-top: 16px; gap: 12px; }
.or-split-modal .ues-save:disabled {
    opacity: 0.45;
    filter: grayscale(0.4);
    cursor: not-allowed;
    pointer-events: none;
}

/* Service charge edit button inline in total row */
.sc-edit-btn.icon-btn {
    background: transparent;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    padding: 5px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 6px;
}
.sc-edit-btn.icon-btn:hover { background: #f5f5f5; border-color: var(--grey-450); }
.sc-total-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 2px 0;
}

/* SC edit modal layout */
.or-sc-edit-modal .or-sc-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
}
.or-sc-edit-modal .or-sc-row span {
    font-size: 0.85em;
    color: var(--muted, var(--grey-600));
    margin-bottom: 4px;
}
.or-sc-edit-modal .or-sc-row .ues-input {
    width: 100%;
    box-sizing: border-box;
}
.or-sc-revised {
    display: none;
}

/* Books export format picker modal */
.books-export-modal-inner { width: min(380px, calc(100% - 32px)); }

.books-export-modal-inner .ues-header {
    margin-bottom: 16px;
}

.books-export-modal-inner .ues-header h3 {
    margin: 0;
    line-height: 1.25;
}

.email-receipt-modal-inner { width: min(380px, calc(100% - 32px)); }

.email-receipt-modal-inner .ues-header {
    margin-bottom: 16px;
}

.email-receipt-modal-inner .ues-header h3 {
    margin: 0;
    line-height: 1.25;
}

.books-export-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.books-export-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    padding: 14px 16px;
    background: var(--surface, #f8f9fa);
    border: 1.5px solid var(--line, #e5e7eb);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.books-export-btn:hover,
.books-export-btn:focus-visible {
    background: var(--accent-pale, #eef2ff);
    border-color: var(--accent, #4f6ef7);
    outline: none;
}

.books-export-btn-name {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--ink, #1a2030);
    pointer-events: none;
}

.books-export-btn-desc {
    font-size: 0.82rem;
    color: var(--muted, var(--slate-500));
    pointer-events: none;
}
.sheet-hidden-notice {
    margin: 8px 0 4px;
    font-size: 0.82rem;
    color: var(--muted, var(--slate-500));
}
