:root {
    --cream: #fbe8d3;
    --cream-light: #fdf1e4;
    --brown: #3a2a1e;
    --pink: #e8799c;
    --pink-dark: #d1567f;
    --dark-panel: #221d1a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #f1e4d0;
    color: var(--brown);
    padding-bottom: 60px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: var(--brown);
    color: var(--cream-light);
}
.page-header h1 { font-size: 1.3rem; margin: 0; }

.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pink); color: #fff; box-shadow: 0 4px 0 var(--pink-dark); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: #e6d6bf; color: var(--brown); }
.btn-small { background: var(--brown); color: var(--cream-light); padding: 6px 12px; font-size: 0.8rem; border-radius: 6px; }

main { max-width: 720px; margin: 0 auto; padding: 32px 20px; }

/* ---------- Voucher card ---------- */
.voucher-stage { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-bottom: 48px; }

.voucher-card {
    width: 100%;
    max-width: 480px;
    background: var(--cream-light);
    border: 10px solid var(--brown);
    border-radius: 32px;
    padding: 22px;
}
.voucher-outer {
    background: var(--cream);
    border-radius: 20px;
    padding: 20px 18px 26px;
}

.voucher-title {
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    text-align: center;
    color: var(--pink);
    font-size: 2.6rem;
    line-height: 1.02;
    margin: 6px 0 18px;
    text-shadow: 0 3px 0 var(--brown);
    letter-spacing: 1px;
}
.voucher-title span { display: block; }

.voucher-panel {
    background: var(--dark-panel);
    border-radius: 18px;
    padding: 22px 18px 18px;
    position: relative;
    color: var(--cream-light);
    text-align: center;
    overflow: hidden;
}

.dino-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0.5; pointer-events: none; }
.dino-svg { width: 60%; }

.voucher-line-1 {
    position: relative;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.05rem;
    margin: 4px 0 10px;
}
.voucher-line-2 {
    position: relative;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.3rem;
    margin: 0 0 10px;
}
.voucher-line-2 .gratis { color: #fff; }
.voucher-line-2 { color: var(--pink); }
.voucher-line-2 .gratis { color: var(--cream-light); }

.voucher-line-3 {
    position: relative;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin: 0 0 14px;
    opacity: 0.95;
}

.scan-hint {
    position: relative;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--pink);
    margin: 0 0 4px;
    font-weight: 700;
}

.barcode-wrap {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 8px 6px 4px;
    display: flex;
    justify-content: center;
}
.barcode-wrap svg { max-width: 100%; }

.signature-strip {
    position: relative;
    background: #fff;
    border-radius: 999px;
    margin-top: 14px;
    padding: 10px 16px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    font-family: 'Caveat', cursive;
    color: #2b2b2b;
}
.sig { font-size: 1.1rem; }
.sig1 { font-size: 1rem; }
.sig2 { font-size: 1.35rem; }
.sig3 { font-size: 1.2rem; }

.voucher-number {
    position: relative;
    text-align: left;
    font-family: 'Anton', sans-serif;
    color: var(--pink-dark);
    opacity: 0.55;
    font-size: 1.4rem;
    margin: 14px 0 0;
}

.voucher-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Voucher list table ---------- */
.voucher-list-section h2 { font-size: 1.1rem; margin-bottom: 12px; }
.voucher-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 0.85rem; }
.voucher-table th, .voucher-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee2d0; }
.voucher-table th { background: #efe0c8; font-weight: 700; }
.voucher-table .mono { font-family: monospace; font-size: 0.75rem; }
.voucher-table .empty { text-align: center; color: #999; padding: 24px; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 50;
    padding: 16px;
}
.modal-box {
    background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 400px;
}
.modal-box h2 { margin-top: 0; font-size: 1.2rem; }
.modal-box label { display: block; font-weight: 600; font-size: 0.85rem; margin: 14px 0 6px; }
.modal-box input {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-error { color: #c0392b; font-size: 0.85rem; margin: 10px 0 0; }

@media (max-width: 480px) {
    .voucher-title { font-size: 2rem; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
