.header-feedback.warning {
    background: #ffeaea;
    border-color: #d32f2f;
    color: #b43a3a;
}
/* Warenkorb blockiert (z. B. wegen Altersverifikation) */
.cart-blocked {
    border: 2px solid #d32f2f;
    background: #fff0f0;
    opacity: 0.85;
    pointer-events: auto;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* Touch-optimierte Styles für Kassier-Station */

:root {
    --admin-surface: #ffffff;
    --admin-surface-muted: #f6f6f6;
    --admin-surface-soft: #f1f1f1;
    --admin-border: #dddddd;
    --admin-border-strong: #c8c8c8;
    --admin-text: #333333;
    --admin-text-muted: #666666;
    --admin-primary: #0066cc;
    --admin-primary-dark: #0052a3;
    --admin-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --admin-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);

    --brand-primary: #1e3a5f;
    --brand-primary-hover: #274a77;
    --header-neutral: #f9f9f9;
    --header-neutral-hover: #f1f1f1;
    --surface: var(--admin-surface);
    --surface-soft: var(--admin-surface-muted);
    --surface-border: var(--admin-border);
    --text-main: var(--admin-text);
    --text-muted: var(--admin-text-muted);
    --danger: #b43a3a;
    --danger-hover: #9c2f2f;
    --success: #1e8e3e;
    --mobile-shared-feedback-slot-height: 71px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    height: 100%;
}

body {
    background-color: var(--surface-soft);
    color: var(--admin-text);
    touch-action: manipulation; /* Verhindert Zoom bei Touch */
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.login-shell {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top left, #d7e8ff, #eef3f9 60%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background-color: #ffffff;
    border: 1px solid #d7deea;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(30, 58, 95, 0.14);
    padding: 22px;
}

.login-card h1 {
    font-size: 20px;
    margin-bottom: 6px;
    color: #1e3a5f;
    text-align: left;
}

.login-card p {
    font-size: 13px;
    color: #5f6f84;
    margin-bottom: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.login-form input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    margin: 0;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: var(--admin-surface);
    color: var(--admin-text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    max-width: none;
}

.login-form input:focus {
    outline: none;
    border-color: #bdbdbd;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.04);
}

.login-form .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.login-form .form-actions .btn {
    flex: 1;
}

.login-form .btn {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: none;
}

.login-blocked-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.login-form .btn-primary {
    background-color: #4b5563;
    border-color: #3f4752;
    color: white;
}

.login-form .btn-primary:hover {
    background-color: #3f4752;
}

.login-form .btn-secondary {
    background-color: #f2f2f2;
    color: #333;
    border: 1px solid var(--admin-border);
}

.login-form .btn-secondary:hover {
    background-color: #e8e8e8;
    border-color: var(--admin-border-strong);
}

.login-error {
    border: 1px solid #f5c2c2;
    border-radius: 4px;
    background-color: #fff1f1;
    color: #9b1b1b;
    font-size: 12px;
    padding: 8px 10px;
}

body.unauthenticated .login-shell {
    display: flex;
}

body.unauthenticated .app-shell {
    display: none;
}

body.authenticated .login-shell {
    display: none;
}

body.authenticated .app-shell {
    display: grid;
}

.hidden {
    display: none;
}

/* Ensure hidden screens stay hidden even with more specific ID selectors */
.screen.hidden {
    display: none;
}

h1, h2 {
    color: var(--admin-text);
    text-align: center;
}

input, button {
    font-size: 18px; /* Groß für Touch */
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

button {
    background-color: var(--admin-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--admin-primary-dark);
}

button:active {
    background-color: #004085; /* Feedback bei Touch */
}

#main {
    display: grid;
    grid-template-rows: minmax(60px, 14vh) 1fr auto;
    align-content: start;
    gap: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

header {
    background-color: var(--header-neutral);
    color: #1e3a5f;
    padding: 12px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-feedback {
    width: 100%;
    height: 100%;
    background: var(--admin-surface-muted);
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.header-feedback.success {
    background: #c8e6c9;
    border-color: #2e7d32;
}

.header-feedback.error {
    background: #ffcccc;
    border-color: #c62828;
}

#transactionResult {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: clamp(16px, 3.2vh, 34px);
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.content {
    display: flex;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
    padding: 12px;
}

.articles-section, .customer-info-section, .transaction-section {
    background-color: var(--surface);
    padding: 12px;
    border-radius: 0;
    border: 1px solid var(--surface-border);
    box-shadow: var(--admin-shadow-sm);
    min-height: 0;
}

.articles-section {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transaction-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.articles-hidden .articles-section {
    display: none;
}

.articles-hidden .transaction-column {
    flex: 1 1 100%;
}

#customerInfo {
    margin-top: 0;
    font-size: 14px;
    line-height: 1.2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

#customerInfo p {
    margin: 0;
}

.customer-field {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    padding: 10px;
}

.customer-label {
    display: block;
    font-size: 11px;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
}

.customer-value {
    display: block;
    min-height: 1.2em;
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text);
}

.customer-field.warning-balance {
    background: #fde8e8;
    border-color: #ef4444;
}

.customer-field.warning-balance .customer-label,
.customer-field.warning-balance .customer-value {
    color: #991b1b;
}

.customer-field-compact {
    display: none;
}

#articlesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    column-gap: 4px;
    row-gap: 2px;
    margin-top: 10px;
    overflow-y: auto;
    min-height: 0;
}

.article-btn {
    background-color: var(--admin-surface);
    color: var(--admin-text);
    border: none;
    padding: 20px;
    margin: 0;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    min-height: 172px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    white-space: normal;
    line-height: 1.2;
    overflow: visible;
}

.article-image-wrap {
    width: min(72%, 110px);
    height: 78px;
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.article-symbol {
    width: min(72%, 110px);
    height: 78px;
    flex: 0 0 auto;
    min-width: 64px;
    min-height: 56px;
    border-radius: 8px;
    background: var(--admin-surface-soft);
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    border: 3px solid transparent;
}

.article-media-free-drink {
    border-color: #16a34a;
}

.article-media-age-check {
    border-color: #dc2626;
}

.article-media-free-drink-age-check {
    border: 3px solid transparent;
    background:
        linear-gradient(var(--admin-surface-soft), var(--admin-surface-soft)) padding-box,
        linear-gradient(135deg, #16a34a 0 50%, #dc2626 50% 100%) border-box;
}

.article-btn:hover {
    background-color: #f4f8fc;
}

.article-btn:active {
    background-color: #eef4fb;
}

.article-name {
    font-weight: bold;
    text-align: center;
    color: var(--admin-text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    width: 100%;
    font-size: 14px;
}

.article-price {
    font-size: 14px;
    color: var(--admin-text-muted);
    white-space: normal;
    width: 100%;
    text-align: center;
}

#cart {
    margin-top: 0;
    padding: 10px;
    background-color: var(--admin-surface-muted);
    border-radius: 0;
    border: 1px solid var(--admin-border);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#cart h3 {
    margin: 0 0 8px;
}

.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item {
    display: grid;
    grid-template-columns: 44px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 0;
    border-radius: 0;
    background: #f9fbff;
    border: 1px solid #e1e9f4;
}

.cart-item-age-blocking {
    background: #fff0f0;
    border-color: #f0c3c3;
}

.cart-item-media {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    border: 1px solid #d7e2ef;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
}

.cart-item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
    overflow-wrap: anywhere;
}

.cart-item-blocker-hint {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d32f2f;
    background: #ffeaea;
    color: #a71f1f;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.cart-item-total {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    text-align: right;
    min-width: 88px;
}

.cart-remove-btn {
    width: auto;
    max-width: none;
    min-width: 56px;
    padding: 8px 10px;
    margin: 0;
    font-size: 12px;
    background-color: var(--danger);
    flex-shrink: 0;
}

.cart-remove-btn:hover {
    background-color: var(--danger-hover);
}

.cart-total {
    flex-shrink: 0;
    margin-top: 8px;
    padding: 10px 0 12px 0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
    background: var(--admin-surface-muted);
}

#processTransactionBtn {
    background-color: var(--header-neutral);
    color: var(--admin-text);
    font-weight: bold;
    margin-top: 0;
    width: auto;
    max-width: none;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    line-height: 1;
    transform-origin: left center;
    transition: background-color 0.24s ease, color 0.24s ease, flex-basis 0.24s ease, transform 0.24s ease;
}

#processTransactionBtn:hover {
    background-color: var(--header-neutral-hover);
}

#processTransactionBtn.scan-mode-active {
    background-color: #0f766e;
    color: #ffffff;
}

#processTransactionBtn.scan-mode-active:hover {
    background-color: #0b5f59;
}

.transaction-actions {
    margin-top: 10px;
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.transaction-actions.scan-layout-no-customer #processTransactionBtn {
    flex-basis: calc(100% - 52px);
    transform: scaleX(1.02);
}

.transaction-actions.scan-layout-customer #processTransactionBtn,
.transaction-actions.scan-layout-default #processTransactionBtn {
    flex-basis: calc(100% - 104px);
    transform: scaleX(1);
}

#clearCartBtn {
    width: 46px;
    min-width: 46px;
    max-width: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    border-radius: 4px;
    background-color: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
}

.clear-cart-icon {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) invert(1);
}

#scanCustomerBtn {
    width: 46px;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    line-height: 1;
    border-radius: 4px;
    background-color: #0f766e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-8px) scaleX(0.8);
    transition: flex-basis 0.24s ease, opacity 0.24s ease, transform 0.24s ease, background-color 0.24s ease;
}

#scanCustomerBtn.scan-secondary-visible {
    flex-basis: 46px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scaleX(1);
}

#scanCustomerBtn.scan-secondary-hidden {
    flex-basis: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px) scaleX(0.8);
}

#scanCustomerBtn .f7-icons {
    font-size: 20px;
}

#scanCustomerBtn:hover {
    background-color: #0b5f59;
}

#scanCustomerBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#clearCartBtn:hover {
    background-color: var(--danger-hover);
}

#clearCartBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#processTransactionBtn,
#scanCustomerBtn,
#clearCartBtn {
    height: 42px;
}

.articles-hidden .transaction-actions {
    display: none;
}

.articles-hidden .cart-remove-btn {
    display: none;
}

#error, #loginError {
    color: red;
    text-align: center;
    margin-top: 10px;
}

.customer-info-section {
    flex: 0 0 auto;
    overflow: visible;
}

.transaction-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

footer {
    background-color: var(--brand-primary);
    color: #fff;
    border-radius: 0;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.footer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: nowrap;
}

.footer-pill-input,
.footer-pill-btn {
    border: none;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    padding: 8px 12px;
}

.footer-pill-input {
    border: 1px solid rgba(255,255,255,0.25);
}

.footer-pill-input::placeholder {
    color: rgba(255,255,255,0.8);
}

.footer-pill-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

.footer-pill-btn {
    cursor: pointer;
}

.footer-admin-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.footer-admin-nav-btn.hidden {
    display: none !important;
}

.footer-pill-btn:hover {
    background-color: rgba(255,255,255,0.18);
}

.footer-customer {
    justify-content: flex-start;
}

.footer-user {
    justify-content: flex-end;
    position: relative;
}

.footer-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}

.footer-actions-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 25;
    width: min(68vw, 220px);
    background: #16385b;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(9, 19, 32, 0.35);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(6px) scale(0.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.footer-user.actions-expanded .footer-actions-panel {
    max-height: min(70vh, 460px);
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    overflow-y: auto;
}

.footer-actions-panel > * {
    width: 100%;
}

.footer-actions-panel .user-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-actions-panel .footer-pill-btn,
.footer-actions-panel .user-info .footer-pill-btn {
    width: 100%;
    text-align: left;
}

.footer-user .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
    min-width: 0;
}

.footer-row input,
.footer-row button,
.footer-row a {
    margin: 0;
    max-width: none;
    font-size: 13px;
    padding: 8px 12px;
}

.footer-row button,
.footer-row a {
    width: auto;
    flex: 0 0 auto;
}

#loadCustomerBtn {
    background-color: rgba(255,255,255,0.1);
}

#loadCustomerBtn:hover {
    background-color: rgba(255,255,255,0.18);
}

#openCustomerSearchBtn {
    background-color: rgba(255,255,255,0.1);
}

#openCustomerSearchBtn:hover {
    background-color: rgba(255,255,255,0.18);
}

.footer-customer input {
    flex: 0 0 auto;
    width: 18ch;
    min-width: 18ch;
    max-width: 20ch;
}

#logoutBtn {
    background-color: rgba(255,255,255,0.1);
}

#logoutBtn:hover {
    background-color: rgba(255,255,255,0.18);
}

#toggleArticlesBtn {
    background-color: rgba(255,255,255,0.1);
}

#toggleArticlesBtn:hover {
    background-color: rgba(255,255,255,0.18);
}

#toggleArticlesBtn.is-enabled {
    background-color: rgba(76, 175, 80, 0.28);
    border: 1px solid rgba(129, 199, 132, 0.8);
}

#toggleArticlesBtn.is-enabled:hover {
    background-color: rgba(76, 175, 80, 0.38);
}

#showQrBtn {
    background-color: rgba(255,255,255,0.1);
}

#showQrBtn:hover {
    background-color: rgba(255,255,255,0.18);
}

#stornoBtn {
    background-color: rgba(255, 82, 82, 0.24);
    border: 1px solid rgba(255, 138, 138, 0.35);
}

#stornoBtn:hover {
    background-color: rgba(255, 82, 82, 0.34);
}

#toggleScanModeBtn.is-enabled {
    background-color: rgba(45, 188, 161, 0.28);
    border: 1px solid rgba(141, 255, 233, 0.42);
}

#toggleScanModeBtn.is-enabled:hover {
    background-color: rgba(45, 188, 161, 0.38);
}

.camera-scanner-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 85;
    padding: 16px;
}

.camera-scanner-modal.hidden {
    display: none;
}

.camera-scanner-card {
    width: min(92vw, 420px);
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.2);
}

.camera-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.camera-scanner-header h2 {
    margin: 0;
    font-size: 18px;
    text-align: left;
    color: var(--admin-text);
}

.camera-scanner-close-btn {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 8px 12px;
    background: var(--admin-surface-soft);
    color: var(--admin-text);
    border-radius: 4px;
}

.camera-scanner-close-btn:hover {
    background: var(--admin-border);
}

#cameraScannerVideo {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #d9e4f3;
    background: #0f172a;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.camera-scanner-hint {
    margin: 0;
    color: #516275;
    font-size: 13px;
}

.scanner-test-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 86;
    padding: 16px;
}

.scanner-test-modal.hidden {
    display: none;
}

.scanner-test-card {
    width: min(92vw, 520px);
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(30, 58, 95, 0.2);
}

.scanner-test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scanner-test-header h2 {
    margin: 0;
    font-size: 18px;
    text-align: left;
    color: var(--admin-text);
}

.scanner-test-close-btn,
.scanner-test-clear-btn {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 8px 16px;
    background: var(--admin-surface-soft);
    color: var(--admin-text);
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    flex: 1;
}

.scanner-test-close-btn:hover,
.scanner-test-clear-btn:hover {
    background: var(--admin-border);
}

.scanner-test-hint {
    margin: 0;
    color: #516275;
    font-size: 13px;
}

.scanner-test-output {
    width: 100%;
    margin: 0;
    max-width: none;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.35;
    padding: 10px;
    border: 1px solid #d7e5f5;
    border-radius: 4px;
    background: #f8fbff;
    color: #1f2f45;
    resize: vertical;
}

.scanner-test-quality {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f0f4f8;
    border-radius: 4px;
    font-size: 13px;
    color: #516275;
}

.scanner-test-quality-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.scanner-test-quality-indicator.scanner-typical {
    background: #4caf50;
}

.scanner-test-quality-indicator.hybrid {
    background: #ff9800;
}

.scanner-test-quality-indicator.manual-typical {
    background: #f44336;
}

.scanner-test-quality-label {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: #1f2f45;
}

.scanner-test-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

#toggleFullscreenFeedbackBtn.is-enabled {
    background-color: rgba(76, 175, 80, 0.28);
    border: 1px solid rgba(129, 199, 132, 0.8);
}

/* Vollbild-Feedback im Kassier-Client (gleiches Format wie Display-Client). */
.booking-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.booking-overlay.hidden {
    display: none;
}

.booking-overlay.success {
    background: #1e8e3e;
    color: #ffffff;
}

.booking-overlay.error {
    background: #c62828;
    color: #ffffff;
}

.booking-overlay.positive {
    background: #1e8e3e;
    color: #ffffff;
}

.booking-overlay.negative {
    background: #c62828;
    color: #ffffff;
}

.booking-overlay.donate {
    background: #ef6c00;
    color: #ffffff;
}

.overlay-message {
    width: min(92vw, 760px);
}

.overlay-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px 32px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.overlay-title {
    font-size: clamp(28px, 5.5vh, 56px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.overlay-details {
    display: grid;
    gap: 10px;
}

.overlay-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.overlay-label {
    font-size: clamp(14px, 2vh, 20px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.overlay-value {
    font-size: clamp(24px, 4vh, 40px);
    font-weight: 800;
}

.overlay-note {
    font-size: clamp(20px, 3vh, 32px);
    font-weight: 700;
    opacity: 0.98;
}

.session-qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(31, 41, 55, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}

.session-qr-modal.hidden {
    display: none;
}

.session-qr-card {
    width: min(94vw, 760px);
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.session-qr-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px solid #e7edf6;
    padding-bottom: 8px;
}

.session-qr-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--admin-text);
}

.session-qr-main {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 16px;
    align-items: start;
}

.session-qr-left {
    background: #f8fafc;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.session-qr-right {
    min-width: 0;
}

#sessionQrImage {
    width: 100%;
    max-width: 280px;
    border-radius: 4px;
    border: 1px solid #d7e5f5;
    background: #ffffff;
}

#sessionQrText {
    font-size: 13px;
    color: #516275;
    font-family: monospace;
    letter-spacing: 0.08em;
    word-break: break-all;
}

.session-join-title,
.session-clients-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.session-join-row {
    display: grid;
    grid-template-columns: minmax(100px, 160px) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

#sessionJoinInput {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: monospace;
    max-width: 160px;
    font-size: 12px;
    padding: 6px 8px;
}

#sessionJoinBtn {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 4px;
    background-color: var(--admin-primary);
    color: #ffffff;
}

#sessionJoinBtn:hover {
    background-color: var(--admin-primary-dark);
}

#sessionJoinBtn:active {
    background-color: #004080;
}

.session-join-hint {
    font-size: 11px;
    color: #516275;
    text-align: left;
    margin-bottom: 10px;
}

.session-join-hint.success {
    color: #1b6f3a;
}

.session-join-hint.error {
    color: #9b1c1c;
}

#closeQrBtn {
    width: auto;
    max-width: none;
    padding: 8px 12px;
    margin: 0;
    background: #e0e0e0;
    color: #333;
    border-radius: 4px;
}

#closeQrBtn:hover {
    background: #d0d0d0;
}

.session-display-link {
    width: 100%;
    font-size: 11px;
    word-break: break-all;
    text-align: center;
    color: #516275;
}

.session-display-link a {
    color: var(--admin-primary);
    text-decoration: underline;
}

.session-clients-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
}

.session-client-item {
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 8px;
}

.session-client-item:last-child {
    margin-bottom: 0;
}

.session-qr-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #e7edf6;
    padding-top: 8px;
}

@media (max-width: 760px) {
    .session-qr-main {
        grid-template-columns: 1fr;
    }

    .session-join-row {
        grid-template-columns: 1fr auto;
    }

    #sessionJoinInput {
        max-width: none;
    }
}

body.modal-open {
    overflow: hidden;
}

.customer-search-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    padding: 18px;
}

.customer-search-modal.hidden {
    display: none;
}

.customer-search-card {
    width: min(94vw, 860px);
    max-height: 88vh;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customer-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.customer-search-header h2 {
    margin: 0;
    text-align: left;
    font-size: 20px;
    color: var(--admin-text);
}

.customer-search-close-btn {
    margin: 0;
    width: auto;
    max-width: none;
    padding: 6px 10px;
    background: var(--admin-surface-soft);
    color: var(--admin-text);
    border-radius: 4px;
}

.customer-search-close-btn:hover {
    background: var(--admin-surface-muted);
}

.customer-search-input {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    color: var(--admin-text);
}

.customer-search-table-wrap {
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    overflow: auto;
    background: #ffffff;
    flex: 1;
    min-height: 180px;
}

.customer-search-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.customer-search-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--admin-surface-soft);
    color: var(--admin-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--admin-border);
}

.customer-search-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--admin-surface-soft);
    color: var(--admin-text);
    font-size: 14px;
}

.customer-search-row {
    cursor: pointer;
}

.customer-search-row:hover {
    background: #f4f8fc;
}

.customer-search-row-inactive {
    cursor: not-allowed;
    opacity: 0.72;
    background: #fafafa;
}

.customer-search-row-inactive:hover {
    background: #fafafa;
}

.customer-search-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.customer-search-status-active {
    background: #dcfce7;
    color: #166534;
}

.customer-search-status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.customer-search-empty {
    padding: 18px 12px;
    color: var(--admin-text-muted);
    text-align: center;
}

.storno-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    padding: 18px;
}

.storno-modal.hidden {
    display: none;
}

.storno-card {
    width: min(94vw, 620px);
    max-height: 88vh;
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storno-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.storno-card-header h2 {
    margin: 0;
    text-align: left;
    font-size: 20px;
    color: var(--admin-text);
}

.storno-close-btn {
    margin: 0;
    width: auto;
    max-width: none;
    padding: 6px 10px;
    background: var(--admin-surface-soft);
    color: var(--admin-text);
    border-radius: 4px;
}

.storno-close-btn:hover {
    background: var(--admin-surface-muted);
}

.storno-role-hint {
    margin: 0;
    color: #44576f;
    font-size: 14px;
}

.storno-transaction-info {
    border: 1px solid #d9e4f3;
    border-radius: 4px;
    background: #f7fbff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storno-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.storno-info-row span {
    color: #52667f;
}

.storno-info-row strong {
    color: #1f2f45;
    text-align: right;
}

.storno-items-section h3 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #253a54;
}

.storno-items-list {
    border: 1px solid #d9e4f3;
    border-radius: 4px;
    background: #fff;
    max-height: 210px;
    overflow: auto;
}

.storno-item-row,
.storno-item-empty {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    border-bottom: 1px solid #edf2f8;
}

.storno-item-row:last-child {
    border-bottom: none;
}

.storno-item-empty {
    color: #667b95;
}

.storno-code-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storno-code-field label {
    font-size: 13px;
    color: #40546e;
}

#stornoCodeInput {
    margin: 0;
    max-width: none;
    width: 100%;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid #c9d8ea;
}

.storno-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.storno-cancel-btn,
.storno-confirm-btn {
    margin: 0;
    width: auto;
    max-width: none;
    padding: 9px 14px;
    border-radius: 4px;
    font-size: 14px;
}

.storno-cancel-btn {
    background: #d9e1ed;
    color: #22344c;
}

.storno-cancel-btn:hover {
    background: #c8d3e3;
}

.storno-confirm-btn {
    background: #2d5f98;
    color: #fff;
}

.storno-confirm-btn:hover {
    background: #244f80;
}

@media (max-width: 980px) {
    #main {
        grid-template-rows: minmax(56px, 13vh) 1fr auto;
    }

    footer {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 10px 12px;
        gap: 8px;
    }

    .footer-row {
        width: auto;
        min-width: 0;
        gap: 4px;
    }

    .footer-customer,
    .footer-user {
        min-width: 0;
    }

    .footer-user {
        justify-content: flex-end;
    }

    .footer-user .user-info,
    .footer-row input,
    .footer-row button {
        font-size: 12px;
    }

    .footer-pill-input,
    .footer-pill-btn,
    .footer-row input,
    .footer-row button {
        padding: 7px 10px;
    }

    .footer-customer input {
        width: 15ch;
        min-width: 15ch;
        max-width: 16ch;
    }

    .content {
        flex-direction: column;
    }

    .transaction-column {
        display: contents;
    }

    .customer-info-section {
        order: 1;
    }

    .articles-section {
        order: 2;
        flex: 1;
    }

    .transaction-section {
        order: 3;
        flex: 1;
    }

    #articlesGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .article-btn {
        min-height: 138px;
        padding: 16px;
        font-size: 13px;
        gap: 5px;
    }

    .article-image-wrap,
    .article-symbol {
        width: min(72%, 88px);
        height: 62px;
        min-width: 52px;
        min-height: 46px;
    }

    .article-symbol {
        font-size: 22px;
    }

    .article-name,
    .article-price {
        font-size: 12px;
    }
}

@media (max-height: 760px) {
    #main {
        grid-template-rows: minmax(52px, 12vh) 1fr auto;
        gap: 0;
        padding: 0;
    }

    header {
        padding: 8px 12px;
    }

    #transactionResult {
        font-size: clamp(14px, 2.7vh, 24px);
    }

    .articles-section, .customer-info-section, .transaction-section {
        padding: 10px;
    }

    #articlesGrid {
        gap: 6px;
    }

    .article-btn {
        min-height: 150px;
        padding: 12px;
        font-size: 14px;
    }

    .article-price {
        font-size: 13px;
    }

    #customerInfo {
        font-size: 13px;
        gap: 6px 8px;
    }

    .customer-field {
        padding: 6px 8px;
    }

    .customer-label {
        font-size: 11px;
    }

    .customer-value {
        font-size: 13px;
    }

    #cart {
        padding: 8px;
    }

    .cart-item {
        gap: 6px;
        margin-bottom: 4px;
        font-size: 13px;
    }

    .cart-remove-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .footer-row input,
    .footer-row button,
    #processTransactionBtn,
    #clearCartBtn {
        font-size: 13px;
        padding: 8px 10px;
    }

    #clearCartBtn {
        padding: 0;
        width: 42px;
        min-width: 42px;
        flex-basis: 42px;
    }

    footer {
        padding: 8px 10px;
        gap: 6px;
    }

    .customer-search-card {
        max-height: calc(100vh - 20px);
    }
}

@media (max-height: 620px) {
    #main {
        grid-template-rows: minmax(46px, 10vh) 1fr auto;
        gap: 0;
        padding: 0;
    }

    #transactionResult {
        font-size: clamp(12px, 2.2vh, 20px);
        line-height: 1.15;
    }

    h2 {
        margin: 0;
        font-size: 16px;
    }

    .article-btn {
        min-height: 130px;
        padding: 8px;
        font-size: 13px;
    }

    .footer-row {
        gap: 6px;
    }

    .footer-row input,
    .footer-row button,
    #processTransactionBtn,
    #clearCartBtn {
        font-size: 12px;
        padding: 7px 8px;
    }

    #clearCartBtn {
        padding: 0;
        width: 38px;
        min-width: 38px;
        flex-basis: 38px;
    }
}

#transactionResult.success,
#transactionResult.error {
    background: transparent;
    border-color: transparent;
}

@media (max-width: 768px) {
    .customer-info-section {
        padding: 8px 10px;
    }

    #customerInfo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
    }

    .customer-field {
        padding: 7px 8px;
    }

    .customer-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .customer-value {
        font-size: 13px;
    }

    #articlesGrid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .article-btn {
        padding: 12px;
        min-height: 140px;
    }

    .customer-search-modal {
        padding: 10px;
    }

    .customer-search-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 12px;
        gap: 10px;
    }

    .customer-search-header h2 {
        font-size: 18px;
    }

    .customer-search-close-btn {
        padding: 7px 10px;
        font-size: 12px;
    }

    .customer-search-input {
        font-size: 16px;
        padding: 9px 10px;
    }

    .customer-search-table {
        min-width: 520px;
    }

    .customer-search-table thead th {
        padding: 8px 10px;
        font-size: 11px;
    }

    .customer-search-table tbody td {
        padding: 9px 10px;
        font-size: 13px;
    }

    .customer-search-status {
        min-width: 64px;
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 560px) {
    #main {
        grid-template-rows: 0 1fr auto;
    }

    #main > header {
        min-height: 0;
        height: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        overflow: hidden;
    }

    .customer-info-section {
        position: relative;
        padding: 4px 6px;
        min-height: var(--mobile-shared-feedback-slot-height);
        overflow: hidden;
    }

    #customerInfo {
        min-height: var(--mobile-shared-feedback-slot-height);
    }

    .customer-info-section .header-feedback {
        min-height: var(--mobile-shared-feedback-slot-height);
    }

    body.mobile-feedback-overrides-customer #customerInfo {
        display: none;
    }

    #customerInfo {
        grid-template-columns: 1fr;
        gap: 3px;
        font-size: 12px;
    }

    #customerInfo > .customer-field:not(.customer-field-compact) {
        display: none;
    }

    .customer-field-compact {
        display: block;
        padding: 4px 6px;
        min-height: 34px;
        display: flex;
        align-items: center;
    }

    .customer-value-compact {
        min-height: 0;
        width: 100%;
        font-size: 12px;
        line-height: 1.2;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .customer-field-identity-compact .customer-value-compact {
        font-weight: 700;
    }

    #articlesGrid {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 6px;
        width: 100%;
        min-width: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .article-btn {
        min-height: 42px;
        padding: 4px 6px;
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) auto;
        grid-template-rows: 1fr;
        align-items: center;
        gap: 6px;
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .article-image-wrap,
    .article-symbol {
        grid-column: 1;
        grid-row: 1;
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        border-radius: 6px;
        margin: 0;
    }

    .article-symbol {
        font-size: 13px;
    }

    .article-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 13px;
        text-align: left;
        width: auto;
        min-width: 0;
        align-self: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .article-price {
        grid-column: 3;
        grid-row: 1;
        font-size: 12px;
        text-align: right;
        white-space: nowrap;
        width: auto;
        justify-self: end;
        align-self: center;
        line-height: 1;
    }

    #cart {
        padding: 6px;
    }

    #cart h3 {
        font-size: 16px;
        margin: 0 0 6px;
    }

    .cart-items {
        gap: 4px;
    }

    .cart-item {
        grid-template-columns: 34px 1fr auto auto;
        gap: 6px;
        padding: 6px;
        border-radius: 4px;
    }

    .cart-item-media {
        width: 34px;
        height: 34px;
        border-radius: 5px;
    }

    .cart-item-image-fallback {
        font-size: 12px;
    }

    .cart-item-name {
        font-size: 14px;
    }

    .cart-item-total {
        font-size: 14px;
        min-width: 72px;
    }

    .cart-remove-btn {
        min-width: 48px;
        padding: 6px 8px;
        font-size: 11px;
    }

    .cart-total {
        margin-top: 6px;
        padding: 8px 0 10px 0;
        font-size: 15px;
    }

    footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
        overflow: visible;
    }

    .footer-row {
        min-width: 0;
    }

    .footer-customer {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .footer-customer input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    #loadCustomerBtn,
    #openCustomerSearchBtn {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        white-space: nowrap;
    }

    .footer-user {
        justify-content: flex-end;
    }

    .footer-pill-input,
    .footer-pill-btn,
    .footer-row input,
    .footer-row button {
        font-size: 12px;
        padding: 7px 9px;
    }

    .customer-search-modal {
        padding: 0;
    }

    .customer-search-card {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        padding: 10px;
        gap: 8px;
    }

    .customer-search-header {
        gap: 6px;
    }

    .customer-search-header h2 {
        font-size: 17px;
    }

    .customer-search-table {
        min-width: 460px;
    }

    .customer-search-table thead th,
    .customer-search-table tbody td {
        padding: 7px 8px;
    }

    .customer-search-status {
        min-width: 58px;
        padding: 3px 7px;
    }
}
