@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400;9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ------------------------------------------------------------------
   't Beestenbos Apothecary palette
   ------------------------------------------------------------------ */
:root {
    --bb-paper:       #F4EFE3;
    --bb-paper-deep:  #ECE4CE;
    --bb-surface:     #FBF8F0;
    --bb-surface-alt: #F7F2E5;
    --bb-surface-sunk:#EFE8D6;

    --bb-ink:         #1E2A1B;
    --bb-ink-soft:    #3D4A38;
    --bb-ink-muted:   #6B6353;
    --bb-ink-faint:   #A89E89;

    --bb-line:        #E2D9C2;
    --bb-line-soft:   #EAE2CB;

    --bb-forest:      #2D4A36;
    --bb-forest-deep: #1F3325;
    --bb-forest-tint: #E4EBDF;
    --bb-moss:        #7F8E5C;

    --bb-amber:       #C77D2C;
    --bb-amber-deep:  #A66520;
    --bb-amber-tint:  #F4E3CC;

    --bb-brick:       #A6442E;
    --bb-brick-tint:  #F2DCD3;

    --bb-card:        #FFFFFF;
    --bb-return-card: #FBF3E6;
    --bb-return-line: #E3C49C;
    --bb-scrim:       rgba(31, 51, 37, 0.22);
    --bb-shadow-pop:  0 24px 48px -20px rgba(31, 51, 37, 0.4);
    --bb-camera-glow: #E9A75B;
    --bb-sage:        #5E7A4F;

    --bb-radius:      8px;
    --bb-radius-lg:   14px;

    --bb-shadow-hair: inset 0 0 0 1px var(--bb-line);
    --bb-shadow-soft: 0 1px 0 var(--bb-line), 0 12px 24px -16px rgba(31, 51, 37, 0.18);

    --bb-font-display: 'Fraunces', 'Newsreader', Georgia, serif;
    --bb-font-sans: 'Manrope', 'Inter', system-ui, sans-serif;
}

/* ------------------------------------------------------------------
   Paper background subtle grain for tactility
   ------------------------------------------------------------------ */
html, body {
    background: var(--bb-paper);
    color: var(--bb-ink);
    font-family: var(--bb-font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.40  0 0 0 0 0.30  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ------------------------------------------------------------------
   Type helpers
   ------------------------------------------------------------------ */
.bb-display       { font-family: var(--bb-font-display); font-weight: 500; letter-spacing: -0.01em; }
.bb-display-italic{ font-family: var(--bb-font-display); font-style: italic; font-weight: 500; letter-spacing: -0.01em; font-variation-settings: "SOFT" 80; }
.bb-num           { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum"; }
.bb-eyebrow       { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; font-weight: 700; color: var(--bb-ink-muted); }
.bb-mono-meta     { font-size: 0.78rem; color: var(--bb-ink-muted); letter-spacing: 0.04em; }

/* ------------------------------------------------------------------
   Layout chrome
   ------------------------------------------------------------------ */
.bb-shell .mud-appbar {
    background: var(--bb-paper);
    color: var(--bb-ink);
    box-shadow: none !important;
    border-bottom: 1px solid var(--bb-line);
    backdrop-filter: blur(6px);
}

.bb-shell .mud-drawer {
    background: var(--bb-paper);
    border-right: 1px solid var(--bb-line);
    box-shadow: none !important;
}

.bb-shell .mud-main-content {
    background: transparent;
}

.bb-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.bb-brand__name {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.45rem;
    letter-spacing: -0.015em;
    line-height: 1;
    color: var(--bb-ink);
}
.bb-brand__name em {
    font-style: italic;
    font-variation-settings: "SOFT" 90;
    color: var(--bb-forest);
}
.bb-brand__tag {
    font-family: var(--bb-font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bb-ink-muted);
    align-self: center;
    padding-left: 0.6rem;
    margin-left: 0.4rem;
    border-left: 1px solid var(--bb-line);
}

/* ------------------------------------------------------------------
   Custom nav rail (replaces drawer's default nav look)
   ------------------------------------------------------------------ */
.bb-rail .mud-nav-link {
    margin: 4px 12px;
    border-radius: var(--bb-radius);
    color: var(--bb-ink-soft);
    font-weight: 600;
    padding: 12px 14px;
    min-height: 52px;
    transition: background-color .18s ease, color .18s ease;
}
.bb-rail .mud-nav-link:hover {
    background: var(--bb-surface-sunk);
    color: var(--bb-ink);
}
.bb-rail .mud-nav-link.active {
    background: var(--bb-forest);
    color: var(--bb-amber);
}
.bb-rail .mud-nav-link.active .mud-nav-link-icon {
    color: var(--bb-amber);
}
.bb-rail .mud-nav-link-icon {
    color: var(--bb-forest);
}

/* ------------------------------------------------------------------
   Surfaces
   ------------------------------------------------------------------ */
.bb-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    transition: border-color .18s ease, transform .18s ease, background-color .18s ease;
}

.bb-panel {
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
}
.bb-panel--sunk {
    background: var(--bb-paper-deep);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
}

.bb-receipt {
    background: var(--bb-surface);
    border-radius: var(--bb-radius-lg);
    position: relative;
    overflow: hidden;
}
.bb-receipt::before, .bb-receipt::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 14px;
    background-image: radial-gradient(circle at 7px 7px, var(--bb-paper) 6px, transparent 6.5px);
    background-size: 14px 14px;
    background-repeat: repeat-x;
}
.bb-receipt::before { top: -7px; }
.bb-receipt::after  { bottom: -7px; }

.bb-checkout__receipt {
    padding: 54px 28px;
    position: sticky;
    top: 96px;
}

.bb-checkout__sums {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--bb-ink-muted);
}

.bb-checkout__cta {
    margin-top: 24px;
}

.bb-auth-form {
    display: grid;
    gap: 1rem;
}

.bb-auth-gate {
    width: min(100%, 26rem);
    margin: 2rem auto;
}

/* ------------------------------------------------------------------
   Pills / chips
   ------------------------------------------------------------------ */
.bb-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
    color: var(--bb-ink-soft);
    overflow: hidden;
    text-wrap: nowrap;
}
.bb-pill--forest  { background: var(--bb-forest-tint); border-color: transparent; color: var(--bb-forest-deep); }
.bb-pill--amber   { background: var(--bb-amber-tint); border-color: transparent; color: var(--bb-amber-deep); }
.bb-pill--muted   { background: var(--bb-paper-deep); border-color: transparent; color: var(--bb-ink-muted); }
.bb-pill--offline { background: #F2DCD3; border-color: transparent; color: var(--bb-brick); }
.bb-pill__dot     { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.bb-pill__dot--pulse {
    animation: bb-pulse 1.4s ease-in-out infinite;
}
@keyframes bb-pulse {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.7); }
}


.bb-pill__sync {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bb-sync-spin 0.9s linear infinite;
    margin-right: 2px;
}
@keyframes bb-sync-spin {
    to { transform: rotate(360deg); }
}


/* ------------------------------------------------------------------
   Numbers the protagonist
   ------------------------------------------------------------------ */
.bb-total {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: clamp(2.5rem, 5.2vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums lining-nums;
}
.bb-total--forest { color: var(--bb-forest); }
.bb-total--brick { color: var(--bb-brick); }
.bb-total small {
    display: block;
    font-family: var(--bb-font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bb-ink-muted);
    margin-bottom: 0.45rem;
}

.bb-price {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------
   Product card
   ------------------------------------------------------------------ */
.bb-product {
    display: flex; flex-direction: column; gap: 0.75rem;
    padding: 18px 18px 16px;
    height: 100%;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background-color .15s ease, transform .12s ease;
    min-height: 168px;
    position: relative;
}
.bb-product:hover { border-color: var(--bb-forest); background: var(--bb-surface-alt); }
.bb-product:active { transform: translateY(1px); }

.bb-product--in-cart {
    border-color: var(--bb-forest);
    background: var(--bb-forest-tint);
}
.bb-product--in-cart:hover {
    background: color-mix(in srgb, var(--bb-forest-tint) 85%, var(--bb-forest) 15%);
}

.bb-product__remove {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
    color: var(--bb-brick);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .15s ease, border-color .15s ease;
    padding: 0;
    flex: 0 0 32px;
}
.bb-product__remove:hover {
    background: #F2DCD3;
    border-color: var(--bb-brick);
}

.bb-product__sku {
    font-family: var(--bb-font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bb-ink-muted);
}
.bb-product__name {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--bb-ink);
}
.bb-product__foot {
    margin-top: auto;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem;
}
.bb-product__price-block {
    display: flex; flex-direction: column; gap: 2px;
}
.bb-product__price-excl {
    font-size: 0.72rem;
    color: var(--bb-ink-muted);
    letter-spacing: 0.02em;
}

/* Stock pill */
.bb-stock {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; font-weight: 600;
    color: var(--bb-sage);
    background: var(--bb-forest-tint);
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.bb-stock--low   { color: var(--bb-amber-deep); background: var(--bb-amber-tint); }
.bb-stock--out   { color: var(--bb-brick); background: #F2DCD3; }
.bb-stock::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.8;
}

/* ------------------------------------------------------------------
   Customer list
   ------------------------------------------------------------------ */
.bb-customer {
    display: flex; align-items: center; gap: 1rem;
    padding: 16px 20px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.bb-customer + .bb-customer { margin-top: 10px; }
.bb-customer:hover { border-color: var(--bb-forest); background: var(--bb-surface-alt); }
.bb-customer__avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bb-forest-tint);
    color: var(--bb-forest-deep);
    font-family: var(--bb-font-display);
    font-weight: 600; font-size: 1.05rem;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 44px;
}
.bb-customer__name { font-weight: 700; font-size: 1.02rem; color: var(--bb-ink); }
.bb-customer__meta { font-size: 0.8rem; color: var(--bb-ink-muted); margin-top: 2px; }

/* ------------------------------------------------------------------
   Cart line row
   ------------------------------------------------------------------ */
.bb-cart-line {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.25rem;
    padding: 18px 20px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    align-items: center;
}
.bb-cart-line + .bb-cart-line { margin-top: 10px; }
.bb-cart-line__name { font-family: var(--bb-font-display); font-weight: 500; font-size: 1.05rem; }
.bb-cart-line__meta { font-size: 0.78rem; color: var(--bb-ink-muted); margin-top: 2px; letter-spacing: 0.02em; }

.bb-qty {
    display: inline-flex; align-items: center;
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
}

.bb-receipt-line__bottom > .bb-qty:not(.bb-qty--return),
.bb-qty--inline:not(.bb-qty--return) {
    background: var(--bb-paper);
}

.bb-qty button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--bb-ink);
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
    .bb-qty button:disabled {
        color: var(--bb-ink-muted);
        opacity: .45; 
        cursor: not-allowed;
    }
    .bb-qty button:hover:not(:disabled)
    { 
        background: var(--bb-surface);
    }
.bb-qty__value {
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--bb-ink);
    font-size: 1rem;
}

.bb-line-total {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 100px;
}

/* ------------------------------------------------------------------
   Payment method tiles
   ------------------------------------------------------------------ */
.bb-pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.bb-pay {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 22px 22px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    min-height: 110px;
}
.bb-pay:hover { border-color: var(--bb-forest); }
.bb-pay--selected {
    border-color: var(--bb-forest);
    background: var(--bb-forest-tint);
}
.bb-pay--selected .bb-pay__check { background: var(--bb-forest); color: var(--bb-paper); }
.bb-pay__head { display: flex; align-items: center; justify-content: space-between; }
.bb-pay__icon { color: var(--bb-forest); }
.bb-pay__check {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid var(--bb-line);
    background: var(--bb-surface);
    color: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.bb-pay__label { font-weight: 700; font-size: 1.02rem; color: var(--bb-ink); }
.bb-pay__hint  { font-size: 0.78rem; color: var(--bb-ink-muted); }

/* ------------------------------------------------------------------
   MudBlazor overrides for restraint

   MudBlazor's own outlined-input CSS targets `.mud-input.mud-input-outlined
   .mud-input-outlined-border` (and, for :hover, an even more specific
   `:not():not():hover` chain), which always wins against a plain
   `.mud-input-outlined .mud-input-outlined-border` override regardless of
   stylesheet order. Rather than chase that specificity, override the
   theme CSS variables MudBlazor's rules already read from — scoped to
   `.mud-input-outlined` so it never leaks into buttons/cards elsewhere.
   ------------------------------------------------------------------ */
.mud-input-outlined {
    --mud-palette-lines-inputs: var(--bb-line);
    --mud-palette-action-default: var(--bb-line);
    --mud-palette-primary: var(--bb-forest);
    --mud-default-borderradius: var(--bb-radius);
}
.mud-input.mud-input-outlined.mud-shrink .mud-input-outlined-border,
.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-width: 1.5px;
}
.mud-input-label, .mud-input-helper-text {
    color: var(--bb-ink-muted);
}
.mud-input-outlined input { color: var(--bb-ink); }

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    cursor: pointer;
    background-color: var(--bb-ink-muted);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover {
    background-color: var(--bb-ink);
}

.mud-alert {
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
}
.mud-alert.mud-alert-filled-warning,
.mud-alert.mud-alert-text-warning {
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    border-color: transparent;
}
.mud-alert.mud-alert-filled-info,
.mud-alert.mud-alert-text-info {
    background: var(--bb-paper-deep);
    color: var(--bb-ink-soft);
    border-color: transparent;
}
.mud-alert.mud-alert-filled-error,
.mud-alert.mud-alert-text-error {
    background: #F2DCD3;
    color: var(--bb-brick);
    border-color: transparent;
}

.mud-snackbar { border-radius: var(--bb-radius); font-family: var(--bb-font-sans); }
.mud-dialog {
    border-radius: var(--bb-radius-lg);
    background: linear-gradient(180deg, var(--bb-surface-alt) 0%, var(--bb-surface) 100%);
}
.mud-dialog-title,
.mud-dialog-content,
.mud-dialog-actions {
    background: transparent;
}
.mud-dialog-title { font-family: var(--bb-font-display); font-size: 1.4rem; letter-spacing: -0.01em; }
.mud-dialog-actions {
    border-top: none;
    padding-top: 1rem;
}

.mud-icon-button { color: var(--bb-ink-soft); }

/* Switch: the thumb is an icon button, so the rule above paints it dark in both states. */
.mud-switch .mud-switch-base:not(.mud-checked):not(.mud-switch-disabled),
.mud-switch .mud-switch-base.mud-checked:not(.mud-switch-disabled) {
    color: var(--bb-card) !important;
}
.mud-switch .mud-switch-base:not(.mud-checked):not(.mud-switch-disabled) + .mud-switch-track {
    background-color: var(--bb-line);
    box-shadow: inset 0 0 0 1px var(--bb-ink-faint);
    opacity: 1;
}
.mud-switch .mud-switch-base.mud-checked:not(.mud-switch-disabled) + .mud-switch-track {
    background-color: var(--bb-forest);
    opacity: 1;
}

/* Cart badge in app bar */
.bb-cart-badge .mud-badge-icon { color: var(--bb-ink); }
.bb-cart-badge .mud-badge {
    background: var(--bb-amber);
    color: var(--bb-surface);
    font-weight: 700;
    font-size: 0.7rem;
    top: 0.75rem !important;
    left: 2rem !important;
}

/* Progress linear */
.mud-progress-linear { background: var(--bb-line-soft); }
.mud-progress-linear .mud-progress-linear-bar { background: var(--bb-forest); }

/* Divider */
.mud-divider { border-color: var(--bb-line); }

/* Focus ring */
:focus-visible {
    outline: 2px solid var(--bb-forest);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Page sections */
.bb-page-shell {
    position: relative;
    margin: 0 auto;
}
.bb-page { padding: 28px 36px 56px; position: relative; z-index: 1; }
.bb-page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 28px; }
.bb-page__title { font-family: var(--bb-font-display); font-weight: 500; font-size: 2.4rem; letter-spacing: -0.02em; line-height: 1.05; color: var(--bb-ink); }
.bb-page__lede,
.mud-dialog-content {
    color: var(--bb-ink-muted);
    margin-top: 0.4rem;

    font-size: 0.95rem;
    overflow: visible !important;
}

@media (max-width: 720px) {
    .bb-page { padding: 20px 18px 40px; }
    .bb-page__title { font-size: 1.75rem; }
    .bb-cart-line { grid-template-columns: 1fr; gap: 0.6rem; }
    .bb-line-total { text-align: left; }
}

/* Decorative leaf */
.bb-leaf {
    pointer-events: none;
    opacity: 0.15;
    color: var(--bb-forest);
}

.bb-leaf--global {
    position: fixed;
    bottom: -24px;
    right: -41px;
    width: 400px;
    height: 400px;
    z-index: 1;
}

/* Section heads tiny numerical hint + eyebrow */
.bb-section-head {
    display: flex; gap: 0.85rem; align-items: flex-start;
    margin-bottom: 14px;
}
.bb-section-head__num {
    font-family: var(--bb-font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--bb-forest);
    background: var(--bb-forest-tint);
    border-radius: 6px;
    padding: 4px 8px;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums lining-nums;
    align-self: flex-start;
}

.bb-section-head--receipt {
    border-bottom: 1px dashed var(--bb-line);
    padding-bottom: 14px;
    margin-bottom: 16px;
}


/* ── Producten column ─────────────────────────────────────────────── */
.bb-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 960px) {
    .bb-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .bb-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1500px) {
    .bb-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1900px) {
    .bb-product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 2560px) {
    .bb-product-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}
.bb-product {
    display: flex; flex-direction: column; gap: 0.55rem;
    padding: 12px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background-color .15s ease,
                transform .12s ease, box-shadow .15s ease;
    position: relative;
    min-height: 280px;
}
.bb-product:hover {
    border-color: var(--bb-forest);
    background: var(--bb-surface-alt);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -14px rgba(31, 51, 37, 0.35);
}
.bb-product:active { transform: translateY(0); }
.bb-product--in-cart {
    border-color: var(--bb-forest);
    background: var(--bb-forest-tint);
}
.bb-product--in-cart:hover {
    background: color-mix(in srgb, var(--bb-forest-tint) 85%, var(--bb-forest) 15%);
}

.bb-product--disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.5);
}
.bb-product--disabled:hover {
    border-color: var(--bb-line);
    background: var(--bb-surface);
    transform: none;
    box-shadow: none;
}
.bb-product__options-tag--disabled {
    color: var(--bb-ink-muted);
}

/* Product image */
.bb-product__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bb-paper);
    border-radius: var(--bb-radius);
    overflow: hidden;
    box-shadow: var(--bb-shadow-hair);
    display: flex; align-items: center; justify-content: center;
}
.bb-product__media-fallback {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(45,74,54,0.06), transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(199,125,44,0.08), transparent 60%),
        var(--bb-paper-deep);
    z-index: 1;
}
.bb-product__media-fallback::before {
    content: "";
    position: absolute;
    inset: 12% 12% auto auto;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bb-amber);
    opacity: 0.6;
}
.bb-product__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    position: absolute; inset: 0;
    background: var(--bb-paper);
    transition: transform .35s ease;
    z-index: 2;
}
.bb-product:hover .bb-product__img { transform: scale(1.04); }
.bb-product__img[data-failed="1"] { display: none; }

.bb-product__media-badge {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 3;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bb-forest);
    color: var(--bb-paper);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px -2px rgba(31, 51, 37, 0.4);
}

.bb-product__availability {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 3;
    max-width: calc(100% - 40px);
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    box-shadow: inset 0 0 0 1px var(--bb-amber);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-product__head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
    flex-wrap: wrap;
}
.bb-product__title { min-height: 38px; }

.bb-product__foot {
    margin-top: auto;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem;
}
.bb-product__add {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bb-forest);
    color: var(--bb-paper);
    flex: 0 0 34px;
    transition: background-color .15s ease, transform .15s ease;
}
.bb-product:hover .bb-product__add {
    background: var(--bb-amber);
    color: var(--bb-ink);
    transform: rotate(90deg);
}

/* Smaller inline qty stepper inside product card */
.bb-qty--inline {
    padding: 2px;
}
.bb-qty--inline button {
    width: 30px; height: 30px;
    font-size: 1rem;
}
.bb-qty--inline .bb-qty__value {
    min-width: 24px;
    font-size: 0.92rem;
}

/* ── Mandje (receipt) column ──────────────────────────────────────── */
.bb-receipt--stack {
    padding: 22px 22px 22px;
    display: flex; flex-direction: column; gap: 14px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}
.bb-receipt--stack > :not(.bb-receipt__lines) {
    flex-shrink: 0;
}
.bb-receipt__lines {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
    flex: 1 1 auto;
    min-height: 7rem;
    overflow-y: auto;
    padding-right: 2px;
}
.bb-receipt__lines::-webkit-scrollbar { width: 6px; }
.bb-receipt__lines::-webkit-scrollbar-thumb { background: var(--bb-line); border-radius: 3px; }

.bb-receipt-line {
    padding: 10px 4px 12px;
    border-bottom: 1px dotted var(--bb-line);
}
.bb-receipt-line:last-child { border-bottom: 0; }
.bb-receipt-line__top {
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between;
    gap: 0.4rem;
}
.bb-receipt-line__name {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1.25;
    color: var(--bb-ink);
}
.bb-receipt-line__remove {
    flex: 0 0 26px;
}
.bb-receipt-line__bottom {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.bb-receipt-line__price-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    margin-left: auto;
}
.bb-receipt-line__price-group > span {
    font-size: 0.82rem;
    line-height: 1.2;
}
.bb-receipt-line__price-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}
.bb-receipt-line__total {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums;
}
.bb-receipt-line__price-row .bb-receipt-line__remove,
.bb-receipt-line__price-row .bb-button--edit {
    flex-basis: 32px;
}

.bb-qty--sm {
    padding: 2px;
}
.bb-qty--sm button {
    width: 28px; height: 28px;
    font-size: 0.95rem;
}
.bb-qty--sm .bb-qty__value {
    min-width: 22px;
    font-size: 0.88rem;
}

.bb-receipt__sums {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 0.85rem;
    color: var(--bb-ink-muted);
}
.bb-receipt__sum-row { display: flex; justify-content: space-between; }
.bb-receipt__divider {
    border-top: 1px dashed var(--bb-line);
    margin: 16px 0;
}
.bb-receipt__total {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 0.5rem;
}
.bb-receipt__total .bb-total {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}
.bb-receipt__hint {
    font-size: 0.78rem;
    color: var(--bb-amber-deep);
    margin-top: 4px;
    line-height: 1.3;
}

/* Empty states */
.bb-empty {
    background: var(--bb-paper-deep);
    border: 1px dashed var(--bb-line);
    border-radius: var(--bb-radius-lg);
    padding: 36px 24px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.bb-empty p { margin: 0; }

@media (max-width: 820px) {
    .bb-product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .bb-product { min-height: 240px; padding: 10px; }
    .bb-product__name { font-size: 0.98rem; }
    .bb-price { font-size: 1.15rem; }
}

@media (max-width: 480px) {

    .bb-product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .bb-product { min-height: 220px; }
}

/* ------------------------------------------------------------------
   Open bonnen multi-ticket strip
   ------------------------------------------------------------------ */
.bb-ticket {
    flex: 0 0 220px;
    min-width: 220px;
    text-align: left;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    padding: 12px 14px 14px;
    display: flex; flex-direction: column; gap: 4px;
    cursor: pointer;
    position: relative;
    scroll-snap-align: start;
    transition: border-color .15s ease, transform .15s ease,
                background-color .15s ease, box-shadow .15s ease;
    font-family: var(--bb-font-sans);
}
.bb-ticket:hover {
    border-color: var(--bb-forest);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -16px rgba(31, 51, 37, 0.4);
}
.bb-ticket:focus-visible {
    outline: 2px solid var(--bb-forest);
    outline-offset: 2px;
}

.bb-ticket__top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.4rem;
}
.bb-ticket__badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px 3px 8px;
    border-radius: 999px;
}
.bb-ticket__badge--active {
    background: var(--bb-forest);
    color: var(--bb-paper);
}
.bb-ticket__badge--parked {
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
}
.bb-ticket__pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--bb-amber);
    box-shadow: 0 0 0 0 var(--bb-amber);
    animation: bb-ticket-pulse 1.8s ease-out infinite;
}
@keyframes bb-ticket-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(199, 125, 44, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(199, 125, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(199, 125, 44, 0); }
}

.bb-ticket__age {
    font-size: 0.72rem;
    color: var(--bb-ink-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.bb-ticket__title {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.02rem;
    letter-spacing: -0.005em;
    color: var(--bb-ink);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bb-ticket__meta {
    font-size: 0.78rem;
    color: var(--bb-ink-muted);
    font-variant-numeric: tabular-nums;
}

/* Active state leaf accent */
.bb-ticket--active {
    background:
        radial-gradient(circle at 100% 0%, rgba(199, 125, 44, 0.12), transparent 60%),
        var(--bb-surface);
    border-color: var(--bb-forest);
    border-width: 1.5px;
    box-shadow: 0 6px 20px -16px rgba(31, 51, 37, 0.45);
    cursor: default;
}
.bb-ticket--active:hover {
    transform: none;
    box-shadow: 0 6px 20px -16px rgba(31, 51, 37, 0.45);
}

/* Parked state */
.bb-ticket--parked {
    border: 1px dashed var(--bb-line);
    background: var(--bb-surface-alt);
    padding-right: 36px; /* room for discard */
}
.bb-ticket--parked:hover {
    background: var(--bb-surface);
    border-style: solid;
}
.bb-ticket__discard {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

/* New ticket card affordance */
.bb-ticket--new {
    flex: 0 0 160px;
    min-width: 160px;
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center;
    gap: 4px;
    border: 1px dashed var(--bb-forest);
    background: transparent;
    color: var(--bb-forest-deep);
}
.bb-ticket--new:hover {
    background: var(--bb-forest-tint);
    border-style: solid;
}
.bb-ticket__plus {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--bb-forest);
}
.bb-ticket__new-label {
    font-weight: 700;
    font-size: 0.9rem;
}
.bb-ticket__new-hint {
    font-size: 0.72rem;
    color: var(--bb-ink-muted);
    letter-spacing: 0.02em;
}

/* Park button in receipt aside */
.bb-receipt__park {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.45rem;
    margin-top: 8px;
    padding: 10px 14px;
    background: transparent;
    border: 1px dashed var(--bb-line);
    border-radius: var(--bb-radius);
    color: var(--bb-ink-soft);
    font-family: var(--bb-font-sans);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.bb-receipt__park:hover:not(:disabled) {
    background: var(--bb-amber-tint);
    border-color: var(--bb-amber);
    border-style: solid;
    color: var(--bb-amber-deep);
}
.bb-receipt__park:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ------------------------------------------------------------------
   Coupon picker + voucher redeem in receipt aside
   ------------------------------------------------------------------ */
.bb-discount-tools {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dotted var(--bb-line);
}

.bb-coupon-picker .mud-input-control { margin-top: 0; }

.bb-coupon-option {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.6rem;
    align-items: center;
    padding: 2px 0;
    width: 100%;
}
.bb-coupon-option__code {
    font-family: var(--bb-font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bb-forest-deep);
    background: var(--bb-forest-tint);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.bb-coupon-option__name {
    color: var(--bb-ink);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bb-coupon-option__discount {
    font-family: var(--bb-font-display);
    font-weight: 500;
    color: var(--bb-amber-deep);
    font-size: 0.92rem;
}

.bb-return-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    border-radius: var(--bb-radius);
    margin: 16px 20px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.bb-return-banner__text {
    flex: 1;
    min-width: 0;
}
.bb-return-banner__stop {
    height: 36px;
    padding: 0 12px;
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-amber-deep);
    background: transparent;
    color: var(--bb-amber-deep);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}
.bb-return-banner__swap {
    background: var(--bb-amber-deep);
    color: var(--bb-amber-tint);
}
.bb-kassa-panel__exchange {
    display: flex;
    justify-content: flex-end;
}
.bb-return-banner__swap[aria-pressed="true"] {
    background: transparent;
    color: var(--bb-amber-deep);
}
@media (max-width: 600px) {
    .bb-return-banner {
        margin: 0 0 12px;
        flex-wrap: wrap;
    }
}

/* Product option / variant selection */
.bb-product__options-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--bb-forest-deep);
    background: var(--bb-forest-tint);
    border-radius: 6px;
    padding: 2px 8px;
}
.bb-variant-hint {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--bb-ink-muted);
    font-size: 0.72rem;
}
.bb-variant-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bb-variant-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 88px;
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
    border-radius: var(--bb-radius);
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.bb-variant-chip:hover { border-color: var(--bb-forest); }
.bb-variant-chip--selected {
    border-color: var(--bb-forest);
    background: var(--bb-forest-tint);
}
.bb-variant-chip__name { font-weight: 700; color: var(--bb-ink); }
.bb-variant-chip__delta { font-size: 0.78rem; color: var(--bb-amber-deep); }
.bb-variant-chip__stock { font-size: 0.72rem; color: var(--bb-ink-muted); }
.bb-variant-chip__stock--out { color: var(--bb-brick); }
.bb-receipt-line__variant {
    display: block;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--bb-forest-deep);
    margin-top: 1px;
}

/* Round-off quick targets for manual discount */
.bb-discount-round {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.bb-discount-round__label {
    font-size: 0.78rem;
    color: var(--bb-ink-muted);
}
.bb-discount-round__chip {
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
    color: var(--bb-forest-deep);
    border-radius: 999px;
    padding: 3px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.bb-discount-round__chip:hover {
    background: var(--bb-forest-tint);
    border-color: var(--bb-forest);
}

/* Discount sum row */
.bb-receipt__sum-row--discount {
    align-items: center;
    color: var(--bb-amber-deep);
    font-weight: 600;
}

.bb-receipt__sum-row--discount > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bb-receipt__discount-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    border-radius: var(--bb-radius);
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--bb-font-sans);
    letter-spacing: 0.02em;
}

.bb-receipt__discount-chip--voucher {
    background: var(--bb-forest-tint);
    color: var(--bb-forest-deep);
}
.bb-receipt__chip-remove {
    padding: 2px;
    width: 20px;
    height: 20px;
}
.bb-receipt__discount-amount {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------------
   Split-payment ledger (Afrekenen)
   ------------------------------------------------------------------ */
.bb-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 32px;
    align-items: start;
}
@media (max-width: 960px) {
    .bb-checkout { grid-template-columns: 1fr; }
}

.bb-tender {
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    padding: 24px 22px 22px;
}
.bb-tender__head { margin-bottom: 14px; }

.bb-tender-leg {
    display: grid;
    grid-template-columns: 36px 1fr auto 30px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: var(--bb-paper);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius);
    margin-bottom: 8px;
    position: relative;
    transition: border-color .15s ease, background-color .15s ease;
}
.bb-tender-leg:hover { border-color: var(--bb-ink-muted); }
.bb-tender-leg__icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bb-forest);
    color: var(--bb-paper);
    display: inline-flex; align-items: center; justify-content: center;
}
.bb-tender-leg__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bb-ink);
}
.bb-tender-leg__hint {
    font-size: 0.76rem;
    color: var(--bb-ink-muted);
    margin-top: 2px;
}
.bb-tender-leg__amount {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.bb-tender-leg__x {
    width: 28px;
    display: inline-flex;
    justify-content: center;
    border-radius: 50%;
}

.bb-tender__methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.bb-tender-method {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius);
    cursor: pointer;
    font-family: var(--bb-font-sans);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--bb-ink-soft);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.bb-tender-method:hover {
    border-color: var(--bb-forest);
    color: var(--bb-ink);
}
.bb-tender-method--selected {
    background: var(--bb-forest-tint);
    border-color: var(--bb-forest);
    color: var(--bb-forest-deep);
}

.bb-tender__amount-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
    margin: 6px 0;
}

.bb-tender__amount-input { 
    flex: 1; 
    min-width: 140px; 
    margin: 0 !important;
}


/* ------------------------------------------------------------------
   Boekhouding sync ledger register (/beheer/sync)
   ------------------------------------------------------------------ */
.bb-sync { max-width: 780px; position: relative; z-index: 1; }

@keyframes bb-sync-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bb-rise {
    opacity: 0;
    animation: bb-sync-rise .55s cubic-bezier(.2,.85,.3,1) both;
    padding: 52px 32px;
}

/* ── Loading shimmer ─────────────────────────────────────────────── */
.bb-sync-probe {
    display: flex; align-items: center; gap: 0.9rem; justify-content: center;
    color: var(--bb-ink-muted);
    font-family: var(--bb-font-display);
    font-style: italic;
    font-variation-settings: "SOFT" 80;
    font-size: 1.05rem;
}

/* ── Hero journal slip ───────────────────────────────────────────── */
.bb-sync-slip {
    position: relative;
    background:
        radial-gradient(120% 90% at 100% -10%, rgba(199, 125, 44, 0.10), transparent 55%),
        var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    padding: 30px 34px 26px 38px;
    overflow: hidden;
    box-shadow: var(--bb-shadow-soft);
}
/* double accounting rule down the spine */
.bb-sync-slip::before {
    content: "";
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 6px;
    background:
        linear-gradient(var(--bb-forest), var(--bb-forest)) 0 0 / 2px 100% no-repeat,
        linear-gradient(var(--bb-forest), var(--bb-forest)) 4px 0 / 2px 100% no-repeat;
    opacity: 0.8;
}

.bb-sync-window {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin: 0.55rem 0 0.5rem;
}
.bb-sync-window__range {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: clamp(1.7rem, 4.4vw, 2.55rem);
    line-height: 1.0;
    letter-spacing: -0.02em;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums lining-nums;
    display: inline-flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
}
.bb-sync-window__arrow {
    color: var(--bb-amber);
    font-style: italic;
    font-variation-settings: "SOFT" 90;
    font-weight: 400;
}
/* forest wax-seal day count */
.bb-sync-seal {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 58px; height: 58px; padding: 0 10px;
    background: var(--bb-forest);
    color: var(--bb-paper);
    border-radius: 50%;
    line-height: 1;
    box-shadow: inset 0 0 0 2px var(--bb-surface), inset 0 0 0 3px var(--bb-forest);
    flex: 0 0 auto;
}
.bb-sync-seal__n { font-family: var(--bb-font-display); font-weight: 600; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.bb-sync-seal__l { font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; margin-top: 2px; opacity: 0.82; }

.bb-sync-last {
    color: var(--bb-ink-muted);
    font-size: 0.92rem;
    margin-bottom: 1.4rem;
}
.bb-sync-last strong { color: var(--bb-ink); font-variant-numeric: tabular-nums; }

.bb-sync-pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 560px) { .bb-sync-pickers { grid-template-columns: 1fr; } }

.bb-sync-warn {
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin-top: 0.9rem;
    padding: 10px 14px;
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    border-radius: var(--bb-radius);
    font-size: 0.85rem;
    line-height: 1.35;
    font-weight: 600;
}
.bb-sync-warn--error { background: #F2DCD3; color: var(--bb-brick); }

.bb-sync-actions {
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    margin-top: 1.7rem;
}
.bb-sync-actions__hint { color: var(--bb-ink-muted); font-size: 0.85rem; max-width: 34ch; }

/* ── Journal register (ledger leader rows) ───────────────────────── */
.bb-sync-register {
    margin-top: 1.7rem;
    border-top: 1px dashed var(--bb-line);
    padding-top: 1.2rem;
}
.bb-sync-reg-row {
    display: flex; align-items: baseline; gap: 0.5rem;
    padding: 8px 0;
}
.bb-sync-reg-row + .bb-sync-reg-row { border-top: 1px dotted var(--bb-line); }
.bb-sync-reg-row__name { font-size: 0.9rem; color: var(--bb-ink-soft); font-weight: 600; white-space: nowrap; }
.bb-sync-reg-row__dots { flex: 1; border-bottom: 1.5px dotted var(--bb-line); transform: translateY(-4px); }
.bb-sync-reg-row__date { font-size: 0.85rem; color: var(--bb-ink-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.bb-sync-reg-row__date--none { color: var(--bb-ink-faint); font-style: italic; }

/* ── Running meter ───────────────────────────────────────────────── */
.bb-sync-meter__top {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.bb-sync-meter__count {
    font-family: var(--bb-font-display);
    font-weight: 500;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--bb-ink);
    font-variant-numeric: tabular-nums lining-nums;
}
.bb-sync-meter__count small { color: var(--bb-ink-faint); font-size: 0.42em; }
.bb-sync-meter__pct {
    font-family: var(--bb-font-display);
    font-size: 1.4rem;
    color: var(--bb-forest);
    font-variant-numeric: tabular-nums;
}

.bb-sync-rail {
    height: 9px;
    border-radius: 999px;
    background: var(--bb-line-soft);
    overflow: hidden;
    position: relative;
    margin: 1.2rem 0 1rem;
}
.bb-sync-rail__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--bb-forest), var(--bb-moss));
    transition: width .4s cubic-bezier(.3,.8,.4,1);
    position: relative;
    min-width: 9px;
}
.bb-sync-rail__fill::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(244, 239, 227, 0.45) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: bb-sync-scan 1.5s linear infinite;
}
@keyframes bb-sync-scan {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.bb-sync-ticker {
    display: inline-flex; align-items: center; gap: 0.55rem;
    color: var(--bb-ink-muted);
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.bb-sync-ticker__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--bb-amber);
    box-shadow: 0 0 0 0 rgba(199, 125, 44, 0.5);
    animation: bb-ticket-pulse 1.6s ease-out infinite;
}

/* ── Results ledger ──────────────────────────────────────────────── */
.bb-sync-summary {
    display: flex; gap: 0.6rem; flex-wrap: wrap;
    margin: 0.4rem 0 1.5rem;
}

.bb-sync-ledger {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums lining-nums;
}
.bb-sync-ledger thead th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--bb-ink-muted);
    padding: 0 0 10px;
    border-bottom: 1px solid var(--bb-line);
}
.bb-sync-ledger thead th:last-child { text-align: right; }
.bb-sync-ledger tbody td {
    padding: 11px 0;
    border-bottom: 1px dotted var(--bb-line);
    font-size: 0.9rem;
    color: var(--bb-ink-soft);
    vertical-align: baseline;
}
.bb-sync-ledger tbody tr:last-child td { border-bottom: 0; }
.bb-sync-ledger tbody tr { animation: bb-sync-rise .4s cubic-bezier(.2,.85,.3,1) both; }
.bb-sync-ledger__id { font-family: var(--bb-font-display); font-weight: 500; color: var(--bb-ink); }
.bb-sync-ledger__name { color: var(--bb-ink); }
.bb-sync-ledger__status { text-align: right; white-space: nowrap; font-weight: 600; }
.bb-sync-ledger__status--ok   { color: var(--bb-sage); }
.bb-sync-ledger__status--fail { color: var(--bb-brick); }
.bb-sync-ledger__status--skip { color: var(--bb-ink-faint); }
.bb-sync-ledger__message { display: inline-block; max-width: 30rem; white-space: normal; text-align: left; }

.bb-sync-scroll {
    max-height: 460px;
    overflow-y: auto;
    margin-top: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: var(--bb-line) transparent;
}
.bb-sync-scroll::-webkit-scrollbar { width: 6px; }
.bb-sync-scroll::-webkit-scrollbar-thumb { background: var(--bb-line); border-radius: 3px; }

.w-100{
    width: 100%
}

/* ------------------------------------------------------------------
   Kassa top bar: actions in the app bar, panels open over the page
   ------------------------------------------------------------------ */
.bb-shell--kassa {
    --mud-appbar-height: 72px;
}

.bb-shell--kassa .mud-appbar {
    backdrop-filter: none;
}

.bb-shell--kassa .mud-appbar .mud-toolbar-appbar {
    position: relative;
    gap: 8px;
    padding: 0 24px;
    height: var(--mud-appbar-height);
}

.bb-shell--kassa .mud-appbar .bb-brand {
    flex-shrink: 0;
    margin-right: 8px;
    padding-right: 16px;
    border-right: 1px solid var(--bb-line);
}

.bb-shell--kassa .bb-page {
    padding: 24px;
}

.bb-shell--kassa .mud-appbar .mud-toolbar-appbar > .flex-grow-1 {
    display: none;
}

.bb-shell--kassa .bb-appbar__end {
    margin-left: auto;
    flex-shrink: 0;
}

.bb-user-pill {
    font-family: inherit;
    cursor: pointer;
}

.bb-user-pill__initials {
    display: none;
}

.bb-kassa-bar__slot {
    position: relative;
    flex-shrink: 0;
}

.bb-kassa-bar__slot--search {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 520px;
}

.bb-kassa-bar__button {
    height: 44px;
    padding: 0 14px;
    border-radius: var(--bb-radius);
    border: 1px solid var(--bb-line);
    background: var(--bb-surface);
    color: var(--bb-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.bb-kassa-bar__button:hover {
    border-color: var(--bb-forest);
}

.bb-kassa-bar__button:focus-visible {
    outline: 2px solid var(--bb-amber);
    outline-offset: 2px;
}

.bb-kassa-bar__button--active {
    border-color: var(--bb-forest);
    background: var(--bb-forest-tint);
    color: var(--bb-forest-deep);
}

.bb-kassa-bar__button--return {
    border: 1px dashed var(--bb-brick);
    background: transparent;
    color: var(--bb-brick);
}

.bb-kassa-bar__button--return:hover {
    border-color: var(--bb-brick);
    background: var(--bb-brick-tint);
}

.bb-kassa-bar__button--return-active,
.bb-kassa-bar__button--return-active:hover {
    border-style: solid;
    background: var(--bb-brick);
    color: var(--bb-paper);
}

.bb-kassa-bar__button--divers {
    border: 1px dashed var(--bb-ink-faint);
    background: transparent;
}

.bb-kassa-bar__label {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-kassa-bar__badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 11px;
    background: var(--bb-amber-tint);
    color: var(--bb-amber-deep);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bb-kassa-backdrop {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 100vh;
    background: var(--bb-scrim);
    z-index: 1;
}

.bb-kassa-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 2;
    width: 600px;
    max-width: calc(100vw - 48px);
    max-height: calc(100dvh - var(--mud-appbar-height) - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-pop);
    color: var(--bb-ink);
    cursor: default;
}

.bb-kassa-panel--customer {
    width: 540px;
}

.bb-kassa-panel--products {
    width: 760px;
}

.bb-kassa-panel__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bb-ink-muted);
}

.bb-kassa-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 12px;
    text-align: center;
}

.bb-kassa-panel__empty p {
    margin: 0;
}

.bb-kassa-panel__empty-icon {
    font-size: 44px;
    color: var(--bb-ink-faint);
}

.bb-kassa-panel__empty-hint {
    color: var(--bb-ink-muted);
}

.bb-kassa-panel__progress {
    width: 200px;
    height: 2px;
    margin-top: 8px;
}

.bb-kassa-panel .bb-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.bb-tickets__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bb-tickets__grid .bb-ticket {
    flex: none;
    min-width: 0;
    min-height: 112px;
    padding-right: 40px;
}

.bb-tickets__grid .bb-ticket--new {
    padding-right: 14px;
}

.bb-camera-dialog.mud-dialog {
    background: var(--bb-forest-deep);
}

.bb-camera-dialog .bb-camera-dialog__content.mud-dialog-content {
    padding: 0;
    margin: 0;
    height: 100%;
    overflow: hidden !important;
}

@media (max-width: 1180px) {
    .bb-shell--kassa {
        --mud-appbar-height: 64px;
    }

    .bb-shell--kassa .mud-appbar .mud-toolbar-appbar {
        padding: 0 16px;
    }

    .bb-shell--kassa .mud-appbar .bb-brand {
        margin-right: 0;
        padding-right: 6px;
        border-right: 0;
    }

    .bb-shell--kassa .mud-appbar .bb-brand__name,
    .bb-shell--kassa .mud-appbar .bb-brand__tag {
        display: none;
    }

    .bb-shell--kassa .bb-page {
        padding: 16px;
    }

    .bb-kassa-bar__slot--tickets .bb-kassa-bar__text,
    .bb-kassa-bar__button--return .bb-kassa-bar__text,
    .bb-kassa-bar__button--divers .bb-kassa-bar__text {
        display: none;
    }

    .bb-kassa-bar__slot--tickets .bb-kassa-bar__button {
        padding: 0 10px;
    }

    .bb-kassa-bar__button--return,
    .bb-kassa-bar__button--divers {
        width: 44px;
        padding: 0;
    }

    .bb-kassa-bar__button--customer {
        max-width: 180px;
        padding: 0 12px;
    }

    .bb-kassa-bar__slot--search {
        flex: 1 1 120px;
        min-width: 120px;
        max-width: none;
        position: static;
    }

    .bb-kassa-panel--products {
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 900px) {
    .bb-shell--kassa .bb-page {
        padding-bottom: 180px;
    }

    .bb-shell .bb-appbar__end {
        gap: 6px;
    }

    .bb-shell .bb-appbar__end .bb-install__label {
        display: none;
    }

    .bb-shell .bb-appbar__end .mud-button-root.bb-pill {
        min-width: 0;
        height: 44px;
        padding: 0 12px;
    }

    .bb-shell .bb-appbar__end .mud-button-root.bb-pill .mud-button-icon-start {
        margin: 0;
    }

    .bb-shell .bb-user-pill {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        font-size: 13px;
        font-weight: 800;
        color: var(--bb-ink-soft);
        background: var(--bb-surface-sunk);
    }

    .bb-shell .bb-user-pill > .mud-icon-root,
    .bb-shell .bb-user-pill__name {
        display: none;
    }

    .bb-shell .bb-user-pill__initials {
        display: inline;
    }

    .bb-kassa-bar__button--customer {
        max-width: 150px;
    }
}

@media (max-width: 600px) {
    .bb-shell--kassa .mud-appbar.mud-appbar-fixed-top {
        position: sticky;
        top: 0;
    }

    .bb-shell--kassa .mud-main-content {
        padding-top: 0;
    }

    .bb-shell--kassa .mud-appbar .mud-toolbar-appbar {
        height: auto;
        min-height: 0;
        flex-wrap: wrap;
        align-content: flex-start;
        align-items: center;
        gap: 8px;
        padding: 8px 12px 10px;
    }

    .bb-shell--kassa .bb-appbar__end {
        margin-left: 0;
    }

    .bb-kassa-bar__slot--search .mud-input-adornment-end {
        display: none;
    }

    .bb-kassa-panel {
        max-height: calc(100dvh - 220px);
    }

    .bb-shell .mud-appbar .bb-brand {
        order: 0;
        flex: 1 1 auto;
        flex-wrap: wrap;
        min-width: 0;
        max-height: 40px;
        overflow: hidden;
    }

    .bb-shell .mud-appbar .bb-brand__crest {
        width: 32px;
        height: 32px;
    }

    .bb-shell .mud-appbar .bb-brand__name {
        display: none;
    }

    .bb-shell .mud-appbar .bb-brand__tag {
        display: inline;
        padding: 0;
        margin: 0;
        border: 0;
        font-family: var(--bb-font-display);
        font-size: 18px;
        letter-spacing: 0;
        text-transform: none;
        color: var(--bb-forest);
    }

    .bb-shell .mud-appbar .bb-brand__tag::first-letter {
        text-transform: uppercase;
    }

    .bb-kassa-bar__slot,
    .bb-kassa-bar__slot--search {
        position: static;
    }

    .bb-kassa-bar__slot--tickets {
        order: 1;
    }

    .bb-shell--kassa .bb-appbar__end {
        order: 2;
        min-width: 0;
    }

    .bb-kassa-bar__slot--search {
        order: 3;
        flex: 1 0 100%;
        max-width: none;
    }

    .bb-kassa-bar__slot--customer {
        order: 4;
        max-width: 55%;
    }

    .bb-kassa-bar__button--return {
        order: 5;
    }

    .bb-kassa-bar__button--divers {
        order: 6;
    }

    .bb-kassa-bar__slot--customer .bb-kassa-bar__button,
    .bb-kassa-bar__button--return,
    .bb-kassa-bar__button--divers {
        height: 40px;
        width: auto;
        max-width: 100%;
        padding: 0 12px;
        border-radius: 20px;
        font-size: 13px;
        gap: 6px;
    }

    .bb-kassa-bar__slot--customer .bb-kassa-bar__chevron {
        display: none;
    }

    .bb-kassa-bar__button--return .bb-kassa-bar__text,
    .bb-kassa-bar__button--divers .bb-kassa-bar__text {
        display: inline;
    }

    .bb-kassa-bar__button--return .mud-icon-root,
    .bb-kassa-bar__button--divers .mud-icon-root {
        display: none;
    }

    .bb-kassa-panel,
    .bb-kassa-panel--customer,
    .bb-kassa-panel--products {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        padding: 16px;
    }

    .bb-tickets__grid {
        grid-template-columns: 1fr;
    }

    .bb-shell--kassa .bb-page {
        padding: 12px 12px 180px;
    }
}