/* Fidelity Card — mobile-first app shell */
:root {
	--fc-bg: #0f0f1a;
	--fc-surface: #1a1a2e;
	--fc-surface-2: #252540;
	--fc-text: #f0f0f5;
	--fc-muted: #9898b0;
	--fc-primary: #e94560;
	--fc-success: #2ecc71;
	--fc-error: #e74c3c;
	--fc-warn: #f39c12;
	--fc-radius: 12px;
	--fc-touch: 48px;
}

.fc-app {
	min-height: 100vh;
	background: var(--fc-bg);
	color: var(--fc-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	padding: 16px;
	max-width: 720px;
	margin: 0 auto;
	box-sizing: border-box;
}

.fc-header {
	margin-bottom: 24px;
	position: relative;
}

.fc-header h1 {
	font-size: 1.5rem;
	margin: 0 0 4px;
	font-weight: 700;
}

.fc-subtitle {
	color: var(--fc-muted);
	margin: 0;
	font-size: 0.95rem;
}

.fc-inline-form {
	position: absolute;
	top: 0;
	right: 0;
}

.fc-section {
	background: var(--fc-surface);
	border-radius: var(--fc-radius);
	padding: 16px;
	margin-bottom: 16px;
}

.fc-section h2, .fc-section h3 {
	margin: 0 0 12px;
	font-size: 1.1rem;
}

.fc-alert {
	padding: 12px 16px;
	border-radius: var(--fc-radius);
	margin-bottom: 16px;
	font-size: 0.95rem;
}

.fc-alert-error { background: rgba(231,76,60,.15); color: #ff8a80; }
.fc-alert-success { background: rgba(46,204,113,.15); color: #69f0ae; }
.fc-alert-warn { background: rgba(243,156,18,.15); color: #ffd54f; }

.fc-form label {
	display: block;
	margin-bottom: 12px;
	font-size: 0.9rem;
	color: var(--fc-muted);
}

.fc-form input[type="text"],
.fc-form input[type="email"],
.fc-form input[type="tel"],
.fc-form input[type="password"],
.fc-form input[type="number"],
.fc-form input[type="search"],
.fc-input-copy {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--fc-surface-2);
	border-radius: 8px;
	background: var(--fc-bg);
	color: var(--fc-text);
	font-size: 16px;
	min-height: var(--fc-touch);
	box-sizing: border-box;
}

.fc-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--fc-text);
}

.fc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--fc-touch);
	padding: 0 20px;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
}

.fc-btn-primary { background: var(--fc-primary); color: #fff; }
.fc-btn-danger { background: var(--fc-error); color: #fff; }
.fc-btn-ghost { background: transparent; border: 1px solid var(--fc-surface-2); color: var(--fc-text); }
.fc-btn-block { width: 100%; }

.fc-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.fc-tabs a {
	flex: 1;
	text-align: center;
	padding: 12px;
	border-radius: 8px;
	background: var(--fc-surface);
	color: var(--fc-muted);
	text-decoration: none;
}

.fc-tabs a.active {
	background: var(--fc-primary);
	color: #fff;
}

.fc-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.fc-stat {
	background: var(--fc-surface);
	border-radius: var(--fc-radius);
	padding: 12px;
	text-align: center;
}

.fc-stat-value {
	display: block;
	font-size: 1.4rem;
	font-weight: 700;
}

.fc-stat-label {
	font-size: 0.75rem;
	color: var(--fc-muted);
}

.fc-card-list {
	display: grid;
	gap: 12px;
}

.fc-card-mini {
	background: var(--fc-surface-2);
	border-radius: var(--fc-radius);
	padding: 16px;
	border-left: 4px solid var(--fc-primary, var(--fc-primary));
}

.fc-card-mini h3 { margin: 0 0 8px; }
.fc-card-mini-points { font-size: 1.5rem; font-weight: 700; margin: 0; }
.fc-card-mini-code { color: var(--fc-muted); font-size: 0.85rem; }

.fc-card {
	background: linear-gradient(135deg, var(--fc-primary, #1a1a2e), var(--fc-secondary, #e94560));
	border-radius: 16px;
	padding: 24px;
	margin-bottom: 16px;
	text-align: center;
}

.fc-card__store { margin: 8px 0; font-size: 1.2rem; }
.fc-card__code { font-family: monospace; font-size: 1rem; letter-spacing: 1px; }
.fc-card__points-value { font-size: 2.5rem; font-weight: 800; display: block; }
.fc-card__qr { margin: 16px auto; border-radius: 8px; background: #fff; padding: 8px; }

.fc-history { list-style: none; padding: 0; margin: 0; }
.fc-history li {
	display: flex;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--fc-surface-2);
	font-size: 0.9rem;
	flex-wrap: wrap;
}

.fc-history .positive { color: var(--fc-success); font-weight: 600; }
.fc-history .negative { color: var(--fc-error); font-weight: 600; }

.fc-muted { color: var(--fc-muted); }
.fc-back { color: var(--fc-primary); text-decoration: none; display: inline-block; margin-bottom: 12px; }

.fc-search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.fc-search-form input { flex: 1; }

.fc-customer-list { list-style: none; padding: 0; }
.fc-customer-list a { color: var(--fc-text); text-decoration: none; display: block; padding: 12px; background: var(--fc-surface-2); border-radius: 8px; margin-bottom: 8px; }

.fc-points-big { font-size: 2rem; font-weight: 700; }
.fc-points-forms { display: grid; gap: 12px; margin: 16px 0; }
.fc-form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fc-form-inline input[type="number"] { width: 100px; }
.fc-form-inline input[type="text"] { flex: 1; min-width: 120px; }

.fc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.fc-table th, .fc-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--fc-surface-2); }
.fc-shortcode-list { padding-left: 20px; }
.fc-shortcode-list code { background: var(--fc-surface-2); padding: 2px 6px; border-radius: 4px; }

.fc-qr-reg { display: block; margin: 12px auto; background: #fff; border-radius: 8px; padding: 8px; }

@media (min-width: 600px) {
	.fc-app { padding: 24px; }
	.fc-card-list { grid-template-columns: repeat(2, 1fr); }
}

/* Standalone app shell */
.fc-app-body.fc-standalone {
	margin: 0;
	padding: 0;
	background: var(--fc-bg, #0f0f1a);
	overflow-x: hidden;
}

.fc-app-root {
	min-height: 100vh;
	min-height: 100dvh;
	padding-top: env(safe-area-inset-top);
	padding-bottom: env(safe-area-inset-bottom);
}

.fc-tabs-scroll {
	overflow-x: auto;
	flex-wrap: nowrap;
	-webkit-overflow-scrolling: touch;
}

.fc-tabs-scroll a {
	flex: 0 0 auto;
	min-width: 72px;
	white-space: nowrap;
}

.fc-btn-sm {
	min-height: 40px;
	padding: 0 12px;
	font-size: 0.9rem;
}

.fc-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.fc-copy-row {
	display: grid;
	gap: 8px;
	margin: 12px 0;
}

.fc-form-stack {
	display: grid;
	gap: 10px;
}

.fc-form select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--fc-surface-2);
	border-radius: 8px;
	background: var(--fc-bg);
	color: var(--fc-text);
	font-size: 16px;
	min-height: var(--fc-touch);
}

.fc-qr-large {
	width: min(280px, 80vw);
	height: auto;
}

.fc-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-top: 12px;
}

.fc-pipeline-table {
	min-width: 520px;
}

.fc-cashier-card {
	background: var(--fc-surface-2);
	border-radius: var(--fc-radius);
	padding: 14px;
	margin-bottom: 12px;
}

.fc-cashier-card h3 {
	margin: 0 0 8px;
	font-size: 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.fc-badge {
	font-size: 0.7rem;
	padding: 2px 8px;
	border-radius: 999px;
	text-transform: uppercase;
}

.fc-badge-active { background: rgba(46,204,113,.2); color: #69f0ae; }
.fc-badge-suspended { background: rgba(231,76,60,.2); color: #ff8a80; }

.fc-cashier-promote {
	background: var(--fc-surface-2);
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 8px;
}

.fc-cashier-promote summary {
	cursor: pointer;
	font-weight: 600;
}

.fc-install-bar {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: calc(12px + env(safe-area-inset-bottom));
	z-index: 1000;
	max-width: 420px;
	margin: 0 auto;
}

.fc-install-hint {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: calc(12px + env(safe-area-inset-bottom));
	z-index: 999;
	max-width: 420px;
	margin: 0 auto;
	background: var(--fc-surface);
	border: 1px solid var(--fc-surface-2);
	border-radius: var(--fc-radius);
	padding: 12px 14px;
	font-size: 0.85rem;
	color: var(--fc-muted);
}

.fc-install-hint p { margin: 0; }

[data-fc-copy].fc-copied::after {
	content: ' ✓';
	color: var(--fc-success);
}

@media (max-width: 430px) {
	.fc-stats { grid-template-columns: 1fr; }
	.fc-inline-form { position: static; margin-top: 8px; }
	.fc-header h1 { font-size: 1.25rem; padding-right: 0; }
}

@media (min-width: 768px) {
	.fc-app { max-width: 800px; }
	.fc-copy-row { grid-template-columns: 1fr auto; align-items: center; }
}

.fc-card__barcode-wrap {
	margin-top: 16px;
	padding: 12px;
	background: rgba(255,255,255,.08);
	border-radius: 8px;
}

.fc-barcode-svg {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.fc-card__barcode-label {
	margin: 8px 0 2px;
	font-size: 0.85rem;
	font-weight: 600;
}

.fc-card__barcode-value {
	font-family: monospace;
	font-size: 0.9rem;
	margin: 0;
}

.fc-card__barcode-hint {
	font-size: 0.75rem;
	margin: 4px 0 0;
}

.fc-card-switcher {
	margin-bottom: 12px;
}

.fc-store-switch {
	width: 100%;
	padding: 12px;
	border-radius: 8px;
	border: 1px solid var(--fc-surface-2);
	background: var(--fc-surface);
	color: var(--fc-text);
	font-size: 16px;
	min-height: var(--fc-touch);
}

.fc-card-mini__logo {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 8px;
	margin-bottom: 8px;
}

.fc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	border: 0;
}

.fc-qr-print-sheet {
	text-align: center;
	padding: 24px;
}

.fc-app.fc-has-bottom-nav {
	padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.fc-bottom-nav {
	display: flex;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100;
	background: var(--fc-surface);
	border-top: 1px solid var(--fc-surface-2);
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
	gap: 2px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.fc-bottom-nav a,
.fc-bottom-nav-btn {
	flex: 1 0 auto;
	min-width: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 4px;
	font-size: 0.7rem;
	color: var(--fc-muted);
	text-decoration: none;
	background: transparent;
	border: 0;
	cursor: pointer;
	min-height: var(--fc-touch);
}

.fc-bottom-nav a.active,
.fc-bottom-nav-btn:active {
	color: var(--fc-primary);
}

@media (min-width: 768px) {
	.fc-bottom-nav { display: none; }
	.fc-app.fc-has-bottom-nav { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.fc-scanner-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.fc-scanner-modal[hidden] {
	display: none !important;
}

.fc-scanner-inner {
	width: min(100%, 420px);
}

#fc-qr-reader {
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 12px;
}

.fc-search-results {
	margin-top: 8px;
}

.fc-live-results {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fc-result-btn {
	width: 100%;
	text-align: left;
	padding: 12px 14px;
	border: 1px solid var(--fc-surface-2);
	border-radius: 8px;
	background: var(--fc-surface);
	color: var(--fc-text);
	margin-bottom: 6px;
	min-height: var(--fc-touch);
	cursor: pointer;
}

.fc-mode-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.fc-mode-tabs .fc-btn.active {
	background: var(--fc-primary);
	color: #fff;
}

.fc-pipeline-table {
	font-size: 0.85rem;
}

.fc-pipeline-table th,
.fc-pipeline-table td {
	white-space: nowrap;
}

.fc-qr-print-sheet img {
	max-width: 320px;
}
