/* =====================================================================
   ZenitPOS UI additions (loaded after app.css / public.css)
   ===================================================================== */
:root {
    --zp-danger: #ff4d4d;
    --zp-warn: #ffb020;
    --zp-ok: #00ffaa;
    --zp-radius: 10px;
    --zp-focus: 0 0 0 3px rgba(0, 242, 255, .55);
    --input-bg: #0a121a;
    --bg-overlay: rgba(5, 10, 15, .82);
}

/* ---------- accessibility ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--zp-focus) !important; }
.input { color: #e2e8f0; }
.input::placeholder { color: #64748b; }
.label, .zp-hint, .label-dim { color: #a8b5c7; }
button:disabled, .btn-login:disabled, .btn-pay:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- navigation with labels ---------- */
.zp-nav { gap: 4px; overflow-y: auto; }
.zp-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 120px; padding: 10px 6px; margin-bottom: 6px !important;
    background: transparent; border: 1px solid transparent; border-radius: var(--zp-radius);
    color: var(--text-dim); font-size: 22px !important; text-decoration: none;
}
.zp-nav-item span { font-size: 12px; letter-spacing: .5px; }
.zp-nav-item:hover { color: var(--accent-cyan); border-color: var(--border-glow); }
.zp-nav-item.active { color: var(--accent-cyan); background: rgba(0, 242, 255, .08); border-color: var(--border-glow); }
.zp-nav-user { margin-top: auto; text-align: center; padding: 10px 4px; color: var(--text-dim); font-size: 12px; display: flex; flex-direction: column; }
.zp-nav-user strong { color: #fff; font-size: 13px; }

/* ---------- generic building blocks ---------- */
.zp-card { max-width: 95vw; max-height: 92vh; overflow-y: auto; text-align: left; }
.zp-card h2, .zp-card h3 { text-align: center; }
.zp-page { padding: 20px; }
.zp-page-header { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.zp-section { margin-top: 18px; font-size: 1rem; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: 1px; }
.zp-center { text-align: center; }
.zp-muted { color: var(--text-dim); font-size: .85rem; }
.zp-pre { white-space: pre-wrap; word-break: break-word; }
.zp-span-all { grid-column: 1 / -1; }
.zp-link { background: none; border: none; color: var(--accent-cyan); cursor: pointer; padding: 0 4px; text-decoration: underline; }
.zp-btn, .zp-btn-ghost {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.zp-btn { background: var(--accent-cyan); color: var(--bg-color); border: none; }
.zp-btn-ghost { background: transparent; color: #cbd5e1; border: 1px solid #2d3e50; }
.zp-btn-ghost:hover { border-color: var(--accent-cyan); color: #fff; }
.zp-btn-danger { background: var(--zp-danger); color: #fff; border: none; }
.zp-danger { color: var(--zp-danger) !important; }
.zp-icon-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.zp-icon-btn:hover { color: var(--accent-cyan); background: rgba(0, 242, 255, .06); }
.zp-check { display: flex; gap: 10px; align-items: center; margin: 10px 0; color: #cbd5e1; cursor: pointer; text-align: left; }
.zp-check input { width: 18px; height: 18px; accent-color: var(--accent-cyan); }
.zp-password { position: relative; }
.zp-password .zp-icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.zp-code { letter-spacing: 4px; text-transform: uppercase; font-family: 'Courier New', monospace; font-size: 1.2rem; }
.zp-big-input { font-size: 1.6rem; text-align: right; padding: 14px; }
.zp-colour { height: 46px; padding: 4px; }
.zp-stat { font-size: 1.5rem; font-weight: 700; color: #fff; padding: 6px 0; }

.zp-alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: .92rem; text-align: left; }
.zp-alert-danger { background: rgba(255, 77, 77, .12); border: 1px solid rgba(255, 77, 77, .5); color: #ffd1d1; }
.zp-alert-success { background: rgba(0, 255, 170, .1); border: 1px solid rgba(0, 255, 170, .45); color: #c8ffe9; }
.zp-alert-info { background: rgba(0, 242, 255, .08); border: 1px solid var(--border-glow); color: #d4fbff; }

.zp-badge { display: inline-block; padding: 2px 8px; margin: 2px; border-radius: 999px; font-size: .72rem; background: #1a2a3a; color: #cbd5e1; }
.zp-badge-warn { background: rgba(255, 176, 32, .18); color: var(--zp-warn); }
.zp-inactive { opacity: .5; }

.zp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; color: var(--text-dim); text-align: center; }
.zp-empty i { font-size: 2.4rem; color: var(--accent-cyan); }
.zp-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(0, 242, 255, .2); border-top-color: var(--accent-cyan); animation: zp-spin .8s linear infinite; }
@keyframes zp-spin { to { transform: rotate(360deg); } }

.zp-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.zp-list-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 12px; background: #0a121a; border: 1px solid #1a2a3a; border-radius: 8px; color: #fff; cursor: pointer; }
.zp-list-item small { color: var(--text-dim); }
.zp-list-item:hover { border-color: var(--accent-cyan); }

.zp-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin-top: 8px; border: 1px solid rgba(255, 77, 77, .5); border-radius: 8px; }
.zp-confirm span { flex: 1 1 100%; }

/* ---------- sales screen ---------- */
.zp-sales-header { flex-wrap: wrap; gap: 10px; padding: 10px 10px 0; }
.zp-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zp-breadcrumb { display: flex; gap: 4px; align-items: center; color: var(--text-dim); flex-wrap: wrap; }
.zp-breadcrumb .zp-link { text-decoration: none; color: #cbd5e1; }
.zp-search { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.zp-grid { padding: 10px; }
.zp-product { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; border-color: #1a2a3a !important; }
.zp-product[style*="--zp-item-colour"] { background: linear-gradient(160deg, var(--zp-item-colour) 0%, var(--panel-bg) 85%); }
.zp-product:hover { border-color: var(--accent-cyan) !important; transform: translateY(-1px); }
.zp-product:active { transform: scale(.97); }
.zp-product h4 { font-size: 1rem; margin: 6px 0 2px; }
.zp-product p { margin: 0; color: var(--accent-cyan); font-weight: 600; }
.zp-product .zp-badge { position: absolute; top: 6px; right: 6px; }
.zp-product-icon { font-size: 2rem; }
.zp-group { border-style: dashed !important; }
.zp-pulse { animation: zp-pulse .4s ease-out; }
@keyframes zp-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 242, 255, .7); } 100% { box-shadow: 0 0 0 16px rgba(0, 242, 255, 0); } }

/* ---------- cart ---------- */
.zp-cart { gap: 6px; }
.zp-cart .cart-list { flex: 1; overflow-y: auto; }
.zp-cart-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 0; color: var(--text-dim); }
.zp-cart-empty i { font-size: 2rem; }
.zp-line { padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.zp-line-main { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.zp-line-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.zp-line-actions { margin-left: auto; display: flex; }
.zp-line-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.zp-line-edit .btn-container { grid-column: 1 / -1; }
.zp-flash { animation: zp-flash .6s ease-out; }
@keyframes zp-flash { from { background: rgba(0, 242, 255, .18); } to { background: transparent; } }
.zp-qty { display: inline-flex; align-items: center; border: 1px solid #2d3e50; border-radius: 8px; overflow: hidden; }
.zp-qty button { width: 34px; height: 30px; background: #0a121a; color: #fff; border: none; font-size: 1.1rem; cursor: pointer; }
.zp-qty button:hover { background: rgba(0, 242, 255, .15); }
.zp-qty span { min-width: 30px; text-align: center; }
.zp-total-row { display: flex; justify-content: space-between; padding: 4px 0; }
.zp-cart-tools { display: flex; gap: 6px; margin-top: 10px; }
.zp-cart-tools > * { flex: 1; padding: 8px 4px; font-size: .85rem; }

/* ---------- pay screen ---------- */
.zp-pay { max-height: 95vh; overflow-y: auto; }
.zp-tender { margin: 14px 0; }
.zp-quick-cash { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.zp-quick-cash button { flex: 1; min-width: 70px; padding: 12px 6px; background: #0a121a; border: 1px solid #2d3e50; border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; }
.zp-quick-cash button:hover { border-color: var(--accent-cyan); }
.zp-tenders { border-top: 1px dashed #2d3e50; padding-top: 6px; }
.zp-change { margin: 10px 0; padding: 14px; text-align: center; font-size: 1.4rem; border-radius: 10px; background: rgba(0, 255, 170, .1); color: var(--zp-ok); }
.zp-pay .payment-grid i { font-size: 1.8rem; }

/* ---------- PIN keypad ---------- */
.zp-pin-card { width: 360px; }
.zp-pin-display { text-align: center; font-size: 2rem; letter-spacing: 8px; min-height: 48px; color: var(--accent-cyan); }
.zp-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.zp-keypad button { padding: 18px 0; font-size: 1.4rem; background: #0a121a; color: #fff; border: 1px solid #2d3e50; border-radius: 10px; cursor: pointer; }
.zp-keypad .zp-key-ok { background: var(--accent-cyan); color: var(--bg-color); font-weight: 700; }

/* ---------- tables / reports ---------- */
.zp-table-wrap { overflow-x: auto; }
.zp-table { width: 100%; border-collapse: collapse; color: #e2e8f0; }
.zp-table th, .zp-table td { padding: 10px 8px; border-bottom: 1px solid #1a2a3a; text-align: left; white-space: nowrap; }
.zp-table th { color: var(--text-dim); font-weight: 600; font-size: .8rem; text-transform: uppercase; }
.zp-table tfoot td { font-weight: 700; }
.zp-num { text-align: right !important; }
.zp-actions { display: flex; gap: 6px; }
.zp-actions .zp-btn-ghost { padding: 6px 10px; font-size: .8rem; }
.zp-row-refund td { color: #ffb3b3; }
.zp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.zp-kpi { background: var(--panel-bg); border: 1px solid var(--border-glow); border-radius: var(--zp-radius); padding: 14px; display: flex; flex-direction: column; }
.zp-kpi span { color: var(--text-dim); font-size: .8rem; text-transform: uppercase; }
.zp-kpi strong { font-size: 1.5rem; }
.zp-quick-range { display: inline-flex; border: 1px solid #2d3e50; border-radius: 8px; overflow: hidden; }
.zp-quick-range button { background: transparent; color: #cbd5e1; border: none; padding: 8px 12px; cursor: pointer; }
.zp-quick-range button:hover { background: rgba(0, 242, 255, .1); }
.chart-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chart-controls input[type=date] { background: var(--input-bg); color: #fff; border: 1px solid #2d3e50; border-radius: 6px; padding: 6px; }
.zp-cashup { max-width: 520px; margin: 0 auto; }
.zp-cash-count { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #2d3e50; }
.zp-variance span:last-child { color: var(--zp-warn); }

/* ---------- editors ---------- */
.zp-editor { gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.zp-editor .create-container, .zp-editor .user-modal { max-width: 100%; }
.zp-icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; margin-bottom: 12px; }
.zp-icon-picker .icon { font-size: 1.3rem; padding: 8px; background: #0a121a; border: 1px solid #1a2a3a; border-radius: 6px; color: #fff; cursor: pointer; }
.zp-icon-picker .icon.active { border-color: var(--accent-cyan); }
.zp-item-tile, .zp-user-tile { text-align: left; cursor: pointer; }
.zp-user-tile.active { border-color: var(--accent-cyan) !important; }
.zp-items-header { flex-wrap: wrap; gap: 10px; padding: 0 10px; }
.zp-settings-tiles { padding: 10px; }
.zp-code-box { display: flex; align-items: center; gap: 8px; background: #0a121a; border: 1px dashed var(--border-glow); padding: 10px; border-radius: 8px; word-break: break-all; }
.zp-toggle { display: flex; border: 1px solid #2d3e50; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.zp-toggle button { flex: 1; padding: 10px; background: transparent; color: #cbd5e1; border: none; cursor: pointer; }
.zp-toggle button.active { background: var(--accent-cyan); color: var(--bg-color); font-weight: 700; }
.zp-scroll-overlay { overflow-y: auto; align-items: flex-start; padding: 30px 0; }
.zp-signup { max-width: 95vw; }
.zp-inline-form { display: flex; gap: 8px; max-width: 420px; width: 100%; }
.zp-plans { max-width: 95vw; overflow-y: auto; max-height: 95vh; }

/* ---------- receipts ---------- */
.zp-receipt-page { overflow-y: auto; justify-content: flex-start; padding: 20px 0; }
.zp-receipt-actions { flex-wrap: wrap; justify-content: center; }
.zp-r-small { font-size: .75rem; color: var(--text-dim); }
.zp-r-title { font-weight: 700; letter-spacing: 2px; margin-top: 6px; }
.zp-r-footer { text-align: center; margin-top: 20px; font-size: .75rem; color: var(--text-dim); }

/* ---------- Kevin ---------- */
.zp-chat-link { display: inline-block; margin-top: 6px; color: var(--accent-cyan); }

/* ---------- reconnect overlay (Blazor adds the state classes) ---------- */
.zp-reconnect { display: none; position: fixed; inset: 0; z-index: 5000; background: var(--bg-overlay); backdrop-filter: blur(6px); align-items: center; justify-content: center; }
.zp-reconnect.components-reconnect-show,
.zp-reconnect.components-reconnect-failed,
.zp-reconnect.components-reconnect-rejected { display: flex; }
.zp-reconnect-card { background: var(--panel-bg); border: 1px solid var(--border-glow); border-radius: 16px; padding: 30px; max-width: 420px; text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.zp-reconnect .zp-reconnect-show, .zp-reconnect .zp-reconnect-failed, .zp-reconnect .zp-reconnect-rejected { display: none; }
.zp-reconnect.components-reconnect-show .zp-reconnect-show,
.zp-reconnect.components-reconnect-failed .zp-reconnect-failed,
.zp-reconnect.components-reconnect-rejected .zp-reconnect-rejected { display: block; }

/* ---------- responsive: tablets and phones ---------- */
@media (max-width: 1100px) {
    .cart-panel { width: 320px; }
    .zp-nav-item { width: 90px; }
    .nav { width: 110px; }
}

@media (max-width: 820px) {
    .body { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
    .nav, .zp-nav { width: 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 6px; border-right: none; border-bottom: 1px solid var(--border-glow); position: sticky; top: 0; z-index: 1000; }
    .zp-nav-item { width: auto; min-width: 70px; margin-bottom: 0 !important; font-size: 18px !important; }
    .zp-nav-user { display: none; }
    .menu-handle { display: none !important; }
    .main-content { overflow: visible; }
    .cart-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-glow); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important; }
    .search-bar { width: 100% !important; }
    .zp-search { flex: 1 1 100%; }
    .login-card, .user-modal, .pay-container { width: 95vw !important; padding: 22px !important; }
    .pricing-container { flex-direction: column; }
    .zp-line-edit { grid-template-columns: 1fr; }
}

@media (min-width: 821px) {
    .mobile-cart-toggle { display: none !important; }
}

@media print {
    .zp-nav, .menu-handle, .cart-panel, .zp-receipt-actions, .chart-controls { display: none !important; }
}

/* =====================================================================
   App wrapper – gives every app screen (incl. modals outside .body)
   explicit text colours, so nothing inherits Bootstrap's dark #212529.
   ===================================================================== */
.zp-app { color: var(--text-white); background: var(--bg-color); min-height: 100vh; }
.zp-app h1, .zp-app h2, .zp-app h3, .zp-app h4, .zp-app h5, .zp-app h6 { color: inherit; }
.zp-app .login-card, .zp-app .user-modal, .zp-app .create-container, .zp-app .pay-container { color: var(--text-white); }
.zp-app .login-card h2, .zp-app .user-modal h2, .zp-app .create-container h2 { color: var(--text-white); }
/* app.css forces every link to the dim colour – keep that for nav, but make content links readable */
.zp-app .zp-link, .zp-app .zp-chat-link, .zp-app .pin-hint a, .zp-app .zp-hint a { color: var(--accent-cyan) !important; }
.zp-app .pin-hint { color: var(--text-dim); }
.zp-app .btn-tour-skip { color: #a8b5c7; }
.zp-app .chat-msg.Info .msg-timestamp { color: #94a3b8; }
.input::placeholder { color: #7b8a9e; }
.zp-modal-layer { z-index: 3000 !important; }
.zp-hide-mobile { }
.zp-row-active td { background: rgba(0, 242, 255, .06); }
.zp-variance-text { color: var(--zp-warn); }
.zp-saved-note { text-align: center; margin-top: 10px; }
.zp-filter { margin: 0; }
.zp-filter button { padding: 8px 12px; font-size: .85rem; white-space: nowrap; }
.zp-pin-input { text-align: center; font-size: 1.8rem; letter-spacing: 10px; margin-bottom: 6px; }

/* Desktop: the right-hand handle collapses the cart */
@media (min-width: 821px) {
    .cart-panel.zp-collapsed { display: none; }
    .zp-mobile-bar, .zp-sheet-handle, .zp-sheet-backdrop { display: none !important; }
}

/* =====================================================================
   Landing page – "Choose your plan"
   ===================================================================== */
.pricing .pricing-container { align-items: stretch; }
.pricing .price-card { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 260px; }
.pricing .price-card .features-list { align-self: stretch; color: #e2e8f0; }
.pricing .price-card .btn-cta { margin-top: auto; }
.pricing .price-card .amount { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.1; white-space: nowrap; }
.pricing .price-card .amount span { font-size: .38em; vertical-align: middle; }
.pricing .price-card .trial-text { margin-bottom: 18px; }
.pricing .price-card .zp-hint { margin-top: 10px; display: block; }
.pricing .price-card h3 { margin-top: 6px; }
.pricing > .zp-hint { margin-top: 40px; }

/* Privacy / Terms rules in public.css used "p, li" (unscoped) – stop them leaking into the app */
.zp-app li { font-size: inherit; margin-bottom: 0; }
.zp-app .features-list li { margin-bottom: 15px; }

/* =====================================================================
   Mobile Sales screen (≤ 820px)
   - compact top menu, sticky search, 3-column grid with big tap targets
   - sticky bottom bar: items · total · Pay
   - cart opens as a bottom sheet
   ===================================================================== */
@media (max-width: 820px) {
    .zp-hide-mobile { display: none !important; }
    .zp-nav-item span { display: none; }
    .zp-nav-item { min-width: 48px; padding: 8px; font-size: 20px !important; }
    .zp-nav { gap: 2px; justify-content: flex-start; }

    .main-content { padding-bottom: 84px; }

    .zp-sales-header { position: sticky; top: 52px; z-index: 900; background: var(--bg-color); padding: 8px; margin-bottom: 0; }
    .zp-sales-header .zp-breadcrumb { font-size: .85rem; }
    .zp-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; padding: 8px; }
    .zp-product { min-height: 92px; padding: 8px 4px !important; }
    .zp-product h4 { font-size: .85rem; line-height: 1.15; margin: 4px 0 0; word-break: break-word; }
    .zp-product p { font-size: .85rem; }
    .zp-product-icon { font-size: 1.5rem; }

    /* cart hidden until the sheet is opened */
    .cart-panel.zp-cart { display: none; }
    .cart-panel.zp-cart.zp-sheet-open {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500;
        max-height: 82vh; width: 100% !important; border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, .5); padding: 6px 16px 16px; animation: zp-slide-up .2s ease-out;
    }
    .zp-sheet-handle { display: flex; justify-content: center; background: none; border: none; padding: 6px 0 10px; cursor: pointer; }
    .zp-sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: var(--text-dim); opacity: .6; }
    .zp-sheet-backdrop { position: fixed; inset: 0; z-index: 2400; background: rgba(0, 0, 0, .45); }
    .mobile-cart-toggle { display: none !important; }

    .zp-mobile-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 2300; display: flex; gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel-bg);
        border-top: 1px solid var(--border-glow); box-shadow: 0 -6px 20px rgba(0, 0, 0, .35);
    }
    .zp-mobile-bar-cart { flex: 1; display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid var(--border-glow);
                          border-radius: 10px; color: var(--text-white); padding: 10px 12px; font-size: 1rem; }
    .zp-mobile-bar-cart strong { margin-left: auto; font-size: 1.1rem; }
    .zp-mobile-bar-icon { position: relative; }
    .zp-mobile-bar-icon .cart-count-badge { position: absolute; top: -10px; right: -12px; font-size: .7rem; padding: 1px 6px; border-radius: 999px; }
    .zp-mobile-bar-pay { min-width: 96px; border: none; border-radius: 10px; background: var(--accent-cyan); color: var(--bg-color); font-weight: 800;
                         font-size: 1.1rem; text-transform: uppercase; }
    .zp-mobile-bar-pay:disabled { opacity: .4; }
}
@keyframes zp-slide-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* =====================================================================
   LIGHT THEME (app only – .zp-app[data-theme=light])
   ===================================================================== */
.zp-app[data-theme="light"] {
    --bg-color: #f3f5f8;
    --panel-bg: #ffffff;
    --accent-cyan: #0e7490;
    --cyan: #0e7490;
    --text-white: #0f172a;
    --text-dim: #475569;
    --border-glow: rgba(14, 116, 144, .28);
    --bg-dark: #e8edf3;
    --border: #d5dde7;
    --input-bg: #ffffff;
    --bg-overlay: rgba(15, 23, 42, .45);
    --success-green: #047857;
    --magenta: #a21caf;
    --zp-ok: #047857;
    --zp-warn: #b45309;
    --zp-danger: #dc2626;
    --zp-focus: 0 0 0 3px rgba(14, 116, 144, .45);
    color-scheme: light;
}
.zp-app[data-theme="light"] .body { color: var(--text-white) !important; }
.zp-app[data-theme="light"] .nav, .zp-app[data-theme="light"] .cart-panel { box-shadow: 0 0 0 1px var(--border); }
.zp-app[data-theme="light"] .nav-item:hover, .zp-app[data-theme="light"] .nav-item.active { filter: none; }

/* text that app.css hard-codes as white */
.zp-app[data-theme="light"] .search-bar,
.zp-app[data-theme="light"] .product-card,
.zp-app[data-theme="light"] .item-grid .item,
.zp-app[data-theme="light"] .user-modal,
.zp-app[data-theme="light"] .icon,
.zp-app[data-theme="light"] .field-label,
.zp-app[data-theme="light"] .success-state h3,
.zp-app[data-theme="light"] .badge-body h3,
.zp-app[data-theme="light"] .zp-nav-user strong,
.zp-app[data-theme="light"] .zp-stat,
.zp-app[data-theme="light"] .zp-list-item,
.zp-app[data-theme="light"] .zp-reconnect-card { color: var(--text-white) !important; }

.zp-app[data-theme="light"] .label, .zp-app[data-theme="light"] .zp-hint, .zp-app[data-theme="light"] .label-dim,
.zp-app[data-theme="light"] .subtitle, .zp-app[data-theme="light"] .forgot-pass, .zp-app[data-theme="light"] .success-state p,
.zp-app[data-theme="light"] .badge-body p, .zp-app[data-theme="light"] .zp-muted { color: var(--text-dim) !important; }

.zp-app[data-theme="light"] .zp-check, .zp-app[data-theme="light"] .zp-btn-ghost, .zp-app[data-theme="light"] .zp-breadcrumb .zp-link,
.zp-app[data-theme="light"] .zp-quick-range button, .zp-app[data-theme="light"] .zp-toggle button,
.zp-app[data-theme="light"] .btn-secondary, .zp-app[data-theme="light"] .btn-icon, .zp-app[data-theme="light"] .btn-cancel { color: #334155; }
.zp-app[data-theme="light"] .zp-toggle button.active { color: #ffffff; }

/* surfaces */
.zp-app[data-theme="light"] .input,
.zp-app[data-theme="light"] .chart-controls input[type=date] { background: #ffffff; color: #0f172a; border-color: #cbd5e1; }
.zp-app[data-theme="light"] .input::placeholder { color: #94a3b8; }
.zp-app[data-theme="light"] .search-bar { background: #ffffff; }
.zp-app[data-theme="light"] .product-card,
.zp-app[data-theme="light"] .item-grid .item { box-shadow: 0 1px 2px rgba(15, 23, 42, .06); border: 1px solid var(--border) !important; }
.zp-app[data-theme="light"] .zp-product[style*="--zp-item-colour"] { background: linear-gradient(160deg, var(--zp-item-colour) 0%, #ffffff 80%); }
.zp-app[data-theme="light"] .pay-option,
.zp-app[data-theme="light"] .chart-controls,
.zp-app[data-theme="light"] .zp-list-item,
.zp-app[data-theme="light"] .zp-qty button,
.zp-app[data-theme="light"] .zp-quick-cash button,
.zp-app[data-theme="light"] .zp-keypad button,
.zp-app[data-theme="light"] .zp-icon-picker .icon,
.zp-app[data-theme="light"] .zp-code-box { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }
.zp-app[data-theme="light"] .zp-keypad .zp-key-ok { background: var(--accent-cyan); color: #ffffff; }
.zp-app[data-theme="light"] .btn-print { background: #e2e8f0; color: #0f172a; }
.zp-app[data-theme="light"] .tooltip-box,
.zp-app[data-theme="light"] .tour-badge { background-color: #ffffff; color: #334155; }
.zp-app[data-theme="light"] .tooltip-box::after { border-color: #ffffff transparent transparent transparent; }
.zp-app[data-theme="light"] .tour-mask { background-color: rgba(15, 23, 42, .55); }
.zp-app[data-theme="light"] .zp-badge { background: #e2e8f0; color: #334155; }
.zp-app[data-theme="light"] .zp-badge-warn { background: #fef3c7; color: #92400e; }

/* buttons that were dark-text-on-cyan stay readable: white text on the darker teal */
.zp-app[data-theme="light"] .btn-login, .zp-app[data-theme="light"] .btn-pay, .zp-app[data-theme="light"] .btn-complete,
.zp-app[data-theme="light"] .btn-new, .zp-app[data-theme="light"] .zp-btn, .zp-app[data-theme="light"] .pay-option.active,
.zp-app[data-theme="light"] .zp-mobile-bar-pay, .zp-app[data-theme="light"] .btn-tour-nav.primary { color: #ffffff !important; }
.zp-app[data-theme="light"] .btn-pay:hover, .zp-app[data-theme="light"] .btn-complete:hover, .zp-app[data-theme="light"] .btn-new:hover { background: #155e75; }

/* borders and dividers */
.zp-app[data-theme="light"] .zp-line, .zp-app[data-theme="light"] .cart-item,
.zp-app[data-theme="light"] .zp-table th, .zp-app[data-theme="light"] .zp-table td { border-color: #e2e8f0; }
.zp-app[data-theme="light"] .zp-qty, .zp-app[data-theme="light"] .zp-tenders, .zp-app[data-theme="light"] .zp-cash-count,
.zp-app[data-theme="light"] .zp-quick-range, .zp-app[data-theme="light"] .zp-toggle,
.zp-app[data-theme="light"] .zp-btn-ghost, .zp-app[data-theme="light"] .btn-secondary, .zp-app[data-theme="light"] .btn-back { border-color: #cbd5e1; }
.zp-app[data-theme="light"] .zp-table { color: #0f172a; }
.zp-app[data-theme="light"] .zp-row-refund td { color: #b91c1c; }

/* alerts */
.zp-app[data-theme="light"] .zp-alert-danger { color: #991b1b; background: #fef2f2; }
.zp-app[data-theme="light"] .zp-alert-success { color: #065f46; background: #ecfdf5; }
.zp-app[data-theme="light"] .zp-alert-info { color: #155e75; background: #ecfeff; }
.zp-app[data-theme="light"] .zp-change { color: #047857; background: #ecfdf5; }

/* receipt preview inside the app (cash-up) */
.zp-app[data-theme="light"] .receipt-paper { background: #ffffff; color: #0f172a; border: 1px solid var(--border); }

/* Kevin */
.zp-app[data-theme="light"] #universal-chat-container { background-color: #f8fafc; }
.zp-app[data-theme="light"] #chat-header, .zp-app[data-theme="light"] #chat-input-area { background: #ffffff; color: #0f172a; }
.zp-app[data-theme="light"] #chat-input { background: #ffffff; color: #0f172a; border-color: #cbd5e1; }
.zp-app[data-theme="light"] #chat-input::placeholder { color: #94a3b8; }
.zp-app[data-theme="light"] .chat-msg.Request { background: #e0f2fe; color: #0c4a6e; }
.zp-app[data-theme="light"] .chat-msg.Info { background: #f1f5f9; color: #334155; }
.zp-app[data-theme="light"] .chat-msg.Success { background: #ecfdf5; color: #065f46; }
.zp-app[data-theme="light"] .chat-msg.Warning { background: #fef2f2; color: #991b1b; }
.zp-app[data-theme="light"] .btn-chat-close, .zp-app[data-theme="light"] .btn-msg-copy { color: #64748b; }
.zp-app[data-theme="light"] .warning-card { background-color: #ffffff; }
.zp-app[data-theme="light"] .warning-body { color: #334155; }

/* mobile bar in light mode */
.zp-app[data-theme="light"] .zp-mobile-bar { box-shadow: 0 -4px 16px rgba(15, 23, 42, .12); }

/* app.css sets "a { color: var(--text-dim) !important }" for every link – restore readable colours
   for links that are styled as buttons or tiles. */
a.btn-login, a.zp-btn, a.btn-pay { color: #050a0f !important; }
a.btn-tactical { color: #ffffff !important; }
.zp-app a.zp-btn-ghost { color: #cbd5e1 !important; }
.zp-app a.zp-item-tile, .zp-app a.product-card { color: var(--text-white) !important; }
.zp-app[data-theme="light"] a.btn-login, .zp-app[data-theme="light"] a.zp-btn { color: #ffffff !important; }
.zp-app[data-theme="light"] a.zp-btn-ghost { color: #334155 !important; }

/* audit log */
.zp-audit td { white-space: normal; vertical-align: top; font-size: .85rem; }
.zp-audit-details { margin: 0; padding: 10px; background: rgba(0, 0, 0, .25); border-radius: 8px; font-size: .78rem; max-height: 320px; overflow: auto; }
.zp-app[data-theme="light"] .zp-audit-details { background: #f1f5f9; }
.zp-inline-select { width: auto; padding: 8px; }

/* Kevin */
.zp-chat-card { width: min(600px, 95vw); padding: 0 !important; overflow: hidden; }
.zp-chat-card #universal-chat-container { height: min(600px, 85vh); }

/* build stamp at the bottom of the menu */
.zp-build { margin-top: 8px; padding: 4px; font-size: 10px; color: var(--text-dim); text-align: center; opacity: .8; word-break: break-word; }
.zp-nav-user + .zp-build { margin-top: 0; }
@media (max-width: 820px) { .zp-build { display: none; } }

/* Kevin page */
.zp-chat-page { display: flex; justify-content: center; padding: 20px; }
.zp-chat-page .zp-chat-card { width: min(820px, 100%); max-width: 100%; }
.zp-chat-page #universal-chat-container { height: calc(100vh - 60px); }
.zp-chat-header-actions { display: flex; gap: 4px; }
@media (max-width: 820px) {
    .zp-chat-page { padding: 0; }
    .zp-chat-page .zp-chat-card { width: 100% !important; margin: 0 !important; border-radius: 0; }
    .zp-chat-page #universal-chat-container { height: calc(100vh - 70px); }
}

/* Full-screen + theme: one row of small buttons above the user name */
.zp-nav-tools { margin-top: auto; display: flex; justify-content: center; gap: 8px; padding: 10px 0 4px; }
.zp-nav-tools + .zp-nav-user { margin-top: 0; }
.zp-nav-tool {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border-glow); border-radius: 8px;
    color: var(--text-dim); font-size: 15px; cursor: pointer; transition: .2s;
}
.zp-nav-tool:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }
@media (max-width: 820px) {
    .zp-nav-tools { margin-top: 0; margin-left: auto; padding: 0 4px; }
    .zp-nav-tool { width: 32px; height: 32px; font-size: 14px; }
}

/* "Install ZenitPOS" banner (after login) */
.zp-install {
    position: fixed; z-index: 2600; left: 50%; bottom: 20px; transform: translateX(-50%);
    width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 14px; background: var(--panel-bg); color: var(--text-white);
    border: 1px solid var(--border-glow); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); animation: zp-slide-up .25s ease-out;
}
.zp-install-icon { width: 48px; height: 48px; border-radius: 10px; flex: none; }
.zp-install-text { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; color: var(--text-dim); }
.zp-install-text strong { color: var(--text-white); font-size: 1rem; }
.zp-install-actions { display: flex; flex-direction: column; gap: 6px; margin-left: auto; }
.zp-install-actions .zp-btn, .zp-install-actions .zp-btn-ghost { padding: 8px 14px; white-space: nowrap; }
@media (max-width: 820px) {
    .zp-install { bottom: calc(84px + env(safe-area-inset-bottom)); flex-wrap: wrap; }   /* above the sale bar */
    .zp-install-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* app.css sets ":fullscreen .body { background: #000 }" (deeper blacks for the dark theme).
   In the light theme keep the normal light background when full screen. */
:fullscreen .zp-app[data-theme="light"],
:fullscreen .zp-app[data-theme="light"] .body,
:-webkit-full-screen .zp-app[data-theme="light"],
:-webkit-full-screen .zp-app[data-theme="light"] .body { background-color: var(--bg-color) !important; }

/* App icon in the menu and on the login card */
.zp-nav-brand { display: flex; justify-content: center; padding: 4px 0 14px; }
.zp-nav-brand img { width: 48px; height: 48px; border-radius: 12px; box-shadow: 0 0 0 1px var(--border-glow); }
.zp-login-icon { width: 72px; height: 72px; border-radius: 16px; margin: 0 auto 10px; display: block; box-shadow: 0 0 24px rgba(0, 242, 255, .25); }
@media (max-width: 820px) {
    .zp-nav-brand { padding: 0 6px 0 2px; align-items: center; }
    .zp-nav-brand img { width: 34px; height: 34px; border-radius: 8px; }
}

/* =====================================================================
   Receipt page (public layout – no app wrapper, so set colours explicitly;
   otherwise text falls back to Bootstrap's near-black on the dark background)
   ===================================================================== */
.zp-receipt-page { color: #e2e8f0; }
.zp-receipt-page .receipt-paper { color: #e2e8f0; }
.zp-receipt-page .brand-header h1 { color: #ffffff; }
.zp-receipt-page .item-row { color: #e2e8f0; }
.zp-receipt-page .item-row > span:last-child { color: #ffffff; font-weight: 600; white-space: nowrap; }
.zp-receipt-page .info-row { color: #a8b5c7; }
.zp-receipt-page .info-row > span:last-child { color: #e2e8f0; }
.zp-receipt-page .zp-r-small, .zp-receipt-page .zp-r-footer { color: #a8b5c7; }
.zp-receipt-page .zp-r-title { color: #00f2ff; }
.zp-receipt-page .zp-empty, .zp-receipt-page .zp-empty h3 { color: #e2e8f0; }

/* Receipt actions: one consistent button style */
.zp-receipt-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: min(420px, 95vw); margin-top: 24px; }
.zp-raction {
    flex: 1 1 calc(50% - 10px); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(0, 242, 255, .35);
    background: #0d161f; color: #e2e8f0 !important; font-weight: 700; font-size: .9rem; letter-spacing: .5px;
    text-transform: uppercase; cursor: pointer; text-decoration: none; transition: .2s;
}
.zp-raction:hover { border-color: #00f2ff; color: #00f2ff !important; }
.zp-raction-primary { background: #00f2ff; color: #050a0f !important; border-color: #00f2ff; }
.zp-raction-primary:hover { background: #ffffff; color: #050a0f !important; }
.zp-raction-whatsapp i { color: #25d366; }
.zp-receipt-page .zp-inline-form { width: min(420px, 95vw); margin-top: 12px; }
.zp-receipt-page .zp-inline-form .input { color: #e2e8f0; background: #0a121a; }
@media (max-width: 480px) {
    .zp-raction { flex-basis: 100%; }
}

/* Cards used outside the app wrapper (Error / Not found pages) */
.login-card, .zp-card { color: #e2e8f0; }
.login-card h2, .zp-card h2 { color: #ffffff; }
.zp-app .login-card, .zp-app .zp-card { color: var(--text-white); }
.zp-app .login-card h2, .zp-app .zp-card h2 { color: var(--text-white); }

/* receipt actions centred when the mobile overlay switches to block layout */
@media (max-width:768px){ .zp-receipt-actions{ margin:24px auto 0 !important; } }

/* ---------- e-mail confirmation banner / consent / CAPTCHA ---------- */
.zp-confirm-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 12px; padding: 10px 14px;
    border: 1px solid var(--zp-warn); border-radius: 10px; background: rgba(255, 176, 32, .08); color: var(--text-white); font-size: .9rem; }
.zp-confirm-banner > span { flex: 1 1 240px; }
.zp-consent { align-items: flex-start; font-size: .85rem; }
.zp-consent input { flex: none; margin-top: 2px; }
.zp-consent a { color: var(--accent-cyan) !important; }
.zp-turnstile { margin: 8px 0; min-height: 0; }

/* ---------- full tax invoice details on the pay screen ---------- */
.zp-taxinv { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border-glow); border-radius: 10px; text-align: left; }
.zp-taxinv summary { cursor: pointer; color: var(--accent-cyan); font-size: .9rem; }
.zp-taxinv[open] summary { margin-bottom: 8px; }

.zp-danger-text { color: var(--zp-danger) !important; }
.zp-danger-bg { background: var(--zp-danger) !important; border-color: var(--zp-danger) !important; color: #fff !important; }

/* "Keep selling offline" on the reconnect screen */
.zp-reconnect-card .zp-offline-btn { background: #ffb020 !important; border-color: #ffb020 !important; color: #050a0f !important; }
.zp-reconnect-card .zp-offline-btn[hidden] { display: none !important; }
.zp-offline-count { color: #ffb020; }

/* ---------- "needs attention" banner (ShopHealthService) ---------- */
.zp-issue-banner { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 8px 12px; padding: 12px 14px;
    border: 1px solid var(--zp-warn); border-radius: var(--zp-radius); background: rgba(255, 176, 32, .08); color: var(--text-white); font-size: .9rem; }
.zp-issue-banner > i { color: var(--zp-warn); font-size: 1.2rem; margin-top: 2px; }
.zp-issue-banner.zp-issue-danger { border-color: var(--zp-danger); background: rgba(255, 77, 77, .08); }
.zp-issue-banner.zp-issue-danger > i { color: var(--zp-danger); }
.zp-issue-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zp-issue-text > span { color: var(--text-dim); }
.zp-issue-steps { margin: 8px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.zp-issue-go { align-self: flex-start; margin-top: 4px; }
.zp-issue-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 768px) {
    .zp-issue-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- page error (FriendlyErrorBoundary) ---------- */
.zp-page-error { max-width: 520px; margin: 48px auto; padding: 28px 24px; text-align: center; border: 1px solid var(--border-glow);
    border-radius: 16px; background: var(--panel-bg); color: var(--text-white); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.zp-page-error > i { font-size: 2rem; color: var(--zp-warn); }
.zp-page-error h2 { margin: 0; font-size: 1.3rem; }
.zp-page-error p { margin: 0; color: var(--text-dim); }
.zp-page-error-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
