/* Pokladna TunelClub - CSS
   Optimalizováno pro tablet ~10" (1280x800) a Android 6.0.1 (starý Chrome).
   Bez CSS Grid - pouze flexbox pro max kompatibilitu. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; font-family: Arial, sans-serif; font-size: 16px; }
body { background: #1a1a1a; color: #eee; overflow: hidden; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; cursor: pointer; }

/* ========== LOGIN ========== */
.login-body { display: flex; align-items: center; justify-content: center; height: 100%; }
.login-box { background: #2a2a2a; border-radius: 12px; padding: 30px; width: 360px; max-width: 95vw; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.login-logo { text-align: center; margin-bottom: 10px; }
.login-logo-img { max-width: 220px; height: auto; display: inline-block; }
.login-title { font-size: 18px; text-align: center; color: #aaa; margin-bottom: 20px; }
.login-error { background: #8b1e1e; color: #fff; padding: 10px; border-radius: 6px; margin-bottom: 15px; text-align: center; }

.pin-display { width: 100%; height: 54px; text-align: center; font-size: 32px; letter-spacing: 10px;
    background: #111; border: 2px solid #444; color: #fff; border-radius: 6px; margin-bottom: 15px; }
.pin-display:focus { outline: none; border-color: #ffd700; }

.pin-pad { display: flex; flex-wrap: wrap; }
.pin-btn { width: 33.333%; height: 70px; font-size: 26px; font-weight: bold;
    background: #3a3a3a; color: #fff; border: 1px solid #555; border-radius: 0; }
.pin-btn:active { background: #555; }
.pin-btn-clear { background: #6b2e2e; }
.pin-btn-ok { background: #2e6b2e; }

/* ========== POS MAIN ========== */
.pos-body { display: flex; flex-direction: column; }
.pos-header { flex: 0 0 auto; background: #111; color: #ffd700; padding: 4px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ffd700; gap: 8px; }
.pos-header > * + * { margin-left: 8px; }
.pos-title { font-size: 16px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.pos-title > * + * { margin-left: 10px; }
.pos-logo { height: 42px; width: auto; display: block; }
.pos-clock { font-size: 11px; font-weight: normal; color: #ffd700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-user { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.pos-user > * + * { margin-left: 6px; }
.pos-user span { padding: 0 6px; }
.offline-badge { background: #8b1e1e; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: bold; border: 2px solid #ff6b6b; animation: offlinePulse 2s infinite; }
@keyframes offlinePulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }
.pos-user a, .pos-btn-sm { color: #fff; background: #444; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 15px; font-weight: bold; min-width: 38px; text-align: center; margin: 0 1px; border: none; cursor: pointer; }
.pos-user a:active, .pos-btn-sm:active { background: #555; }

.pos-main { flex: 1 1 auto; display: flex; overflow: hidden; height: calc(100% - 56px); }

/* Kategorie - levý panel */
.pos-categories { flex: 0 0 140px; background: #222; overflow-y: auto; padding: 5px; }
.cat-btn { display: block; width: 100%; margin-bottom: 6px; padding: 18px 8px; font-size: 14px; font-weight: bold; color: #fff; border: 2px solid transparent; border-radius: 6px; text-align: center; }
.cat-btn.active { border-color: #ffd700; box-shadow: 0 0 0 2px #ffd700 inset; }

/* Produkty - střed (flex wrap, aby fungovalo i na starších WebView bez CSS Grid) */
.pos-products { flex: 1 1 auto; padding: 8px; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; background: #1a1a1a; }
.prod-btn { width: calc(25% - 10px); margin: 5px; height: 90px; background: #3a3a3a; color: #fff; border: 2px solid #555; border-radius: 8px; font-size: 14px; font-weight: bold; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; text-align: center; box-sizing: border-box; }
.prod-slot-hidden { visibility: hidden; }
.prod-btn:active { background: #555; }
.prod-btn.layout-edit, .cat-btn.layout-edit { outline: 2px dashed #ffb400; outline-offset: -4px; }
.prod-slot-empty { background: #141414 !important; border: 2px dashed #444 !important; color: #555; font-size: 12px; font-style: italic; }
.prod-slot-empty:active { background: #1a1a1a !important; }
.prod-btn.swap-source, .prod-slot-empty.swap-source { outline: 3px solid #ffd700 !important; box-shadow: 0 0 18px rgba(255,215,0,0.6); background: #2a2a00 !important; }
.sortable-ghost { opacity: 0.3; background: #ffb400 !important; }
.sortable-chosen { transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.prod-btn .prod-name { font-size: 14px; line-height: 1.2; word-wrap: break-word; }
.prod-btn .prod-price { font-size: 17px; color: #ffd700; }
.prod-btn .prod-stock { font-size: 10px; font-weight: normal; color: #9ad89a; margin-top: 1px; }
.prod-btn .prod-stock.low { color: #ffc857; }
.prod-btn .prod-stock.empty { color: #ff5555; }
.prod-btn .prod-step { font-size: 9px; font-weight: normal; color: #9abfff; margin-top: 1px; font-style: italic; }

/* ================== HOME SCREEN ================== */
.home-screen { flex: 1; display: none; padding: 30px; overflow-y: auto; background: #1a1a1a; }
.home-grid { display: flex; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; align-content: flex-start; }
.home-tile { flex: 0 0 calc(33.333% - 20px); box-sizing: border-box; background: #2a2a2a; border: 2px solid #555; color: #fff; border-radius: 14px; padding: 30px 20px; text-align: center; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-decoration: none; margin: 10px; }
.home-tile > * + * { margin-top: 6px; }
.home-tile:hover, .home-tile:active { background: #3a3a3a; border-color: #ffd700; }
.home-tile-icon { font-size: 56px; line-height: 1; }
.home-tile-label { font-size: 26px; font-weight: bold; color: #ffd700; }
.home-tile-sub { font-size: 13px; color: #aaa; }
.home-sell { background: #1f3a1f; }
.home-sell-tab { background: #1f2f4a; }
.home-tabs { background: #1f2a3a; }
.home-cash { background: #3a2f1f; }
.home-stock { background: #2f1f3a; }
.home-reports { background: #1f3a3a; }
.home-admin { background: #3a1f1f; }
@media (max-width: 900px) { .home-tile { flex: 0 0 calc(50% - 20px); padding: 20px 10px; } .home-tile-icon { font-size: 42px; } .home-tile-label { font-size: 20px; } }

.view-title { color: #ffd700; font-size: 22px; font-weight: bold; margin-left: 12px; }
.mode-btn.mode-home { background: #ffd700; color: #111; padding: 6px 10px; font-size: 20px; min-width: 44px; min-height: 42px; }
.assigned-tab-badge { display: inline-flex; align-items: center; gap: 8px; background: #2f5aa8; color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: bold; margin-left: 10px; }
.assigned-tab-badge strong { color: #ffd700; }
.assigned-tab-badge button { background: #c33; color: #fff; border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-weight: bold; font-size: 14px; line-height: 1; }
.mode-btn.mode-tabs-quick { position: relative; }
.tabs-count-badge { background: #ffd700; color: #111; font-weight: bold; border-radius: 12px; padding: 2px 8px; margin-left: 6px; font-size: 13px; }
.tabs-sum-badge { background: #2e6b2e; color: #fff; font-weight: bold; border-radius: 12px; padding: 2px 8px; margin-left: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ================== POKLADNA VIEW ================== */
.cash-screen { flex: 1; display: none; padding: 20px; overflow-y: auto; background: #1a1a1a; }
.cash-panel { max-width: 1000px; margin: 0 auto; color: #fff; }
.cash-big-status { font-size: 22px; font-weight: bold; text-align: center; padding: 12px; border-radius: 8px; margin-bottom: 20px; }
.cash-big-status.open { background: #1f3a1f; color: #5fd665; border: 2px solid #5fd665; }
.cash-big-status.closed { background: #3a1f1f; color: #ff7777; border: 2px solid #ff7777; }
.cash-now { font-size: 28px; text-align: center; color: #ccc; margin: 20px 0; }
.cash-now strong { color: #ffd700; font-size: 48px; font-variant-numeric: tabular-nums; display: block; margin-top: 8px; }
.cash-summary { background: #222; border: 1px solid #444; border-radius: 8px; padding: 16px; margin: 20px 0; }
.cs-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #333; font-size: 16px; }
.cs-row:last-child { border-bottom: none; }
.cs-row strong { font-variant-numeric: tabular-nums; }
.cash-actions { display: flex; gap: 12px; margin: 20px 0; }
.cash-actions > * + * { margin-left: 12px; }
.cash-actions button { flex: 1; font-size: 18px; padding: 16px; }
.cash-open-form { background: #222; border-radius: 10px; padding: 30px; max-width: 500px; margin: 0 auto; }
.cash-open-form label { color: #aaa; display: block; margin-top: 10px; }
.cash-mv-table { width: 100%; border-collapse: collapse; margin-top: 10px; color: #ddd; font-size: 14px; }
.cash-mv-table th, .cash-mv-table td { padding: 8px; border-bottom: 1px solid #333; text-align: left; }
.cash-mv-table th { color: #ffd700; }

/* ================== STOCK / REPORTS VIEW ================== */
.stock-screen, .reports-screen { flex: 1; display: none; padding: 20px; overflow-y: auto; background: #1a1a1a; }
.stock-panel, .reports-panel { max-width: 1200px; margin: 0 auto; color: #fff; }
.stock-tbl { width: 100%; border-collapse: collapse; color: #ddd; font-size: 14px; }
.stock-tbl th, .stock-tbl td { padding: 8px 10px; border-bottom: 1px solid #333; text-align: left; }
.stock-tbl th { color: #ffd700; background: #222; position: sticky; top: 0; }

.reports-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: #222; padding: 14px; border-radius: 8px; margin-bottom: 20px; }
.reports-filter > * { margin: 0 12px 6px 0; }
.reports-filter label { color: #aaa; font-size: 14px; }
.reports-filter input, .reports-filter select { background: #111; color: #fff; border: 1px solid #555; border-radius: 4px; padding: 6px 10px; font-size: 14px; }
.rep-presets { display: flex; gap: 6px; margin-left: auto; }
.rep-presets > * + * { margin-left: 6px; }
.rep-presets button { background: #444; color: #fff; border: 1px solid #666; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.rep-presets button:hover { background: #555; }
.rep-sum-box { background: #222; border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.rep-sum-box h3 { color: #ffd700; margin: 0 0 12px; }
.rep-stats { display: flex; flex-wrap: wrap; gap: 20px; }
.rep-stats > div { display: flex; flex-direction: column; padding: 10px 16px; background: #111; border-radius: 6px; min-width: 120px; }
.rep-stats span { color: #aaa; font-size: 13px; }
.rep-stats strong { font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; }
.rep-stats .rep-total strong { color: #ffd700; font-size: 28px; }

.no-products { color: #888; font-style: italic; padding: 20px; width: 100%; text-align: center; }

/* Košík - pravý panel */
.pos-cart { flex: 0 0 320px; background: #222; display: flex; flex-direction: column; border-left: 2px solid #444; }
.cart-header { flex: 0 0 auto; background: #111; color: #ffd700; padding: 12px; font-size: 18px; font-weight: bold; text-align: center; }
.cart-items { flex: 1 1 auto; overflow-y: auto; padding: 8px; }
.cart-item { display: flex; align-items: center; background: #3a3a3a; padding: 8px; margin-bottom: 6px; border-radius: 6px; }
.cart-item-main { flex: 1 1 auto; min-width: 0; }
.cart-item-name { font-weight: bold; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: #aaa; }
.cart-item-qty { display: flex; align-items: center; gap: 4px; }
.cart-item-qty > * + * { margin-left: 4px; }
.qty-btn { width: 32px; height: 32px; background: #555; color: #fff; border: none; border-radius: 4px; font-size: 18px; font-weight: bold; }
.qty-val { min-width: 32px; text-align: center; font-weight: bold; }
.cart-item-total { margin-left: 8px; font-weight: bold; color: #ffd700; min-width: 60px; text-align: right; }
.cart-item-del { background: #6b2e2e; color: #fff; width: 28px; height: 28px; border: none; border-radius: 4px; margin-left: 6px; font-size: 14px; }

.cart-total { flex: 0 0 auto; background: #111; padding: 12px; display: flex; justify-content: space-between; align-items: center; border-top: 2px solid #444; }
.cart-total-value { font-size: 24px; font-weight: bold; color: #ffd700; }
.cart-actions { flex: 0 0 auto; display: flex; padding: 8px; gap: 6px; }
.cart-actions > * + * { margin-left: 6px; }
.cart-btn { flex: 1 1 0; padding: 18px 0; font-size: 18px; font-weight: bold; border: none; border-radius: 6px; color: #fff; }
.cart-btn-clear { background: #6b2e2e; }
.cart-btn-pay { background: #2e6b2e; flex: 2 1 0; }

.empty-cart { color: #666; text-align: center; padding: 30px 10px; font-style: italic; }

/* ========== MODÁLY ========== */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); z-index: 100; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-box { background: #2a2a2a; border-radius: 12px; padding: 25px; min-width: 380px; max-width: 95vw; max-height: 95vh; overflow-y: auto; box-shadow: 0 15px 50px rgba(0,0,0,.7); }
.modal-title { font-size: 22px; color: #ffd700; margin-bottom: 15px; text-align: center; }

/* Fullscreen varianta modálu (platba účtu) */
.modal.fullscreen-modal { background: #111; }
.modal.fullscreen-modal .modal-box { background: #1a1a1a; border-radius: 0; padding: 15px 20px; min-width: 100vw; max-width: 100vw; width: 100vw; min-height: 100vh; max-height: 100vh; height: 100vh; box-shadow: none; display: flex; flex-direction: column; box-sizing: border-box; }
.tabpay-header { flex: 0 0 auto; text-align: center; padding-bottom: 10px; border-bottom: 1px solid #333; }
.tabpay-header .modal-title { margin-bottom: 6px; }
.tabpay-header .modal-total { font-size: 18px; color: #fff; }
.tabpay-header .modal-total #tabpay-remaining { color: #ffd700; font-weight: bold; font-size: 24px; }
.tabpay-body { flex: 1 1 auto; display: flex; gap: 15px; padding: 12px 0; overflow-y: auto; min-height: 0; }
.tabpay-col { flex: 1 1 50%; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tabpay-col .pay-currency-wrap,
.tabpay-col .pay-discount-wrap,
.tabpay-col .pay-split-wrap,
.tabpay-col .pay-amount-wrap { background: #1b1b1b; border-radius: 8px; padding: 10px 12px; }
.tabpay-col label { color: #ffd700; font-weight: bold; display: block; margin-bottom: 6px; }
.pay-preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-preset-row > button { flex: 1 1 0; min-width: 55px; padding: 12px 4px; background: #333; color: #fff; border: 1px solid #555; border-radius: 6px; font-size: 16px; font-weight: bold; }
.pay-preset-row > button:active { background: #555; }
.pay-currency-row { display: flex; gap: 6px; }
.pay-curr-btn { flex: 1; padding: 14px 4px; background: #333; color: #fff; border: 2px solid #555; border-radius: 6px; font-size: 18px; font-weight: bold; }
.pay-curr-btn.active { background: #2f5aa8; border-color: #6ea8ff; color: #fff; }
.tabpay-col .pay-amount-wrap input#tabpay-amount { width: 100%; font-size: 32px; text-align: center; padding: 10px; background: #111; color: #ffd700; border: 2px solid #555; border-radius: 6px; font-weight: bold; box-sizing: border-box; }
.tabpay-col .pay-amount-wrap { display: flex; flex-direction: column; }
.tabpay-col .pay-amount-wrap .numpad { margin-top: 8px; margin-bottom: 0; flex: 1 1 auto; }
.tabpay-col .pay-amount-wrap .numpad button { height: 60px; font-size: 24px; }
.tabpay-footer { flex: 0 0 auto; border-top: 1px solid #333; padding-top: 10px; display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.tabpay-footer .pay-methods { display: flex; margin-bottom: 0; flex-direction: row !important; align-items: stretch; }
.tabpay-footer .pay-methods .pay-btn,
.tabpay-footer .modal-cancel { flex: 0 0 auto; width: 200px; min-width: 200px; margin: 0; padding: 14px 20px; font-size: 18px; font-weight: bold; border-radius: 8px; box-sizing: border-box; }
/* Chrome 44 (Android 6 WebView) nezná flex gap — mezery přes margins */
.tabpay-footer .pay-methods .pay-btn + .pay-btn { margin-left: 24px !important; }
.tabpay-footer .pay-methods + .modal-cancel { margin-left: 24px !important; }
/* pay-modal (přímý prodej) používá stejný footer jako tabpay — žádné inline overridy */
#pay-modal .tabpay-footer .pay-methods { flex-direction: row !important; }
@media (max-width: 900px) {
    .tabpay-body { flex-direction: column; }
    .tabpay-col { flex: none; }
}
.modal-total { font-size: 24px; color: #fff; text-align: center; margin: 10px 0 20px; }
.modal-total span { color: #ffd700; font-weight: bold; }
.modal-cancel { display: block; width: 100%; margin-top: 15px; padding: 14px; background: #555; color: #fff; border: none; border-radius: 6px; font-size: 16px; }

.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-methods > * + * { margin-top: 10px; }
.pay-btn { padding: 14px 20px; font-size: 18px; font-weight: bold; color: #fff; background: #2e6b2e; border: none; border-radius: 8px; }
.pay-btn:active { background: #1e4b1e; }
.pay-btn[data-method="karta"] { background: #2e4b6b; }
.pay-btn[data-method="karta"]:active { background: #1e3b5b; }
.pay-btn[data-method="qr"] { background: #6b4b2e; }
.pay-btn[data-method="qr"]:active { background: #5b3b1e; }
/* Dočasně skryto — klub zatím nemá platební terminál */
.pay-btn[data-method="karta"] { display: none !important; }

.qr-code-wrap { text-align: center; background: #fff; padding: 15px; border-radius: 8px; margin: 10px 0; }
.qr-code-wrap img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.qr-actions { display: flex; flex-direction: column; gap: 8px; }
.qr-actions > * + * { margin-top: 8px; }

/* Účtenka */
.receipt { background: #fff; color: #000; padding: 15px; font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.4; border-radius: 4px; max-height: 50vh; overflow-y: auto; }
.receipt-title { font-size: 16px; font-weight: bold; text-align: center; margin-bottom: 8px; }
.receipt-meta { text-align: center; margin-bottom: 10px; font-size: 11px; }
.receipt-line { display: flex; justify-content: space-between; }
.receipt-items { border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 8px 0; margin: 8px 0; }
.receipt-total { font-weight: 900; font-size: 22px; margin-top: 8px; padding-top: 8px; border-top: 2px solid #000; }
.receipt-footer { text-align: center; margin-top: 10px; font-size: 11px; }

/* ========== ADMIN ========== */
.admin-body { overflow: auto; padding: 0; }
.admin-header { background: #111; color: #ffd700; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ffd700; }
.admin-header h1 { margin: 0; font-size: 20px; }
.admin-nav { background: #2a2a2a; padding: 10px 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.admin-nav > * { margin: 0 10px 6px 0; }
.admin-nav a { color: #ffd700; text-decoration: none; padding: 8px 15px; border-radius: 4px; background: #3a3a3a; }
.admin-nav a.active { background: #ffd700; color: #111; font-weight: bold; }
.admin-content { padding: 20px; max-width: 1200px; margin: 0 auto; }
.admin-content h2 { color: #ffd700; margin-top: 30px; }
.admin-content table { width: 100%; border-collapse: collapse; background: #2a2a2a; margin: 15px 0; }
.admin-content th { background: #111; color: #ffd700; padding: 10px; text-align: left; }
.admin-content td { padding: 10px; border-top: 1px solid #333; }
.admin-content input[type="text"], .admin-content input[type="number"], .admin-content select { background: #1a1a1a; color: #fff; border: 1px solid #555; padding: 8px; border-radius: 4px; font-size: 14px; width: 100%; box-sizing: border-box; }
.admin-content button, .admin-btn { background: #ffd700; color: #111; border: none; padding: 10px 18px; border-radius: 4px; font-size: 14px; font-weight: bold; cursor: pointer; }
.admin-content button.danger { background: #8b1e1e; color: #fff; }
.admin-content .right { text-align: right; }
.admin-msg { padding: 12px; border-radius: 4px; margin: 15px 0; }
.admin-msg.ok { background: #2e6b2e; color: #fff; }
.admin-msg.err { background: #8b1e1e; color: #fff; }

/* ========== MODE SWITCHER (přímý prodej / účty) ========== */
.pos-mode { display: flex; gap: 8px; }
.pos-mode > * + * { margin-left: 8px; }
.mode-btn { background: #333; color: #ccc; border: 2px solid #555; padding: 8px 14px; font-size: 15px; font-weight: bold; border-radius: 6px; min-height: 42px; }
.mode-btn.active { background: #ffd700; color: #111; border-color: #ffd700; }
.mode-btn:active { transform: scale(0.97); }
.tabs-count-badge { display: inline-block; background: #e74c3c; color: #fff; font-size: 16px; font-weight: bold; padding: 3px 10px; border-radius: 14px; margin-left: 8px; min-width: 28px; text-align: center; box-shadow: 0 0 0 2px #1a1a1a; }
.tabs-sum-badge { display: inline-block; background: #2e6b2e; color: #fff; font-size: 14px; font-weight: bold; padding: 3px 10px; border-radius: 14px; margin-left: 6px; box-shadow: 0 0 0 2px #1a1a1a; }
.mode-btn.active .tabs-count-badge, .mode-btn.active .tabs-sum-badge { box-shadow: 0 0 0 2px #ffd700; }

/* ========== TAB BAR (horní pruh v režimu účtu) ========== */
.tab-bar { background: #3a3a3a; padding: 8px 15px; display: flex; align-items: center; gap: 15px; border-bottom: 2px solid #ffd700; flex: 0 0 auto; }
.tab-bar > * + * { margin-left: 10px; }
.tab-bar-back { background: #555; color: #fff; border: none; padding: 10px 15px; border-radius: 4px; font-size: 14px; font-weight: bold; }
.tab-bar-info { flex: 1 1 auto; color: #fff; font-size: 16px; text-align: center; }
.tab-bar-info strong { color: #ffd700; font-size: 18px; }
.tab-bar-total { margin-left: 20px; }
.tab-bar-pay { background: #2e6b2e; color: #fff; border: none; padding: 12px 20px; border-radius: 6px; font-size: 16px; font-weight: bold; }
.tab-bar-move, .tab-bar-merge { background: #555; color: #fff; border: none; padding: 12px 18px; border-radius: 6px; font-size: 15px; font-weight: bold; }
.tab-bar-move:active, .tab-bar-merge:active { background: #777; }

/* Když je tab-bar viditelný, zmenšit pos-main výšku */
.pos-body:has(.tab-bar[style*="flex"]) .pos-main { height: calc(100% - 104px); }

/* ========== PŘEHLED ÚČTŮ ========== */
.tabs-overview { flex: 1 1 auto; overflow-y: auto; padding: 15px; background: #1a1a1a; height: calc(100% - 84px); }
.tabs-toolbar { display: flex; flex-direction: column; margin-bottom: 12px; }
.tabs-toolbar > * + * { margin-left: 0; margin-top: 6px; }

/* Horní řádek: záložky skupin + akční tlačítka (Nový/Upravit/Obnovit) na jednom řádku */
.tabs-row { display: flex; flex-wrap: wrap; align-items: center; margin: 0 -3px; }
.tabs-row > * { margin: 3px; }
.tabs-row-spacer { flex: 1 1 auto; min-width: 12px; margin: 0 !important; }

.tab-group-btn { background: #222; color: #ccc; border: 2px solid #444; border-radius: 8px; padding: 10px 16px; font-size: 15px; font-weight: bold; min-height: 44px; cursor: pointer; }
.tab-group-btn.active { background: linear-gradient(135deg,#7c3aed,#4c1d95); color: #fff; border-color: #a78bfa; }
.tab-group-count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 8px; background: rgba(0,0,0,.35); border-radius: 11px; font-size: 12px; color: #ffd700; font-weight: bold; vertical-align: middle; }
.tab-group-btn.active .tab-group-count { color: #fff; background: rgba(255,255,255,.22); }

.tabs-action-btn { background: #ffd700; color: #111; border: none; padding: 10px 16px; border-radius: 6px; font-size: 15px; font-weight: bold; min-height: 44px; cursor: pointer; }

/* Abecedář */
.tabs-alpha { display: flex; flex-wrap: wrap; margin: 2px -2px 0; }
.tab-letter-btn { margin: 2px; width: 40px; min-height: 40px; background: #222; color: #fff; border: 1px solid #444; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; padding: 0; box-sizing: border-box; }
.tab-letter-btn.empty { color: #555; background: #181818; border-color: #2a2a2a; cursor: default; }
.tab-letter-btn.active { background: linear-gradient(135deg,#7c3aed,#4c1d95); color: #fff; border-color: #a78bfa; }
.tab-letter-btn.clear { background: #7f1d1d; color: #fecaca; border-color: #b91c1c; width: auto; padding: 0 12px; margin-left: 6px; }
.tab-letter-btn.clear.hidden { display: none; }

.tabs-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tabs-grid > * { margin: 0 10px 10px 0; }
.tab-card { width: calc(20% - 10px); min-height: 100px; background: #333; color: #fff; border: 2px solid #555; border-radius: 8px; padding: 10px; font-size: 14px; font-weight: bold; display: flex; flex-direction: column; justify-content: space-between; align-items: center; position: relative; }
.tab-card.open { background: #2e6b2e; border-color: #5fb65f; }
.tab-card:active { transform: scale(0.97); }
.tab-card .tab-card-name { font-size: 15px; text-align: center; }
.tab-card .tab-card-amount { font-size: 14px; color: #ffd700; margin-top: 6px; }
.tab-card.open .tab-card-amount { color: #fff; }
.tab-card .tab-card-times { font-size: 10px; line-height: 1.25; color: #cfe8cf; opacity: 0.85; margin-top: 2px; text-align: center; font-weight: normal; }
.tab-badge { position: absolute; top: 4px; right: 4px; background: #ffd700; color: #111; font-size: 10px; padding: 2px 6px; border-radius: 10px; }
.tabs-toolbar input#tabs-search { flex: 1; min-width: 160px; background: #111; color: #fff; border: 2px solid #555; border-radius: 6px; padding: 10px 14px; font-size: 15px; }
.tabs-toolbar input#tabs-search:focus { outline: none; border-color: #ffd700; }
.tab-history { background: #1a1a1a; border: 1px solid #444; border-radius: 6px; padding: 10px 12px; color: #ddd; }
.tab-history-title { font-weight: bold; color: #ffd700; margin-bottom: 6px; font-size: 14px; }
.tab-history-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #333; }
.tab-history-summary strong { color: #ffd700; font-weight: bold; }
.tab-history-list { max-height: 220px; overflow-y: auto; font-size: 13px; }
.tab-history-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid #2a2a2a; }
.tab-history-row:last-child { border-bottom: none; }
.tab-history-row.storno { opacity: 0.55; text-decoration: line-through; }
.tab-history-row .thr-date { flex: 1; font-variant-numeric: tabular-nums; }
.tab-history-row .thr-pay { width: 20px; text-align: center; }
.tab-history-row .thr-total { font-weight: bold; color: #ffd700; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

/* ========== NUMPAD (dělená platba) ========== */
.pay-amount-wrap { margin: 15px 0; }
.pay-amount-wrap label { color: #aaa; display: block; font-size: 14px; margin-bottom: 5px; }
#tabpay-amount { width: 100%; padding: 15px; font-size: 28px; text-align: right; background: #111; color: #ffd700; border: 2px solid #444; border-radius: 6px; margin-bottom: 10px; }
.numpad { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; }
.numpad button { width: calc(33.333% - 4px); height: 50px; font-size: 20px; font-weight: bold; background: #3a3a3a; color: #fff; border: 1px solid #555; border-radius: 4px; }
.numpad button:active { background: #555; }
.numpad .numpad-full { width: 100%; background: #ffd700; color: #111; }

/* ========== SLEVA ========== */
.discount-tabs { display: flex; gap: 5px; margin-bottom: 15px; }
.discount-tabs > * + * { margin-left: 5px; }
.disc-tab-btn { flex: 1 1 0; background: #3a3a3a; color: #ccc; border: 2px solid #555; padding: 12px; font-size: 15px; font-weight: bold; border-radius: 6px; }
.disc-tab-btn.active { background: #ffd700; color: #111; border-color: #ffd700; }
.disc-presets { display: flex; gap: 5px; margin-top: 8px; }
.disc-presets > * + * { margin-left: 5px; }
.disc-preset { flex: 1 1 0; background: #2e4b6b; color: #fff; border: 1px solid #555; padding: 10px; font-size: 14px; font-weight: bold; border-radius: 4px; }
.disc-preset:active { background: #1e3b5b; }

/* ========== EDIT MODE karet účtů ========== */
.tab-card.edit { opacity: 0.85; border-style: dashed; border-color: #ffd700; animation: wobble 0.6s ease-in-out infinite alternate; }
.tab-edit-icon { position: absolute; top: 4px; left: 4px; font-size: 16px; }
@keyframes wobble {
    from { transform: rotate(-0.5deg); }
    to { transform: rotate(0.5deg); }
}

/* ========== SMĚNA — souhrn ========== */
.shift-status, .shift-summary { background: #1a1a1a; padding: 15px; border-radius: 6px; margin-bottom: 10px; }
.shift-status-tbl { width: 100%; color: #fff; font-size: 15px; border-collapse: collapse; }
.shift-status-tbl td { padding: 6px 8px; border-bottom: 1px solid #333; }
.shift-status-tbl td:last-child { text-align: right; font-weight: bold; }

/* Responsive pro menší tablety (produkty zůstávají 4 sloupce kvůli slot-indexu v JS) */
@media (max-width: 1000px) {
    .pos-categories { flex-basis: 110px; }
    .pos-cart { flex-basis: 260px; }
}

/* ============================================================
   Stock pad — vlastní numerická klávesnice (pokladna, tablet)
   Displej je <div>, ne <input>, aby nevyskakovala systémová
   klávesnice tabletu při naskladnění / vyskladnění / srovnání.
   ============================================================ */
#stock-pad-modal .modal-box { max-width: 420px; }
.stock-pad-question { color: #fbbf24; font-size: 15px; font-weight: 600; margin: 2px 0 3px; }
.stock-pad-current { color: #9ca3af; font-size: 12px; margin-bottom: 8px; }
.stock-pad-display {
    background: #0f1419;
    border: 2px solid #374151;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 30px;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #5fd665;
    min-height: 40px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    user-select: none;
    -webkit-user-select: none;
}
/* Klávesnice: flexbox + margin (Android 6 / Chrome 45 nemá CSS Grid ani flex gap) */
.stock-pad-keys { display: flex; flex-wrap: wrap; margin: 0 -3px 6px -3px; }
.stock-pad-keys button {
    width: calc(33.333% - 6px);
    margin: 3px;
    padding: 12px 0;
    font-size: 20px;
    font-weight: 700;
    background: #374151;
    color: #fff;
    border: 1px solid #4b5563;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-sizing: border-box;
}
.stock-pad-keys button:active { background: #4b5563; }
.stock-pad-keys button.key-bs { background: #5b2a2a; }
.stock-pad-keys button.key-bs:active { background: #7a3535; }
.stock-pad-note-label { display: block; color: #d1d5db; font-size: 13px; margin-bottom: 8px; }
.stock-pad-note-label input {
    width: 100%;
    padding: 7px 10px;
    font-size: 14px;
    background: #0f1419;
    border: 1px solid #374151;
    border-radius: 6px;
    color: #fff;
    margin-top: 3px;
    box-sizing: border-box;
}
.stock-pad-err { min-height: 16px; color: #ff7777; font-size: 13px; margin-bottom: 6px; text-align: center; font-weight: 600; }
.stock-pad-btns { display: flex; }
.stock-pad-btns > button + button { margin-left: 8px; }
.stock-pad-btns > button { padding: 11px !important; font-size: 15px !important; }

/* ========== VIZUÁLNÍ FEEDBACK PŘI PŘIDÁNÍ POLOŽKY ========== */
/* Probliknutí tlačítka produktu po kliknutí (Chrome 45 kompatibilní) */
.prod-btn.flash { animation: prodFlash 380ms ease-out; }
@keyframes prodFlash {
    0%   { background: #3a3a3a; box-shadow: 0 0 0 0 rgba(255,215,0,0); }
    25%  { background: #6b5a1a; box-shadow: 0 0 0 6px rgba(255,215,0,0.55); }
    100% { background: #3a3a3a; box-shadow: 0 0 0 0 rgba(255,215,0,0); }
}
/* Zvýraznění nově přidané položky v košíku/účtu — bliká, dokud se neuloží */
.cart-item.cart-item-new {
    background: #4a4a1a;
    box-shadow: inset 4px 0 0 #ffd700;
    animation: cartItemPulse 1.4s ease-in-out infinite;
}
@keyframes cartItemPulse {
    0%, 100% { background: #4a4a1a; }
    50%      { background: #5e5e22; }
}
