/* Kasse – eigene Styles (Bootstrap 5.3, kein Build-Step) */
:root { --app-sidebar-width: 240px; }

.app-navbar { padding-top: env(safe-area-inset-top); }
.tenant-name { max-width: 40vw; }

.app-shell { display: flex; min-height: calc(100vh - 56px); }
.app-main { flex: 1; min-width: 0; padding: 1.25rem; max-width: 1200px; }

@media (min-width: 992px) {
    .app-sidebar { width: var(--app-sidebar-width); flex: 0 0 var(--app-sidebar-width); }
}
.app-sidebar .nav-link { color: var(--bs-body-color); padding: .5rem 1rem; border-left: 3px solid transparent; }
.app-sidebar .nav-link:hover { background: var(--bs-tertiary-bg); }
.app-sidebar .nav-link.active { border-left-color: var(--bs-primary); background: var(--bs-secondary-bg); font-weight: 600; }
.app-sidebar .bi { width: 1.4em; display: inline-block; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }

.qr-box svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: .375rem; }
.recovery-codes { columns: 2; font-family: var(--bs-font-monospace); }
.color-dot { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; vertical-align: middle; border: 1px solid var(--bs-border-color); }
.status-ok { color: var(--bs-success); }
.status-warn { color: var(--bs-warning); }
.status-error { color: var(--bs-danger); }
.table-actions { white-space: nowrap; width: 1%; }

/* Phase 3: Stammdaten */
.tree-indent-1 { padding-left: 1.25rem; }
.tree-indent-2 { padding-left: 2.5rem; }
.color-dot { border: 0; }
.price-input { max-width: 8rem; }
.sort-input { max-width: 5rem; }
.uid { font-family: var(--bs-font-monospace); font-size: .875em; }
.card-qr svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: .375rem; }

/* QR-Bogen (A4, 4 Spalten) */
.qr-sheet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6mm; }
.qr-tile { border: 1px dashed #bbb; border-radius: 3mm; padding: 3mm; text-align: center; break-inside: avoid; background: #fff; color: #000; }
.qr-tile svg { width: 32mm; height: 32mm; }
.qr-tile .qr-number { font-size: 16pt; font-weight: 700; line-height: 1.1; }
.qr-tile .qr-tenant { font-size: 8pt; }
@media print {
    @page { size: A4; margin: 10mm; }
    .no-print, .app-navbar, .app-sidebar, .offcanvas, .alert { display: none !important; }
    .app-main { padding: 0; max-width: none; }
    body { background: #fff !important; }
}

/* Phase 4: Kassenbildschirm */
.till-body { overflow: hidden; }
.till { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
.till-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .75rem;
    padding-top: calc(.4rem + env(safe-area-inset-top)); border-bottom: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); flex-wrap: wrap; }
.till-head-info { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.till-clock { margin-left: .5rem; font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); }
.till-modes { display: flex; gap: .25rem; flex-wrap: wrap; }
.till-main { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.till-products { overflow-y: auto; padding: .5rem .75rem 4rem; transition: opacity .2s; }
.till-products.is-dimmed { opacity: .35; pointer-events: none; }
.till-category { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); margin: .75rem 0 .35rem; }
.till-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.till-tile { --tile-bg: #6c757d; --tile-fg: #fff; background: var(--tile-bg); color: var(--tile-fg); border: 0; border-radius: .6rem;
    min-height: 88px; padding: .5rem; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
    font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.25); touch-action: manipulation; user-select: none; }
.till-tile:active { transform: scale(.97); filter: brightness(.9); }
.till-tile-name { font-size: 1.05rem; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.till-tile-price { font-variant-numeric: tabular-nums; opacity: .9; }
.till-side { border-left: 1px solid var(--bs-border-color); display: flex; flex-direction: column; gap: .75rem; padding: .75rem; overflow-y: auto; background: var(--bs-body-bg); }
.till-card-info { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; padding: .5rem .75rem; border-radius: .5rem; background: var(--bs-secondary-bg); }
.till-card-info > div:first-child { flex: 1; min-width: 0; }
.till-balance { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.till-panel { display: flex; flex-direction: column; gap: .5rem; }
.till-cart { list-style: none; padding: 0; margin: 0; max-height: 40vh; overflow-y: auto; }
.till-cart-line { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.till-cart-qty { width: 2.5rem; font-variant-numeric: tabular-nums; }
.till-cart-name { flex: 1; min-width: 0; }
.till-cart-sum { font-variant-numeric: tabular-nums; }
.till-total { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.till-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.till-actions .btn-lg { flex: 1; }
.till-amount { font-size: 2.25rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; padding: .25rem .5rem; border-radius: .5rem; background: var(--bs-secondary-bg); }
.till-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.till-keypad .btn { min-height: 56px; font-size: 1.4rem; }
.till-toast { position: fixed; left: 50%; top: 4.5rem; transform: translateX(-50%); z-index: 1080; max-width: min(92vw, 560px);
    padding: .75rem 1.25rem; border-radius: .6rem; color: #fff; background: #198754; box-shadow: 0 6px 24px rgba(0,0,0,.3); font-weight: 600; text-align: center; }
.till-toast.is-error { background: #dc3545; }
.till-toast.is-warn { background: #b58105; }
.till-toast.big { font-size: 1.6rem; padding: 1.25rem 2rem; }
.till-cart-bar { display: none; }
.till.is-busy .till-actions .btn, .till.is-busy .till-tile { cursor: progress; }
.till-dialog { border: 0; border-radius: .75rem; padding: 1.25rem; min-width: 300px; background: var(--bs-body-bg); color: var(--bs-body-color); }
.till-dialog::backdrop { background: rgba(0,0,0,.5); }
.till-reversals { max-height: 50vh; overflow-y: auto; }
@media (max-width: 767.98px) {
    .till-body { overflow: auto; }
    .till { height: auto; min-height: 100dvh; }
    .till-main { grid-template-columns: 1fr; }
    .till-products { overflow: visible; padding-bottom: 1rem; }
    .till-side { border-left: 0; border-top: 1px solid var(--bs-border-color); overflow: visible; padding-bottom: 5rem; }
    .till-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .till-tile { min-height: 72px; }
    .till-cart-bar:not([hidden]) { display: block; position: fixed; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); z-index: 1050; font-weight: 600; }
}
