@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/**
 * Restaurant-Treueprogramm - Stylesheet
 * Apple-Wallet-inspiriertes, minimalistisches Design (Clean & Elegant)
 * Keine störenden Symbole/Emojis – Fokus auf Typografie, Raum & Haptik
 */

:root {
    --bg-page: #f4f4f6;
    --bg-card: #ffffff;
    --accent: #6A6053;
    --card-surface: #18181b;
    --card-surface-end: #09090b;
    --card-text: #ffffff;
    --card-muted: #a1a1aa;
    --card-border: rgba(255, 255, 255, 0.12);
    --card-gold: #6A6053;
    --card-gold-glow: rgba(106, 96, 83, 0.35);
    
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    
    --border-color: #e4e4e7;
    --border-subtle: #f1f1f4;
    
    --primary: #6A6053;
    --primary-hover: #554d43;
    --primary-light: #f5f4f2;
    
    --success: #166534;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    
    --error: #991b1b;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    
    --info: #1e40af;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-card: none;

    --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: var(--font-sans);
}

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

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* =============================================================================
   TYPOGRAFIE & BASICS
   ============================================================================= */
h1, .h1, .brand-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: var(--text-primary);
}

h2, .h2, .section-title, .wallet-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
}

h3, .h3, .subsection-title, .settings-box-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--text-primary);
}

h4, .h4 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

.text-muted {
    color: var(--text-muted);
}

.font-medium {
    font-weight: 500;
}

.mt-6 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* =============================================================================
   BUTTONS & FORMULARE (EINHEITLICHE GRÖSSE)
   ============================================================================= */
.btn, .btn-sm, .btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: 44px;
    padding: 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.btn-danger {
    color: var(--error);
    border-color: var(--error-border);
}

.btn-danger:hover {
    background-color: var(--error-bg);
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .col {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.form-hint {
    display: block;
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.1);
}

.form-control-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.form-control-lg {
    padding: 0.95rem 1.25rem;
    font-size: 1.15rem;
}

.text-center {
    text-align: center;
}

/* =============================================================================
   MELDUNGEN & BANNER
   ============================================================================= */
.banner {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.banner-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
}

.banner-desc {
    font-size: 0.825rem;
    line-height: 1.4;
}

.banner-success {
    background-color: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.banner-error {
    background-color: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.banner-info {
    background-color: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error-border);
}

/* =============================================================================
   AUTH SEITEN (LOGIN & ADMIN LOGIN)
   ============================================================================= */
.page-auth {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
}

.page-auth, .page-auth *, .page-admin-auth, .page-admin-auth * {
    box-shadow: none !important;
}

.auth-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 1.25rem 1rem;
    box-sizing: border-box;
}

.auth-top-branding {
    text-align: center;
    width: 100%;
    padding-top: 0.5rem;
}

.auth-top-branding .auth-logo-img {
    max-width: 240px;
    width: 75%;
    height: auto;
    margin: 0 auto 0.65rem auto;
    display: block;
}

.auth-top-branding .brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 2.25rem 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin: auto 0;
}

.auth-welcome-badge {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.35rem;
    letter-spacing: -0.015em;
}

.auth-field-group {
    margin-bottom: 0.25rem;
    text-align: center;
}

.auth-field-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
    text-align: center;
}

.auth-screen-footer {
    text-align: center;
    width: 100%;
    padding: 1rem 0 0.5rem 0;
    font-size: 0.825rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* =============================================================================
   KUNDEN-ANSICHT (INDEX.PHP) - APPLE WALLET STYLE
   ============================================================================= */
.page-customer {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #f2f2f4;
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Zentrierte Top-Nav nur mit Name (ohne Profilbild & ohne Pfeil) */
.customer-top-nav, .top-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.5rem 0.75rem;
    position: relative;
    z-index: 25;
}

.customer-name-btn {
    background: transparent;
    border: 1.5px solid #6A6053;
    color: #6A6053;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    padding: 0.4rem 1.15rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.customer-name-btn:hover {
    color: #554d43;
    border-color: #554d43;
    background: rgba(106, 96, 83, 0.08);
}

/* Profil & Logout Popup Modal */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.profile-modal.is-visible {
    display: flex;
}

.profile-modal-dialog {
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
    box-shadow: none;
}

.profile-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.profile-modal-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #6A6053;
    font-size: 1.25rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem auto;
    border: 1px solid var(--border-color);
}

.profile-modal-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-modal-email {
    font-size: 0.875rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 1.5rem;
}

/* Wallet Card (Hintergrund: Akzentfarbe #6A6053) */
.card-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.wallet-card {
    background: #6A6053;
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 1.75rem 1.5rem;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Kein Lichtreflex */
.wallet-card::before {
    display: none;
}

.wallet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.wallet-card-eyebrow {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.25rem;
}

.wallet-card-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.wallet-badge {
    background: rgba(0, 0, 0, 0.22);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.wallet-badge-count {
    color: #ffffff;
}

.wallet-badge-sep {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0.15rem;
}

.wallet-badge-total {
    color: rgba(255, 255, 255, 0.7);
}

.wallet-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.wallet-progress-fill {
    height: 100%;
    background: #ffffff;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

/* Stempel-Raster & Mittagessen-Symbol */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.55rem;
    margin: 0.65rem 0;
}

.stamp-slot {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
    user-select: none;
    border: none !important;
}

.stamp-slot.is-empty {
    background: rgba(0, 0, 0, 0.16);
}

.stamp-slot.is-collected {
    background: #ffffff;
    box-shadow: none;
}

.stamp-lunch-img {
    width: 22px;
    height: 19px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

.stamp-empty-img {
    opacity: 0.35;
}

.stamp-collected-img {
    opacity: 1;
}

/* Stempel-Animation bei ?stamped=1 */
.stamp-slot.just-stamped {
    animation: stampPop 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampPop {
    0% {
        transform: scale(0) rotate(-15deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.28) rotate(4deg);
        opacity: 1;
    }
    80% {
        transform: scale(0.92) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.wallet-card-footer {
    border-top: none;
    padding-top: 0.85rem;
    text-align: center;
}

.wallet-card-info {
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Branding Header (Login) & Footer (Kunde) */
.auth-brand-block {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-img {
    max-width: 220px;
    width: 80%;
    height: auto;
    margin: 0 auto 0.75rem auto;
    display: block;
}

.customer-bottom-branding {
    text-align: center;
    margin-top: auto;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    width: 100%;
}

.customer-footer-logo {
    max-width: 220px;
    width: 70%;
    height: auto;
    margin: 0 auto 0.45rem auto;
    display: block;
    opacity: 0.85;
}

.customer-footer-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* Floating Toast Banner (schwebt oben, verschiebt darunterliegende Karten/Logo nicht) */
.page-customer .banner {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    max-width: 360px;
    z-index: 9999;
    margin: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-lg);
    text-align: center;
    pointer-events: none;
    animation: toastFloatIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-customer .banner.is-hiding {
    opacity: 0;
    transform: translate(-50%, -15px);
}

@keyframes toastFloatIn {
    from {
        opacity: 0;
        transform: translate(-50%, -15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* =============================================================================
   CARD STACK SYSTEM (STATIONÄRES PAKET: 20% SCHMALER, 54PX TAB-VERSATZ)
   ============================================================================= */
.card-stack-wrapper {
    position: relative;
    width: 100%;
    height: 358px;
    margin: 3.25rem auto 1.5rem auto;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
}

/* Beide Karten im Vordergrund exakt gleich gross (20% schmaler in der Höhe: 304px) */
.card-stamps, .card-voucher {
    width: 100%;
    height: 304px;
    box-sizing: border-box;
    border-radius: var(--radius-xl);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.28s ease, 
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Stempelkarte (Braun, reine solide Akzentfarbe, oben verankert) */
.card-stamps {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 304px;
    background: #6A6053;
    color: #ffffff;
    padding: 1.15rem 1.25rem 0.85rem;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-stamps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
}

.card-stamps-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
}

/* 2. Gutschein-Karten-Stapel (unten verankert bei top: 54px, ragt bis 358px) */
.card-vouchers-stack {
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    height: 304px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s ease;
}

.card-voucher {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 304px;
    background: #ffffff;
    border: 1.5px solid #dcd7cf;
    color: var(--text-primary);
    padding: 1.15rem 1.25rem 0.85rem;
    border-radius: var(--radius-xl);
    box-shadow: none;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.card-voucher.is-visible-voucher {
    display: flex;
}

.voucher-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-height: 0;
}

.voucher-card-body-scroll {
    max-height: 224px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
}

.voucher-card-body-scroll::-webkit-scrollbar {
    width: 4px;
}

.voucher-card-body-scroll::-webkit-scrollbar-thumb {
    background: #dcd7cf;
    border-radius: 4px;
}

.voucher-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.voucher-group-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.voucher-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}

.voucher-group-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent);
    color: #ffffff;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    line-height: 1.3;
}

.voucher-codes-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    width: 100%;
}

.voucher-code-digits {
    display: inline-flex;
    gap: 0.3rem;
    justify-content: center;
}

.voucher-code-digits .code-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    background: var(--primary-light);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.voucher-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Unterer Titel "Gutscheine" (sichtbar wenn Gutscheinkarte unten hervorschaut) */
.card-voucher-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    border-top: none;
    margin-top: auto;
    padding-top: 0.35rem;
}

.card-voucher-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.voucher-bottom-count {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Zustand 1: Stempelkarte vorne (Standard) */
.card-stack-wrapper.view-stamps .card-stamps {
    z-index: 10;
    transform: translateY(0) scale(1);
    opacity: 1;
    cursor: default;
}

/* Hintere Gutscheinkarte: verweilt bei top: 54px, 54px schauen unten hervor */
.card-stack-wrapper.view-stamps .card-vouchers-stack {
    z-index: 5;
    transform: translateY(0) scale(0.95);
    opacity: 0.98;
    cursor: pointer;
}

.card-stack-wrapper.view-stamps .card-vouchers-stack:hover {
    transform: translateY(4px) scale(0.96);
}

.card-stack-wrapper.view-stamps .card-voucher {
    box-shadow: none;
}

/* Zustand 2: Gutschein vorne (nach Wischen / Klick) */
.card-stack-wrapper.view-vouchers .card-vouchers-stack {
    z-index: 10;
    transform: translateY(0) scale(1);
    opacity: 1;
    cursor: default;
}

/* Hintere Stempelkarte: verweilt bei top: 0, 54px schauen oben hervor */
.card-stack-wrapper.view-vouchers .card-stamps {
    z-index: 5;
    transform: translateY(0) scale(0.95);
    opacity: 0.98;
    cursor: pointer;
}

.card-stack-wrapper.view-vouchers .card-stamps:hover {
    transform: translateY(-4px) scale(0.96);
}

.voucher-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.voucher-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: none;
}

/* Klickbare Einlöse-Historie unterhalb des Stempels */
.history-toggle-wrap {
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.history-toggle-btn {
    background: transparent;
    border: none;
    font-size: 0.825rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s;
}

.history-toggle-btn:hover {
    color: var(--text-primary);
}

.history-accordion {
    display: none;
    margin-top: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: left;
}

.history-accordion.is-open {
    display: block;
}

/* =============================================================================
   GUTSCHEIN-SCHUBLADE (BOTTOM SHEET / DRAWER)
   ============================================================================= */
.voucher-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    box-shadow: none;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    transform: translateY(calc(100% - 64px)); /* 64px bleiben unten sichtbar als Gripper */
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.voucher-drawer.is-open {
    transform: translateY(0);
}

.drawer-header {
    height: 64px;
    padding: 0.5rem 1.25rem 0.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

.drawer-handle {
    width: 38px;
    height: 4px;
    background-color: #d4d4d8;
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

.drawer-peek-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-peek-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drawer-peek-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.voucher-drawer.is-open .drawer-peek-arrow {
    transform: rotate(180deg);
}

.drawer-content {
    overflow-y: auto;
    padding: 1rem 1.25rem 2.5rem;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Gutschein-Karten im Drawer */
.voucher-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.voucher-ticket {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.voucher-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.voucher-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.voucher-date {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.voucher-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.voucher-code-wrap {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    text-align: center;
}

.voucher-code-caption {
    display: block;
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.voucher-code-box {
    display: inline-flex;
    gap: 0.35rem;
    justify-content: center;
}

.code-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 38px;
    background: var(--primary-light);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.history-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.history-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: #fcfcfc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.history-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--primary-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.empty-state-text {
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Partikel-Canvas */
.fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

/* =============================================================================
   ADMIN PORTAL
   ============================================================================= */
.page-admin {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.admin-shell {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.admin-topbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0.5rem 1rem 0.5rem;
    border-bottom: none;
    margin-bottom: 1.5rem;
}

/* Admin Tabs */
.admin-nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.75rem;
    overflow-x: auto;
}

.admin-tab-btn {
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.admin-tab-btn:hover {
    color: var(--text-primary);
}

.admin-tab-btn.is-active {
    color: var(--text-primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.admin-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.85rem;
}

/* QR Panel */
.qr-display-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    align-items: center;
}

.qr-panel-info {
    flex: 1;
    min-width: 280px;
}

.qr-cycle-meta {
    background: #fbfbfb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.meta-row {
    margin-bottom: 0.65rem;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-label {
    display: block;
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.qr-panel-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qr-box-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.qr-box-wrap canvas, .qr-box-wrap img {
    margin: 0 auto;
}

.qr-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

/* Redeem Card */
.redeem-card {
    max-width: 480px;
    margin: 1rem 0 2rem;
}

.code-input {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    letter-spacing: 0.12em;
    font-weight: 700;
}

/* Tabellen */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.admin-table th {
    background: #fbfbfb;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge-code {
    font-family: var(--font-mono);
    font-weight: 600;
    background: var(--primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-status {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 12px;
    font-size: 0.775rem;
    font-weight: 600;
}

.badge-active {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-neutral {
    background: var(--primary-light);
    color: var(--text-muted);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

/* Kunden-Übersicht */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.search-box {
    width: 100%;
    max-width: 320px;
}

/* Statistiken-Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-card {
    width: 100%;
    max-width: 100%;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.settings-box-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

/* =============================================================================
   PRINT TISCHAUFSTELLER (NUR BEIM DRUCKEN SICHTBAR)
   ============================================================================= */
.print-table-stand {
    display: none;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .admin-shell, .top-nav, .voucher-drawer, .btn, .fx-canvas {
        display: none !important;
    }

    .print-table-stand {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 3rem 2rem;
        text-align: center;
    }

    .print-header {
        margin-bottom: 2rem;
    }

    .print-brand {
        font-size: 2.25rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin-bottom: 0.5rem;
    }

    .print-sub {
        font-size: 1.2rem;
        color: #333333;
    }

    .print-qr-wrap {
        padding: 1.5rem;
        border: 2px solid #000000;
        border-radius: 18px;
        margin-bottom: 2.5rem;
        background: #ffffff;
    }

    .print-instructions {
        max-width: 480px;
        text-align: left;
        margin-bottom: 3rem;
    }

    .print-instructions h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .print-instructions ol {
        padding-left: 1.5rem;
        line-height: 1.8;
        font-size: 1.05rem;
    }

    .print-footer {
        font-size: 0.95rem;
        color: #555555;
    }
}

/* =============================================================================
   MINIMALISTISCHES MULTI-STEP LOGIN (ZENTRIERTE FELDER & RUNDER PFEIL-BUTTON)
   ============================================================================= */
.auth-step {
    display: none;
    animation: authFadeIn 0.25s ease-out;
}

.auth-step.is-active {
    display: block;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-centered-input {
    width: 100%;
    text-align: center;
    font-size: 1.05rem;
    padding: 0.85rem 1.25rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-primary);
    outline: none;
    box-shadow: none !important;
    transition: border-color 0.2s;
}

.auth-centered-input:focus {
    border-color: #6A6053;
}

.auth-centered-input::placeholder {
    color: var(--text-muted);
}

.auth-btn-center-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.25rem;
}

.btn-round-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #6A6053;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-round-arrow:hover {
    background-color: #554d43;
    transform: scale(1.04);
}

.btn-round-arrow:active {
    transform: scale(0.96);
}

.auth-back-link {
    display: inline-block;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.auth-back-link:hover {
    color: #6A6053;
}

.magic-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f7f6f4;
    border-radius: var(--radius-md);
    border: 1px dashed #d1ccc5;
    text-align: center;
}

/* =============================================================================
   RESPONSIVE NAVIGATION & 3-STRICHE HAMBURGER MENÜ
   ============================================================================= */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .admin-shell {
        padding: 1rem 0.75rem;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-actions {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-subtle);
    }

    .admin-actions.is-visible {
        display: flex;
    }

    .admin-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .admin-topbar {
        flex-wrap: wrap;
    }

    .admin-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.35rem;
        padding-bottom: 0.25rem;
    }

    .admin-nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .qr-panel-actions {
        flex-direction: column;
        width: 100%;
    }

    .qr-panel-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group.col {
        width: 100%;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

