/* ============================================================
   JUNIPER POS — Stylesheet
   Dark, native-feeling POS interface
   ============================================================ */

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

:root {
	--bg:          #0d0d1a;
	--bg-2:        #13131f;
	--bg-3:        #1a1a2e;
	--bg-4:        #222238;
	--surface:     #1e1e30;
	--surface-2:   #26263a;
	--border:      rgba(255,255,255,.08);
	--border-2:    rgba(255,255,255,.14);
	--accent:      #8E0633;
	--accent-2:    #b0082e;
	--accent-glow: rgba(142,6,51,.3);
	--green:       #22c55e;
	--green-bg:    rgba(34,197,94,.12);
	--red:         #ef4444;
	--red-bg:      rgba(239,68,68,.12);
	--amber:       #f59e0b;
	--amber-bg:    rgba(245,158,11,.12);
	--blue:        #3b82f6;
	--blue-bg:     rgba(59,130,246,.12);
	--text:        #f0f0f5;
	--text-2:      rgba(240,240,245,.6);
	--text-3:      rgba(240,240,245,.35);
	--font:        'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono:   'SF Mono', 'Fira Code', monospace;
	--radius:      14px;
	--radius-sm:   8px;
	--radius-lg:   20px;
	--tab-height:  72px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-top:    env(safe-area-inset-top, 0px);
}

html, body {
	height: 100%;
	overflow: hidden;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

#pos-root {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	padding-top: var(--safe-top);
}

/* ── Screens ─────────────────────────────────────────────── */

.pos-screen {
	display: none;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
}
.pos-screen.active { display: flex; }

/* ── Top Bar ─────────────────────────────────────────────── */

.pos-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px 10px;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
	gap: 12px;
}
.pos-topbar-title {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--text);
}
.pos-topbar-sub {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 1px;
}
.pos-topbar-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--surface);
	border: none;
	color: var(--text-2);
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background .15s;
}
.pos-topbar-btn:active { background: var(--surface-2); }

/* ── Bottom Tab Bar ──────────────────────────────────────── */

#pos-tabbar {
	display: flex;
	background: var(--bg-2);
	border-top: 1px solid var(--border);
	height: calc(var(--tab-height) + var(--safe-bottom));
	padding-bottom: var(--safe-bottom);
	flex-shrink: 0;
}
.pos-tab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	border: none;
	background: none;
	color: var(--text-3);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: .02em;
	cursor: pointer;
	transition: color .15s;
	padding: 8px 4px;
}
.pos-tab .tab-icon {
	font-size: 22px;
	line-height: 1;
	transition: transform .15s;
}
.pos-tab.active {
	color: var(--accent-2);
}
.pos-tab.active .tab-icon {
	transform: scale(1.1);
}
.pos-tab:active .tab-icon { transform: scale(.92); }

/* ── Login Screen ────────────────────────────────────────── */

#screen-login {
	background: var(--bg);
	justify-content: center;
	align-items: center;
	padding: 40px 32px;
	gap: 0;
}
.login-logo {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--text-3);
	margin-bottom: 8px;
}
.login-brand {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--text);
	margin-bottom: 4px;
}
.login-sub {
	font-size: 13px;
	color: var(--text-3);
	margin-bottom: 48px;
}
.login-field {
	width: 100%;
	max-width: 320px;
	margin-bottom: 16px;
}
.login-field label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--text-3);
	margin-bottom: 8px;
}
.login-field input {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	font-size: 16px;
	color: var(--text);
	outline: none;
	font-family: var(--font);
	transition: border-color .15s;
}
.login-field input:focus { border-color: var(--accent-2); }

.pin-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--text-3);
	margin-bottom: 16px;
	width: 100%;
	max-width: 320px;
}
.pin-display {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
}
.pin-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid var(--border-2);
	transition: all .15s;
}
.pin-dot.filled {
	background: var(--accent-2);
	border-color: var(--accent-2);
	transform: scale(1.1);
}
.pin-dot.loading {
	background: var(--accent-2);
	border-color: var(--accent-2);
	animation: pinPulse .6s ease-in-out infinite alternate;
}
@keyframes pinPulse {
	from { opacity: 1; transform: scale(1.1); }
	to   { opacity: .35; transform: scale(0.9); }
}
.pin-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	width: 100%;
	max-width: 320px;
	margin-bottom: 24px;
}
.pin-key {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	height: 64px;
	font-size: 24px;
	font-weight: 400;
	color: var(--text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .1s, transform .1s;
	-webkit-tap-highlight-color: transparent;
}
.pin-key:active {
	background: var(--surface-2);
	transform: scale(.94);
}
.pin-key.pin-del {
	font-size: 20px;
	color: var(--text-2);
}
.pin-key.pin-empty { background: none; border: none; cursor: default; }

.login-btn,
button#login-submit {
	width: 100%;
	max-width: 320px;
	background: var(--accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 14px !important;
	height: 54px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer;
	letter-spacing: .01em;
	display: block;
	margin: 0;
	padding: 0 !important;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
	transition: background .15s, transform .1s, opacity .15s;
}
.login-btn:active,
button#login-submit:active { background: var(--accent-2) !important; transform: scale(.98); }
.login-btn:disabled,
button#login-submit:disabled { opacity: .4 !important; cursor: not-allowed; }
.login-error {
	color: var(--red);
	font-size: 13px;
	margin-top: 12px;
	text-align: center;
	min-height: 20px;
}

/* ── Scanner Screen ──────────────────────────────────────── */

#screen-scanner {
	position: relative;
	background: #000;
}
#scanner-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.scanner-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.scanner-frame {
	width: 240px;
	height: 240px;
	position: relative;
}
.scanner-frame::before,
.scanner-frame::after,
.scanner-corner-br,
.scanner-corner-bl {
	content: '';
	position: absolute;
	width: 36px;
	height: 36px;
	border-color: #fff;
	border-style: solid;
}
.scanner-frame::before  { top: 0; left: 0;  border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.scanner-frame::after   { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.scanner-corner-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.scanner-corner-bl { bottom: 0; left: 0;  border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.scanner-line {
	position: absolute;
	left: 4px; right: 4px;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
	animation: scan-line 2s ease-in-out infinite;
}
@keyframes scan-line {
	0%   { top: 8px; opacity: 0; }
	10%  { opacity: 1; }
	90%  { opacity: 1; }
	100% { top: calc(100% - 8px); opacity: 0; }
}
.scanner-hint {
	margin-top: 24px;
	font-size: 13px;
	color: rgba(255,255,255,.5);
	letter-spacing: .02em;
}
.scanner-topbar {
	position: absolute;
	top: 0; left: 0; right: 0;
	padding: 16px 20px;
	padding-top: calc(16px + var(--safe-top));
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
	pointer-events: all;
}
.scanner-topbar-title {
	font-size: 17px;
	font-weight: 600;
	color: #fff;
}
.scanner-action-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,.15);
	backdrop-filter: blur(8px);
	border: none;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ── Scan Result Sheet ───────────────────────────────────── */

#scan-result {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	background: var(--bg-2);
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
	padding: 24px 24px calc(24px + var(--safe-bottom));
	transform: translateY(100%);
	transition: transform .3s cubic-bezier(.32,.72,0,1);
	z-index: 10;
	border-top: 1px solid var(--border);
}
#scan-result.visible { transform: translateY(0); }
.result-pill {
	width: 40px;
	height: 4px;
	background: var(--border-2);
	border-radius: 2px;
	margin: 0 auto 20px;
}
.result-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin: 0 auto 16px;
}
.result-icon.success { background: var(--green-bg); }
.result-icon.error   { background: var(--red-bg); }
.result-icon.warning { background: var(--amber-bg); }
.result-icon.info    { background: var(--blue-bg); }
.result-name {
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	letter-spacing: -.02em;
	margin-bottom: 4px;
}
.result-detail {
	font-size: 14px;
	color: var(--text-2);
	text-align: center;
	margin-bottom: 20px;
	line-height: 1.5;
}
.result-badges {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.result-badge {
	padding: 5px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-accent { background: var(--accent-glow); color: var(--accent-2); }
.result-dismiss {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	height: 52px;
	color: var(--text);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.result-dismiss:active { background: var(--surface-2); }

/* ── Scrollable Content ──────────────────────────────────── */

.pos-scroll {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 16px calc(16px + var(--safe-bottom));
}

/* ── Cards ───────────────────────────────────────────────── */

.pos-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	margin-bottom: 10px;
}
.pos-card-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.pos-card-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 3px;
}
.pos-card-sub {
	font-size: 12px;
	color: var(--text-3);
	line-height: 1.4;
}
.pos-card-action {
	flex-shrink: 0;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius-sm);
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.pos-card-action:active { background: var(--accent-2); }
.pos-card-action.secondary {
	background: var(--surface-2);
	color: var(--text-2);
}

/* ── Search Bar ──────────────────────────────────────────── */

.pos-search-wrap {
	padding: 12px 16px 8px;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}
.pos-search {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0 14px;
	height: 42px;
}
.pos-search-icon { font-size: 16px; color: var(--text-3); flex-shrink: 0; }
.pos-search input {
	flex: 1;
	background: none;
	border: none;
	outline: none;
	font-size: 15px;
	color: var(--text);
	font-family: var(--font);
}
.pos-search input::placeholder { color: var(--text-3); }

/* ── Section Header ──────────────────────────────────────── */

.pos-section-header {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--text-3);
	padding: 16px 0 8px;
}

/* ── Status Indicator ────────────────────────────────────── */

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}
.status-dot.green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.red    { background: var(--red); }
.status-dot.amber  { background: var(--amber); }

/* ── Stats Grid ──────────────────────────────────────────── */

.stats-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 10px;
}
.stat-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
}
.stat-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text-3);
	margin-bottom: 8px;
}
.stat-value {
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--text);
	line-height: 1;
}
.stat-value.green { color: var(--green); }
.stat-value.accent { color: var(--accent-2); }
.stat-value.blue { color: var(--blue); }
.stat-value.red { color: var(--red); }

/* ── Sell Screen ─────────────────────────────────────────── */

.sell-event-bar {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding: 12px 16px;
	font-size: 13px;
	color: var(--text-2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.sell-event-name {
	font-weight: 600;
	color: var(--text);
	font-size: 14px;
}
.sell-layout {
	display: flex;
	flex: 1;
	min-height: 0;
	gap: 0;
}

.sell-left {
	display: flex;
	flex-direction: column;
	flex: 2;
	min-width: 0;
	border-right: 1px solid var(--border);
	overflow: hidden;
}

.sell-right {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 240px;
	max-width: 360px;
	padding: 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--bg-2);
}

.sell-products {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding: 16px;
	overflow-y: auto;
	flex: 1;
}
.sell-product {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 12px;
	cursor: pointer;
	text-align: center;
	transition: border-color .15s, background .15s;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.sell-product:active { background: var(--surface-2); border-color: var(--border-2); }
.sell-product-counter {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 16px;
}

.sell-counter-btn {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid var(--border-2);
	background: var(--surface-2);
	color: var(--text);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all .15s;
	flex-shrink: 0;
	padding: 0;
	-webkit-appearance: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.sell-counter-btn:active {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.sell-counter-val {
	min-width: 40px;
	text-align: center;
	font-size: 22px;
	font-weight: 700;
	color: var(--text);
}

.sell-product.in-cart .sell-counter-val {
	color: var(--accent-2);
}

.sell-product.in-cart .sell-product.in-cart { border-color: var(--accent); background: var(--accent-glow); }
.sell-product-icon { font-size: 28px; }
.sell-product-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.sell-product-price { font-size: 16px; font-weight: 700; color: var(--accent-2); }

.sell-cart {
	background: var(--bg-2);
	border-top: 1px solid var(--border);
	padding: 16px 16px calc(16px + var(--safe-bottom));
	flex-shrink: 0;
}
/* sell-right payment buttons stacked */
.sell-right .sell-payment-btns {
	grid-template-columns: 1fr;
	margin-top: auto;
	padding-top: 12px;
}
.sell-cart-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.sell-cart-total-label { font-size: 13px; color: var(--text-2); }
.sell-cart-total-amount { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sell-payment-btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.sell-pay-btn {
	height: 52px;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background .15s;
}
.sell-pay-btn.cash { background: var(--surface); color: var(--text); }
.sell-pay-btn.card { background: var(--accent); color: #fff; border-color: var(--accent); }
.sell-pay-btn:active { opacity: .8; }
.sell-pay-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Empty State ─────────────────────────────────────────── */

.pos-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 32px;
	text-align: center;
	color: var(--text-3);
	gap: 12px;
}
.pos-empty-icon { font-size: 40px; opacity: .4; }
.pos-empty-text { font-size: 14px; line-height: 1.5; }

/* ── Toast ───────────────────────────────────────────────── */

#pos-toast {
	position: fixed;
	top: calc(20px + var(--safe-top));
	left: 50%;
	transform: translateX(-50%) translateY(-80px);
	background: var(--surface-2);
	border: 1px solid var(--border-2);
	border-radius: 20px;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text);
	z-index: 9999;
	transition: transform .25s cubic-bezier(.32,.72,0,1);
	white-space: nowrap;
	pointer-events: none;
}
#pos-toast.show { transform: translateX(-50%) translateY(0); }

/* ── Loading Spinner ─────────────────────────────────────── */

.pos-spinner {
	width: 20px; height: 20px;
	border: 2px solid var(--border-2);
	border-top-color: var(--text);
	border-radius: 50%;
	animation: spin .6s linear infinite;
	margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Profile pill in topbar ──────────────────────────────── */

.staff-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 5px 12px 5px 6px;
	font-size: 12px;
	color: var(--text-2);
}
.staff-avatar {
	width: 24px; height: 24px;
	border-radius: 50%;
	background: var(--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	flex-shrink: 0;
}

/* ── Tab icon fix for Line Awesome ──────────────────────── */
.pos-tab .tab-icon {
	font-size: 22px;
	line-height: 1;
	transition: transform .15s;
}
.pos-tab.active .tab-icon { transform: scale(1.1); }
.pos-tab:active .tab-icon { transform: scale(.92); }

/* ── Guestlist rows ──────────────────────────────────────── */

.gl-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
}
.gl-row:active { background: var(--surface); }

.gl-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	border: 2.5px solid;
}
.gl-none { background: transparent;      border-color: var(--border-2);  color: var(--text-3); }
.gl-half { background: var(--amber-bg);  border-color: var(--amber);     color: var(--amber); }
.gl-full { background: var(--green-bg);  border-color: var(--green);     color: var(--green); }
.gl-over { background: var(--red-bg);    border-color: var(--red);       color: var(--red); }

.gl-info { flex: 1; min-width: 0; }
.gl-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.gl-meta { font-size: 12px; color: var(--text-3); }
.gl-count {
	font-size: 14px;
	font-weight: 700;
	color: var(--text-2);
	flex-shrink: 0;
}

/* ── Selector ────────────────────────────────────────────── */

.pos-selector {
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	font-size: 14px;
	color: var(--text);
	font-family: var(--font);
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	margin-bottom: 12px;
}

/* ── Checkin count modal ─────────────────────────────────── */

.pos-sheet {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	background: rgba(0,0,0,.5);
	backdrop-filter: blur(4px);
}
.pos-sheet-inner {
	background: var(--bg-2);
	border-radius: var(--radius-lg) var(--radius-lg) 0 0;
	padding: 24px 24px calc(24px + var(--safe-bottom));
	border-top: 1px solid var(--border);
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.pos-sheet-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 4px;
}
.pos-sheet-sub {
	font-size: 13px;
	color: var(--text-3);
	margin-bottom: 12px;
}
.pos-sheet-notes {
	display: none;
	align-items: flex-start;
	gap: 8px;
	background: rgba(255, 200, 0, 0.12);
	border: 1px solid rgba(255, 200, 0, 0.35);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	margin-bottom: 20px;
	font-size: 14px;
	color: var(--text);
	line-height: 1.4;
}
.pos-sheet-notes.visible {
	display: flex;
}
.pos-sheet-notes-icon {
	font-size: 16px;
	flex-shrink: 0;
	margin-top: 1px;
}
.pos-counter {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin-bottom: 24px;
}
.pos-counter-btn {
	width: 48px; height: 48px;
	border-radius: 50%;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	-webkit-appearance: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	flex-shrink: 0;
}
.pos-counter-btn:active { background: var(--surface-2); }

/* Smaller variant for discount-tile counters (Vendi / Lista popup) —
   still meets the ~44px minimum touch target, just visually tighter
   than the main checkin counter. */
.pos-counter-btn-sm {
	width: 44px;
	height: 44px;
	font-size: 20px;
}

.pos-counter-value {
	font-size: 36px;
	font-weight: 700;
	min-width: 48px;
	text-align: center;
}
.pos-sheet-confirm {
	width: 100%;
	height: 52px;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}
.pos-sheet-cancel {
	width: 100%;
	height: 44px;
	background: none;
	color: var(--text-3);
	border: none;
	font-size: 15px;
	cursor: pointer;
	margin-top: 8px;
}

/* ── Utilities ───────────────────────────────────────────── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.fw-6  { font-weight: 600; }
.color-green  { color: var(--green); }
.color-red    { color: var(--red); }
.color-amber  { color: var(--amber); }
.color-accent { color: var(--accent-2); }

/* ── Dashboard ───────────────────────────────────────────── */

.db-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 20px 16px 16px;
	gap: 12px;
}
.db-greeting {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--text);
	margin-bottom: 3px;
}
.db-role {
	font-size: 13px;
	color: var(--text-3);
}
.db-event-card {
	margin: 0 16px 8px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
}
.db-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.db-stat {
	background: var(--bg-3);
	border-radius: var(--radius-sm);
	padding: 10px;
}
.db-stat-label {
	font-size: 11px;
	color: var(--text-3);
	margin-bottom: 4px;
}
.db-stat-val {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--text);
}
.db-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding: 0 16px 16px;
}
.db-tile {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 14px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.db-tile:active {
	background: var(--surface-2);
	border-color: var(--border-2);
}
.db-tile-icon {
	font-size: 24px;
	color: var(--text-2);
	display: block;
	margin-bottom: 10px;
}
.db-tile-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 3px;
}
.db-tile-sub {
	font-size: 12px;
	color: var(--text-3);
}

/* ── Checkin warning ─────────────────────────────────────── */
.checkin-warning {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	margin-bottom: 16px;
	background: var(--amber-bg);
	color: var(--amber);
	line-height: 1.4;
}
.checkin-warning.hidden { display: none; }
/* ── Tickets list ────────────────────────────────────────── */

.tk-summary {
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-3);
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.tk-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	transition: background .15s;
}

.tk-row.tk-checked {
	opacity: .55;
}
.tk-row.tk-checked .tk-undo-btn {
	opacity: 1;
	pointer-events: all;
}

.tk-info {
	flex: 1;
	min-width: 0;
}

.tk-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tk-sub {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tk-action {
	flex-shrink: 0;
}

.tk-checkin-btn {
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius-sm);
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.tk-checkin-btn:active {
	filter: brightness(.9);
}

.tk-checkin-btn:disabled {
	opacity: .5;
}

.tk-badge {
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 20px;
}

.tk-badge-done {
	background: rgba(22, 163, 74, .15);
	color: #16a34a;
}

/* ── Guestlist filter bar — inline on iPad ───────────────── */

.guestlist-filters {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 16px;
	flex-shrink: 0;
}

.guestlist-filters .pos-selector,
.guestlist-filters .pos-search {
	margin-bottom: 0;
}

@media (min-width: 768px) {
	.guestlist-filters {
		flex-direction: row;
		align-items: center;
	}

	.guestlist-filters .pos-selector {
		flex: 1;
		min-width: 0;
	}

	.guestlist-filters .pos-search {
		flex: 1.2;
		min-width: 0;
	}
}

/* ── Ticket checkin sheet ────────────────────────────────── */

.tk-sheet-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 16px;
	font-weight: 600;
	padding: 16px;
	margin-bottom: 12px;
	cursor: pointer;
}

.tk-sheet-btn i {
	font-size: 22px;
}

.tk-sheet-btn:active {
	background: var(--surface);
}

.tk-undo-btn {
	cursor: pointer;
	border: none;
	text-decoration: underline dotted;
	text-underline-offset: 3px;
}
.tk-undo-btn:active {
	filter: brightness(.85);
}

/* ── Guestlist payment popup ─────────────────────────────── */

.glpay-disc-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	background: var(--surface-2);
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 8px;
	cursor: pointer;
	transition: all .15s;
	width: 100%;
}

.glpay-disc-btn.active {
	border-color: var(--accent-2);
	background: rgba(142,6,51,.12);
}

.glpay-disc-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
}

.glpay-disc-sub {
	font-size: 11px;
	color: var(--text-3);
}

.glpay-disc-btn.active .glpay-disc-label {
	color: var(--accent-2);
}

/* ── Guestlist payment badge ─────────────────────────────── */

.glpay-badge {
	position: fixed;
	bottom: calc(70px + env(safe-area-inset-bottom));
	right: 16px;
	z-index: 900;
	background: var(--accent-2);
	color: #fff;
	border: none;
	border-radius: 24px;
	padding: 10px 16px 10px 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,.4);
	animation: badgePop .3s cubic-bezier(.34,1.56,.64,1);
}

.glpay-badge i {
	font-size: 18px;
}

.glpay-badge.hidden {
	display: none;
}

@keyframes badgePop {
	from { transform: scale(0.6); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

/* ── Ticket channel tags ─────────────────────────────────── */

.tk-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	border-radius: 4px;
	padding: 2px 7px;
}

.tk-tag-lista {
	background: rgba(142,6,51,.15);
	color: var(--accent-2);
}

.tk-tag-online {
	background: rgba(59,130,246,.12);
	color: #60a5fa;
}

.tk-tag-pos {
	background: rgba(255,255,255,.07);
	color: var(--text-3);
}

.tk-tag-omaggio {
	background: rgba(234,179,8,.12);
	color: #ca8a04;
}

/* ── Guestlist queue panel ───────────────────────────────── */

.glpay-queue-panel {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	top: 0;
	z-index: 950;
	display: flex;
	align-items: flex-end;
	background: rgba(0,0,0,.55);
}

.glpay-queue-panel.hidden {
	display: none;
}

.glpay-queue-inner {
	width: 100%;
	background: var(--surface);
	border-radius: 16px 16px 0 0;
	padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
	max-height: 60vh;
	overflow-y: auto;
}

.glpay-queue-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px 12px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--text-3);
	border-bottom: 1px solid var(--border);
	margin-bottom: 4px;
}

.glpay-queue-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
}

.glpay-queue-info {
	flex: 1;
	min-width: 0;
}

.glpay-queue-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
}

.glpay-queue-meta {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 2px;
}

.glpay-queue-btn {
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius-sm);
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
}

.glpay-queue-btn:active {
	filter: brightness(.9);
}

.glpay-queue-delete-btn {
	background: none;
	border: 1px solid var(--border-2);
	color: var(--text-3);
	border-radius: var(--radius-sm);
	width: 36px;
	height: 36px;
	font-size: 16px;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: manipulation;
}

.glpay-queue-delete-btn:active {
	background: var(--red-bg);
	border-color: var(--red);
	color: var(--red);
}

/* ── Transactions list ───────────────────────────────────── */

.tx-summary {
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-3);
	border-bottom: 1px solid var(--border);
}

.tx-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
}

.tx-info {
	flex: 1;
	min-width: 0;
}

.tx-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tx-sub {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 2px;
}

.tx-staff {
	font-size: 11px;
	color: var(--text-3);
	margin-top: 3px;
	opacity: .7;
}

.tx-amount {
	flex-shrink: 0;
	text-align: right;
}

.tx-total {
	font-size: 16px;
	font-weight: 700;
	color: var(--text);
}

.tx-notes {
	font-size: 11px;
	color: var(--text-3);
	margin-top: 3px;
	max-width: 120px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Clickable lista tag in transactions ─────────────────── */

.tx-lista-btn {
	cursor: pointer;
	border: none;
	text-decoration: underline dotted;
	text-underline-offset: 2px;
	vertical-align: middle;
}

.tx-lista-btn:active {
	filter: brightness(.85);
}

/* ── Season Pass tab ─────────────────────────────────────── */

.pass-filters {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.pass-status-toggle {
	display: flex;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	flex-shrink: 0;
}

.pass-toggle-btn {
	background: none;
	border: none;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-3);
	cursor: pointer;
	transition: background .15s, color .15s;
}

.pass-toggle-btn.active {
	background: var(--accent);
	color: #fff;
}

.pass-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.pass-row:active {
	background: var(--surface-2);
}

.pass-row-photo {
	flex-shrink: 0;
}

.pass-row-info {
	flex: 1;
	min-width: 0;
}

.pass-row-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pass-row-sub {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 2px;
}

.pass-row-right {
	flex-shrink: 0;
	text-align: right;
}

.pass-tier-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	border-radius: 4px;
	padding: 2px 8px;
	letter-spacing: .02em;
}

/* ── Pass type tags ──────────────────────────────────────── */

.pass-type-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	border-radius: 4px;
	padding: 1px 7px;
	vertical-align: middle;
}

.pass-type-resident {
	background: rgba(59,130,246,.12);
	color: #60a5fa;
}

.pass-type-worker {
	background: rgba(239,68,68,.12);
	color: #f87171;
}

/* ── Pass birthday ───────────────────────────────────────── */

.pass-row-dob {
	font-size: 11px;
	color: var(--text-3);
	margin-top: 3px;
}

.pass-row-dob-soon {
	color: #ca8a04;
	font-weight: 600;
}

/* ── New pass button & form ──────────────────────────────── */

.pass-new-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--accent);
	border: none;
	color: #fff;
	font-size: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	line-height: 1;
}

.pass-new-btn:active {
	filter: brightness(.85);
}

.pass-form-label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--text-3);
	margin-bottom: 6px;
}

.pass-form-input {
	width: 100%;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	font-size: 15px;
	color: var(--text);
	box-sizing: border-box;
	-webkit-appearance: none;
}

.pass-form-input:focus {
	outline: none;
	border-color: var(--accent);
}

.pass-type-select {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--text-3);
	cursor: pointer;
	text-align: center;
}

.pass-type-select.active {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* ── Test mode toggle ─────────────────────────────────────── */

.test-mode-switch {
	position: relative;
	display: inline-block;
	width: 48px;
	height: 28px;
	flex-shrink: 0;
}
.test-mode-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.test-mode-slider {
	position: absolute;
	cursor: pointer;
	top: 0; left: 0; right: 0; bottom: 0;
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: 28px;
	transition: .15s;
}
.test-mode-slider::before {
	content: "";
	position: absolute;
	height: 20px;
	width: 20px;
	left: 3px;
	bottom: 3px;
	background: var(--text-3);
	border-radius: 50%;
	transition: .15s;
}
.test-mode-switch input:checked + .test-mode-slider {
	background: #ca8a04;
	border-color: #ca8a04;
}
.test-mode-switch input:checked + .test-mode-slider::before {
	transform: translateX(20px);
	background: #fff;
}

/* ── Tavoli / Cambusa screens ────────────────────────────── */

.tv-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	transition: background .1s;
}
.tv-row:active { background: var(--surface-2); }

.tv-table-badge {
	background: var(--accent);
	color: #fff;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	padding: 4px 8px;
	flex-shrink: 0;
	min-width: 36px;
	text-align: center;
	letter-spacing: .02em;
}

.tv-info { flex: 1; min-width: 0; }

.tv-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	margin-bottom: 2px;
}

.tv-sub {
	font-size: 12px;
	color: var(--text-3);
	margin-bottom: 3px;
}

.tv-drinks {
	font-size: 12px;
	color: var(--text-2);
}

.tv-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

/* Status pills */
.tv-pill {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	letter-spacing: .03em;
}
.tv-pill-paid    { background: var(--green-bg);  color: var(--green); }
.tv-pill-partial { background: var(--amber-bg);  color: var(--amber); }
.tv-pill-pending { background: var(--blue-bg);   color: var(--blue); }
.tv-pill-noshow  { background: var(--surface-2); color: var(--text-3); }