/* =============================================================================
 * scan.adminlamiedor.ovh — style
 * Design tokens calés sur lamiedor-panel/mockups/fidelite-mockups.html
 * (branding LMD : sage/cream/gold, Caveat titres, Lato corps).
 *
 * Mobile-first. Gros éléments tactiles (min 56 px pour rush).
 * ============================================================================= */

:root {
    --sage: #7a8c6e;
    --sage-dark: #5f7156;
    --sage-deep: #485a3a;
    --cream: #eceae4;
    --cream-warm: #f4f1e8;
    --paper: #fbfaf6;
    --gold: #c0b38a;
    --gold-bright: #d4a04a;
    --ink: #2e332a;
    --ink-soft: #5a6152;
    --line: #ddd8cc;
    --shadow: rgba(72, 90, 58, .14);
    --danger: #b13a3a;
    --danger-bg: #f9e5e5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.scan-body {
    font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    line-height: 1.5;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(192, 179, 138, .22), transparent 60%),
        var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* =============================================================================
 * Auth screens (login / pin-setup / pin-verify)
 * ============================================================================= */
.auth-screen {
    flex: 1;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px 24px;
    padding-top: max(32px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

.auth-brand {
    text-align: center;
    padding-top: 12px;
}
.auth-brand-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(38px, 8vw, 52px);
    line-height: 1;
    color: var(--sage-deep);
    letter-spacing: .01em;
}
.auth-brand-sub {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 14px;
    letter-spacing: .18em;
    text-transform: uppercase;
    font-weight: 700;
}

.auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px 20px 20px;
    box-shadow: 0 14px 32px -18px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-note {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.45;
}

.auth-field { display: block; }
.auth-field > span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sage-deep);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    background: var(--cream-warm);
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    transition: border-color .18s, background .18s, box-shadow .18s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px;
}
.auth-field input:focus {
    border-color: var(--sage);
    background: var(--paper);
    box-shadow: 0 0 0 3px rgba(122, 140, 110, .18);
}
/* PIN fields : chiffres géants, centrés, monospace */
.auth-field input[inputmode="numeric"] {
    text-align: center;
    letter-spacing: 12px;
    font-size: 28px;
    font-family: 'Lato', 'SF Mono', ui-monospace, monospace;
    padding: 18px 12px 18px 24px; /* compenser letter-spacing */
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px 0;
}
.auth-check input {
    width: 20px; height: 20px;
    accent-color: var(--sage);
    flex-shrink: 0;
}

.auth-cta {
    width: 100%;
    background: var(--sage);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
    min-height: 56px;
    box-shadow: 0 10px 22px -12px rgba(72, 90, 58, .5);
    transition: background .15s, transform .12s;
    margin-top: 4px;
}
.auth-cta:hover, .auth-cta:focus { background: var(--sage-dark); }
.auth-cta:active { transform: translateY(1px); }

.auth-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f0c8c8;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
}
.auth-error strong { font-weight: 900; }
.auth-error p { margin-top: 4px; font-size: 13.5px; }

.auth-foot {
    text-align: center;
    padding-top: 4px;
}
.auth-link {
    color: var(--ink-soft);
    font-size: 13.5px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
}
.auth-link:hover { color: var(--sage-deep); background: rgba(0, 0, 0, .04); }

/* =============================================================================
 * Home screen (index.php + scanner.php stub)
 * ============================================================================= */
.home-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.home-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.home-who { display: flex; flex-direction: column; line-height: 1.15; }
.home-who-label {
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 700;
}
.home-who-name {
    font-size: 17px;
    color: var(--sage-deep);
    font-weight: 800;
}

.home-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--sage-dark);
    font-weight: 700;
}
.home-status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #6bb26b;
    box-shadow: 0 0 0 4px rgba(107, 178, 107, .22);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.1); opacity: .85; }
}

.home-back {
    color: var(--sage-deep);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background .15s;
}
.home-back:hover, .home-back:focus { background: rgba(0, 0, 0, .04); }

.home-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
    gap: 6px;
}
.home-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(42px, 10vw, 60px);
    line-height: 1;
    color: var(--sage-deep);
}
.home-sub {
    font-size: 13px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 700;
    margin-bottom: 32px;
}

.home-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--sage);
    color: #fff;
    border-radius: 32px;
    padding: 34px 32px;
    text-decoration: none;
    box-shadow: 0 22px 42px -18px rgba(72, 90, 58, .55);
    transition: background .15s, transform .12s;
    min-width: 240px;
    min-height: 160px;
}
.home-cta:hover, .home-cta:focus { background: var(--sage-dark); }
.home-cta:active { transform: translateY(2px); box-shadow: 0 12px 26px -14px rgba(72, 90, 58, .55); }

.home-cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-cta-label {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 34px;
    letter-spacing: .01em;
    line-height: 1;
}

.home-hint {
    color: var(--ink-soft);
    font-size: 14px;
    max-width: 260px;
    margin-top: 18px;
    line-height: 1.45;
}

.home-foot {
    padding: 20px 0 8px;
    text-align: center;
    border-top: 1px solid var(--line);
    margin-top: 20px;
}
.home-logout {
    color: var(--ink-soft);
    font-size: 14px;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    display: inline-block;
    transition: color .15s, background .15s;
}
.home-logout:hover, .home-logout:focus {
    color: var(--danger);
    background: rgba(177, 58, 58, .06);
}

/* =============================================================================
 * SPA scanner : shell fullscreen, vues hidden par défaut
 * ============================================================================= */
body.scan-shell {
    background: #0e120c;
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    display: block;
}
.view {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
}
.view.hidden { display: none !important; }

.spinner {
    width: 42px; height: 42px;
    border: 4px solid rgba(255,255,255,.18);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.view-loading {
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(14, 18, 12, .96);
}
.loading-txt { font-size: 14px; color: rgba(255,255,255,.7); }

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    min-height: 52px;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, transform .12s;
}
.btn-primary {
    background: var(--sage);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(72,90,58,.6);
}
.btn-primary:hover, .btn-primary:focus { background: var(--sage-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #6a6a6a; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--line);
}
.btn-secondary:hover, .btn-secondary:focus { background: rgba(0,0,0,.04); }
.btn-secondary:disabled { color: #999; border-color: #ddd; cursor: not-allowed; }

/* =============================================================================
 * VIEW : caméra ============================================================
 * ============================================================================= */
.view-cam { background: #000; }
.cam-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}
.cam-frame {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(70vw, 320px);
    aspect-ratio: 1 / 1;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
    border-radius: 24px;
    overflow: hidden;
}
.cam-frame .corner {
    position: absolute;
    width: 40px; height: 40px;
    border: 4px solid var(--gold-bright);
    border-radius: 4px;
}
.cam-frame .tl { top: 8px; left: 8px; border-right: none; border-bottom: none; border-top-left-radius: 16px; }
.cam-frame .tr { top: 8px; right: 8px; border-left: none; border-bottom: none; border-top-right-radius: 16px; }
.cam-frame .bl { bottom: 8px; left: 8px; border-right: none; border-top: none; border-bottom-left-radius: 16px; }
.cam-frame .br { bottom: 8px; right: 8px; border-left: none; border-top: none; border-bottom-right-radius: 16px; }
.cam-laser {
    position: absolute;
    left: 8%; right: 8%;
    top: 20%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
    box-shadow: 0 0 12px rgba(212,160,74,.7);
    animation: laser 2s cubic-bezier(.4,.0,.2,1) infinite;
    border-radius: 2px;
}
@keyframes laser {
    0%, 100% { top: 20%; opacity: .3; }
    50%      { top: 78%; opacity: 1; }
}
.cam-flash {
    position: absolute;
    inset: 0;
    background: rgba(107, 178, 107, 0);
    pointer-events: none;
    transition: background .3s ease;
}
.cam-flash.flash { background: rgba(107, 178, 107, .45); }

.cam-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 12px 12px 10px;
    padding-top: max(12px, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
}
.cam-back, .cam-torch {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.cam-back:hover, .cam-torch:hover { background: rgba(0,0,0,.7); }
.cam-torch.on { background: var(--gold-bright); color: #fff; }
.cam-hint {
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    max-width: 200px;
    text-align: center;
}
.cam-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 20px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
}
.cam-manual {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    background: rgba(255,255,255,.92);
    color: var(--ink);
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    min-height: 52px;
    box-shadow: 0 8px 20px -8px rgba(0,0,0,.4);
    transition: transform .12s;
}
.cam-manual:hover { transform: translateY(-1px); }

/* =============================================================================
 * VIEW : permission refusée ================================================
 * ============================================================================= */
.view-perm {
    background: var(--cream);
    color: var(--ink);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.perm-box {
    max-width: 380px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--paper);
    padding: 28px 24px;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 12px 28px -16px var(--shadow);
}
.perm-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 40px;
    color: var(--sage-deep);
    line-height: 1;
}
.perm-text {
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.5;
}
.perm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.perm-back {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 13.5px;
    text-decoration: none;
}
.perm-back:hover { color: var(--sage-deep); }

/* =============================================================================
 * VIEW : recherche manuelle & résultat — sur fond cream
 * ============================================================================= */
.view-search, .view-result {
    background: var(--cream);
    color: var(--ink);
}

.sub-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px 12px;
    padding-top: max(14px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    flex-shrink: 0;
}
.sub-back {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sub-back:hover { background: rgba(0,0,0,.05); }
.sub-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 28px;
    color: var(--sage-deep);
    line-height: 1;
}

.search-wrap {
    flex: 1;
    padding: 18px 18px 24px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
}
.search-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: var(--cream-warm);
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
}
.search-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .15s, color .15s;
    min-height: 40px;
}
.search-tab.active {
    background: var(--sage);
    color: #fff;
    box-shadow: 0 4px 10px -6px rgba(72,90,58,.5);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.search-field span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sage-deep);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.search-field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    font-family: inherit;
    min-height: 52px;
    -webkit-appearance: none;
    appearance: none;
}
.search-field input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(122,140,110,.18);
}

.search-status {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
}
.search-status.info { background: rgba(122,140,110,.10); color: var(--sage-deep); }
.search-status.err  { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c8c8; }

.search-results {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}
.search-result {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sr-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sr-info b { font-weight: 800; font-size: 15px; color: var(--ink); }
.sr-info span { color: var(--ink-soft); font-size: 13px; }
.sr-tag {
    display: inline-block;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 4px;
    align-self: flex-start;
}
.sr-tag.ok   { background: rgba(107,178,107,.18); color: #3d7a3d; }
.sr-tag.warn { background: rgba(212,160,74,.18);  color: #8b5a15; }

.sr-open {
    background: var(--sage);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    min-height: 44px;
    flex-shrink: 0;
}
.sr-open:hover { background: var(--sage-dark); }

/* =============================================================================
 * VIEW : résultat identification
 * ============================================================================= */
.r-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.r-head {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 24px -14px var(--shadow);
}
.r-av {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 30px;
    flex-shrink: 0;
}
.r-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-name  { font-weight: 800; font-size: 17px; color: var(--ink); word-break: break-word; }
.r-phone { color: var(--ink-soft); font-size: 13.5px; }
.r-bal {
    display: flex; flex-direction: column; align-items: center;
    padding: 0 6px;
}
.r-bal b {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 40px;
    color: var(--sage-deep);
    line-height: 1;
}
.r-bal span {
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 700;
}

.r-reward {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 8px 20px -10px rgba(212,160,74,.5);
}
/* Override : sans !important, .r-reward { display:flex } bat l'attribut
   HTML `hidden` (spec CSS). Bug initial : bannière visible même à 0 pt. */
.r-reward[hidden], .r-reward.hidden { display: none !important; }
.r-reward-icon { font-size: 20px; }

.r-section {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 14px 16px 16px;
}
.r-caption {
    font-size: 12px;
    font-weight: 800;
    color: var(--sage-deep);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.r-orders { display: flex; flex-direction: column; gap: 8px; }
.r-order {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--cream-warm);
    border-radius: 12px;
}
.r-order-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-order-info b { font-weight: 700; font-size: 14px; color: var(--ink); }
.r-order-info span { font-size: 12.5px; color: var(--ink-soft); }
.r-order-pts {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 26px;
    color: var(--sage);
    flex-shrink: 0;
}
.r-empty {
    color: var(--ink-soft);
    font-size: 13.5px;
    font-style: italic;
    line-height: 1.5;
    padding: 4px 4px 0;
}

.r-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* =============================================================================
 * Phase 3 — checkbox commandes, walk-in, historique, redeem, success
 * ============================================================================= */

/* --- Commande cochable --- */
.r-order {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--cream-warm);
    border: 2px solid transparent;
    border-radius: 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, background .15s, opacity .15s;
}
.r-order.unchecked { opacity: .5; border-color: #ccc; background: transparent; }
.r-order:hover { border-color: var(--sage); }
.r-check {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--sage);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.r-order.unchecked .r-check { background: transparent; border: 2px dashed #999; }

.r-hint {
    font-size: 12.5px;
    color: var(--ink-soft);
    font-style: italic;
    margin-top: 8px;
    line-height: 1.4;
}

.r-footer {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.r-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 4px;
    border-top: 1px dashed var(--line);
}
.r-total span { color: var(--ink-soft); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.r-total b { font-family: 'Caveat', cursive; font-size: 28px; color: var(--sage-deep); font-weight: 700; }
.r-total b span { font-family: inherit; text-transform: none; color: inherit; letter-spacing: 0; }

.btn-big {
    min-height: 60px;
    font-size: 17px;
    padding: 16px;
    border-radius: 16px;
}
.btn-sm {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
}

/* --- Walk-in grid --- */
.walkin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.walk-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 18px 12px 14px;
    min-height: 110px;
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, background .15s, transform .1s;
}
.walk-btn:active { transform: scale(.97); }
.walk-btn.has-count { border-color: var(--sage); background: rgba(122,140,110,.08); }
.walk-emoji { font-size: 26px; line-height: 1; }
.walk-name  { font-size: 14px; font-weight: 800; color: var(--ink); }
.walk-pt    { font-size: 11px; color: var(--ink-soft); letter-spacing: .04em; }
.walk-qty {
    position: absolute;
    top: 8px; left: 10px;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    background: var(--sage);
    color: #fff;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px -3px rgba(72,90,58,.4);
    opacity: 0;
    transform: scale(.7);
    transition: opacity .15s, transform .15s;
}
.walk-btn.has-count .walk-qty { opacity: 1; transform: scale(1); }
.walk-minus {
    position: absolute;
    top: 6px; right: 6px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.06);
    color: var(--ink-soft);
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}
.walk-btn.has-count .walk-minus { opacity: 1; }
.walk-minus:hover { background: var(--danger-bg); color: var(--danger); }

/* --- Reward --- */
.r-reward-body {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    min-height: 48px;
    border-radius: 999px;
    background: rgba(255,255,255,.95);
    color: var(--gold-bright);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    transition: transform .12s, background .15s;
}
.btn-gold:hover { transform: translateY(-1px); }
.btn-gold.btn-big {
    background: var(--gold-bright);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(212,160,74,.7);
}
.btn-gold.btn-big:hover { background: #b98835; }
.r-reward { flex-direction: column; align-items: stretch; }

/* --- Historique --- */
.hist-orders { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hist-order {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--cream-warm);
    border-radius: 12px;
    align-items: flex-start;
}
.hist-order-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hist-order-info b { font-size: 14px; color: var(--ink); font-weight: 800; }
.hist-order-info span { font-size: 12.5px; color: var(--ink-soft); }
.hist-order-state {
    display: inline-block;
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    align-self: flex-start;
    margin-top: 3px;
}
.state-pending    .hist-order-state { background: rgba(212,160,74,.18); color: #8b5a15; }
.state-credited   .hist-order-state { background: rgba(107,178,107,.18); color: #3d7a3d; }
.state-excluded   .hist-order-state { background: rgba(0,0,0,.08); color: var(--ink-soft); }
.state-abandoned  .hist-order-state { background: var(--danger-bg); color: var(--danger); }

.hist-order-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.hist-order-pts {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 22px;
    color: var(--sage);
}

.hist-tx {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hist-tx-row {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: var(--cream-warm);
    border-radius: 10px;
    align-items: center;
}
.hist-tx-delta {
    min-width: 44px;
    text-align: right;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 22px;
    line-height: 1;
}
.hist-tx-row.pos .hist-tx-delta { color: var(--sage); }
.hist-tx-row.neg .hist-tx-delta { color: var(--gold-bright); }
.hist-tx-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-tx-body b { font-size: 13px; color: var(--ink); font-weight: 700; }
.hist-tx-body span { font-size: 11.5px; color: var(--ink-soft); }

/* --- Success view --- */
.view-success {
    background: linear-gradient(135deg, var(--sage), var(--sage-deep));
    color: #fff;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.success-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 320px;
}
.success-check {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    border: 3px solid rgba(255,255,255,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: check-in .5s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes check-in {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.success-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 44px;
    line-height: 1;
    margin-top: 6px;
}
.success-txt {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255,255,255,.9);
}
.success-bal {
    margin-top: 6px;
    background: rgba(255,255,255,.14);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
}
.success-bal b {
    font-family: 'Caveat', cursive;
    font-size: 24px;
    font-weight: 700;
    margin-right: 4px;
}

/* --- Modale confirmation --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(14,18,12,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade-in .2s ease;
}
.modal-backdrop.hidden { display: none !important; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--paper);
    color: var(--ink);
    border-radius: 20px;
    padding: 24px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 48px -18px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modal-in .3s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes modal-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.modal-title {
    font-family: 'Caveat', cursive;
    font-size: 34px;
    font-weight: 700;
    color: var(--sage-deep);
    line-height: 1;
}
.modal-body { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.modal-body strong { color: var(--ink); font-weight: 800; }
.modal-body em { color: var(--danger); font-style: italic; }
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Spinner tiny inline pour boutons busy --- */
.spinner.tiny {
    display: inline-block;
    width: 20px; height: 20px;
    border-width: 3px;
    vertical-align: middle;
}

/* --- Sélecteur qty (modales réduction) --- */
.qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 0;
    background: var(--cream-warm);
    border-radius: 16px;
}
.qty-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--sage);
    color: var(--sage-deep);
    font-size: 26px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .12s;
}
.qty-btn:hover:not(:disabled), .qty-btn:focus:not(:disabled) {
    background: var(--sage); color: #fff;
}
.qty-btn:active { transform: scale(.95); }
.qty-value {
    min-width: 90px;
    text-align: center;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.qty-value b {
    font-family: 'Caveat', cursive;
    font-size: 46px;
    font-weight: 700;
    color: var(--sage-deep);
    line-height: 1;
}
.qty-value span {
    font-size: 12px;
    color: var(--ink-soft);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 4px;
}
.qty-hint {
    text-align: center;
    color: var(--ink-soft);
    font-size: 12.5px;
    margin-top: 6px;
}
.qty-hint b { color: var(--sage-deep); font-weight: 800; }

/* --- Preview crédit + réduction --- */
.cr-preview {
    background: var(--cream-warm);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.cr-preview > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
}
.cr-preview span { color: var(--ink-soft); }
.cr-preview b {
    font-family: 'Lato', sans-serif;
    font-weight: 800;
    color: var(--sage-deep);
}
.cr-preview .cr-preview-final {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
}
.cr-preview .cr-preview-final b {
    font-family: 'Caveat', cursive;
    font-size: 24px;
    font-weight: 700;
}

/* =============================================================================
 * A11y : respect prefers-reduced-motion
 * ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
