/* ═══════════════════════════════════════
   ZU Blutspende Gewinnspiel
   Mobile-First · Light Glassmorphism
   ═══════════════════════════════════════ */

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

:root {
	--red: #b91c35;
	--red-dark: #8e1428;
	--red-light: #fef2f3;
	--red-glow: rgba(185, 28, 53, 0.22);
	--red-subtle: rgba(185, 28, 53, 0.06);
	--red-gradient: linear-gradient(135deg, #8e1428, #b91c35);
	--red-gradient-bold: linear-gradient(135deg, #7a1122 0%, #b91c35 50%, #c93048 100%);

	--bg: linear-gradient(165deg, #f0f2f8 0%, #f8f4f6 35%, #f5f0f8 65%, #f0f4f8 100%);
	--bg-flat: #f5f3f7;
	--bg-white: #ffffff;
	--bg-glass: rgba(255, 255, 255, 0.65);
	--bg-glass-solid: rgba(255, 255, 255, 0.85);
	--bg-glass-hover: rgba(255, 255, 255, 0.9);
	--bg-surface: #f1f3f9;
	--bg-input: rgba(255, 255, 255, 0.8);

	--text: #0f172a;
	--text-secondary: #475569;
	--text-muted: #94a3b8;
	--text-inverse: #ffffff;

	--border: rgba(0, 0, 0, 0.06);
	--border-strong: rgba(0, 0, 0, 0.1);
	--border-focus: rgba(196, 30, 58, 0.4);

	--radius: 14px;
	--radius-lg: 22px;
	--radius-xl: 28px;
	--radius-full: 9999px;

	--shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
	--shadow-sm: 0 2px 8px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
	--shadow-md: 0 8px 24px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
	--shadow-lg: 0 20px 50px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.05);
	--shadow-glow: 0 4px 20px var(--red-glow);
	--shadow-glow-lg: 0 8px 40px var(--red-glow);

	--blur: blur(20px);
	--blur-heavy: blur(40px);

	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Base ─── */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
	font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
	color: var(--text);
	background: var(--bg-flat);
	background-image: var(--bg);
	background-attachment: fixed;
	line-height: 1.6;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* Ambient gradient blobs */
body::before {
	content: '';
	position: fixed;
	top: -25%;
	right: -15%;
	width: 55%;
	height: 55%;
	background: radial-gradient(circle, rgba(196, 30, 58, 0.06) 0%, transparent 65%);
	pointer-events: none;
	z-index: 0;
}

body::after {
	content: '';
	position: fixed;
	bottom: -20%;
	left: -15%;
	width: 50%;
	height: 50%;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 65%);
	pointer-events: none;
	z-index: 0;
}

a {
	color: var(--red);
	text-decoration: none;
	transition: color 0.2s var(--ease);
}
a:hover { color: var(--red-dark); }

small {
	display: block;
	margin-top: 0.3rem;
	color: var(--text-muted);
	font-size: 0.75rem;
}

code {
	font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
	font-size: 0.8em;
	background: var(--bg-surface);
	padding: 0.15em 0.45em;
	border-radius: 6px;
	border: 1px solid var(--border);
}

.text-muted { color: var(--text-secondary); }

/* ─── Icons ─── */
svg { vertical-align: middle; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* ─── Container ─── */
.container {
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	padding: 0 1rem;
	position: relative;
	z-index: 1;
}

.container:has(.admin-container) {
	max-width: 800px;
}

/* ═══════════════════════════════════════
   Page Header / Footer (in-container)
   ═══════════════════════════════════════ */
.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0 1.25rem;
}

.page-header .logo {
	color: var(--text);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.page-header .logo svg { color: var(--red); }
.page-header .logo:hover { color: var(--text); }

.page-footer {
	padding: 2rem 0 1.5rem;
	text-align: center;
	font-size: 0.68rem;
	color: var(--text-muted);
}

/* ═══════════════════════════════════════
   Main
   ═══════════════════════════════════════ */
main {
	flex: 1;
	padding: 0 0 1rem;
	position: relative;
	z-index: 1;
}

/* ═══════════════════════════════════════
   Glass Cards
   ═══════════════════════════════════════ */
.card {
	background: var(--bg-glass);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	padding: 1.5rem;
	box-shadow: var(--shadow-sm);
	transition: all 0.3s var(--ease);
}

.card + .card { margin-top: 1rem; }
.card { min-width: 0; overflow: hidden; }

.card h1 {
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin-bottom: 0.3rem;
	color: var(--text);
}

.card > p {
	margin-bottom: 1.25rem;
	color: var(--text-secondary);
	font-size: 0.875rem;
}

.card h2 {
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 0.45rem;
	letter-spacing: -0.01em;
}

.card h2 svg { color: var(--red); width: 18px; height: 18px; }

.text-center { text-align: center; }

.text-center h1 {
	background: var(--red-gradient-bold);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-size: 1.6rem;
}

.lead { font-size: 1rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════
   Forms
   ═══════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
	font-size: 0.78rem;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	font-size: 0.9rem;
	font-family: inherit;
	color: var(--text);
	background: var(--bg-input);
	backdrop-filter: blur(8px);
	transition: all 0.2s var(--ease);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: var(--red);
	background: var(--bg-white);
	box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1), var(--shadow-sm);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group select { cursor: pointer; }

.form-group input[type="date"] {
	color-scheme: light;
	cursor: pointer;
	line-height: 1.2;
	min-height: 0;
	height: auto;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.15s;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
	opacity: 1;
}

.form-group input[type="date"]:focus::-webkit-calendar-picker-indicator {
	opacity: 1;
}
.form-group textarea { min-height: 110px; resize: vertical; }

.form-group input[type="file"] {
	font-size: 0.8rem;
	color: var(--text-secondary);
	padding: 0.55rem 0.75rem;
}

.checkbox-group label {
	font-weight: 400;
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	cursor: pointer;
	color: var(--text);
	font-size: 0.875rem;
	text-transform: none;
	letter-spacing: 0;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
	margin-top: 0.2rem;
	flex-shrink: 0;
	accent-color: var(--red);
	width: 1.1rem;
	height: 1.1rem;
}

/* ═══════════════════════════════════════
   Modal
   ═══════════════════════════════════════ */
.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(4px);
	padding: 0;
}

.modal-content {
	background: var(--bg-white);
	border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	width: 100%;
	max-width: 640px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-lg);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
	flex-shrink: 0;
}

.modal-header strong { display: flex; align-items: center; gap: 0.4rem; }

.modal-body {
	padding: 1.25rem;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.privacy-text { font-size: 0.82rem; line-height: 1.7; color: var(--text-secondary); }
.privacy-text h2 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1.25rem 0 0.5rem; }
.privacy-text h3 { font-size: 0.88rem; font-weight: 700; color: var(--text); margin: 1rem 0 0.4rem; }
.privacy-text h4 { font-size: 0.82rem; font-weight: 700; color: var(--text); margin: 0.75rem 0 0.3rem; }
.privacy-text p { margin: 0 0 0.65rem; }
.privacy-text ul { margin: 0 0 0.65rem; padding-left: 1.25rem; }
.privacy-text li { margin-bottom: 0.25rem; }
.privacy-text strong { color: var(--text); }

@media (min-width: 640px) {
	.modal-backdrop { align-items: center; padding: 2rem; }
	.modal-content { border-radius: var(--radius-xl); max-height: 80vh; }
}

/* Code Input (6 chars) */
.code-input {
	display: flex;
	gap: 0.4rem;
	justify-content: center;
}

.code-char {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 3.25rem;
	border: 2px solid var(--border-strong);
	border-radius: var(--radius);
	text-align: center;
	font-family: 'SF Mono', 'JetBrains Mono', monospace;
	font-size: 16px;
	font-weight: 800;
	color: var(--text);
	background: var(--bg-white);
	text-transform: uppercase;
	caret-color: var(--red);
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
	-moz-appearance: textfield;
	padding: 0.85rem 0;
	line-height: 1;
	box-sizing: border-box;
}

.code-char:focus {
	outline: none;
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(185, 28, 53, 0.1);
}

.code-char.filled {
	border-color: var(--red);
	background: var(--red-light);
}

.code-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: none;
	border-radius: var(--radius-full);
	background: var(--bg-surface);
	color: var(--text-muted);
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.15s;
	align-self: center;
}

.code-clear:hover { background: var(--red-light); color: var(--red); }
.code-clear svg { width: 14px; height: 14px; }

.code-status {
	text-align: center;
	font-size: 0.72rem;
	font-weight: 600;
	min-height: 1.2rem;
	margin-top: 0.35rem;
}

.code-status.valid { color: #16a34a; }
.code-status.used { color: #d97706; }
.code-status.invalid { color: var(--text-muted); }

.code-input.locked .code-char {
	pointer-events: none;
	opacity: 0.7;
}

.code-input.valid .code-char.filled { border-color: #22c55e; background: #f0fdf4; }
.code-input.used .code-char.filled { border-color: #f59e0b; background: #fffbeb; }

/* Email Suggestions */
.email-suggest {
	display: flex;
	gap: 0.35rem;
	margin-top: 0.35rem;
	flex-wrap: wrap;
}

.email-suggest-item {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	background: var(--bg-white);
	color: var(--text-secondary);
	font-size: 0.75rem;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.15s var(--ease);
	box-shadow: var(--shadow-xs);
}

.email-suggest-item:hover {
	border-color: var(--red);
	background: var(--red-light);
	color: var(--text);
}

.email-suggest-item strong {
	color: var(--red);
}

/* Check Cards */
.check-card {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.75rem 0.85rem;
	margin-bottom: 0.65rem;
	background: var(--bg-white);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.check-card:hover { border-color: var(--border-strong); }
.check-card.checked { border-color: var(--red); background: var(--red-light); }

.check-card input[type="checkbox"] {
	accent-color: var(--red);
	width: 1.15rem;
	height: 1.15rem;
	flex-shrink: 0;
	cursor: pointer;
}

.form-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
}

.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 0; }

/* ═══════════════════════════════════════
   Buttons
   ═══════════════════════════════════════ */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.6rem 1.2rem;
	border: none;
	border-radius: var(--radius-full);
	font-size: 0.82rem;
	font-weight: 650;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.25s var(--ease);
	font-family: inherit;
	line-height: 1.3;
	white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.btn-primary {
	background: var(--red-gradient);
	color: var(--text-inverse);
	box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
	color: var(--text-inverse);
	box-shadow: var(--shadow-glow-lg);
	transform: translateY(-1px);
}

.btn-secondary {
	background: var(--bg-white);
	color: var(--text);
	border: 1px solid var(--border-strong);
	box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
	background: var(--bg-surface);
	color: var(--text);
	border-color: var(--border-strong);
	box-shadow: var(--shadow-sm);
}

.btn-danger {
	background: var(--bg-white);
	color: var(--red);
	border: 1px solid rgba(196, 30, 58, 0.25);
}

.btn-danger:hover {
	background: var(--red-light);
	border-color: rgba(196, 30, 58, 0.4);
}

.btn-ghost {
	background: transparent;
	color: var(--text-secondary);
	padding: 0.5rem 0.75rem;
}

.btn-ghost:hover { background: var(--bg-surface); color: var(--text); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.72rem; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-block { width: 100%; padding: 0.85rem; }

.btn + .btn { margin-left: 0.3rem; }

/* ═══════════════════════════════════════
   Alerts
   ═══════════════════════════════════════ */
.alert {
	padding: 0.8rem 1rem;
	border-radius: var(--radius-lg);
	margin-bottom: 1.25rem;
	font-size: 0.82rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid;
	font-weight: 500;
}

.alert svg { flex-shrink: 0; width: 18px; height: 18px; }
.alert a { font-weight: 700; }
.alert ul { margin: 0; padding-left: 1.25rem; }

.alert-error {
	background: #fff5f5;
	border-color: rgba(196, 30, 58, 0.15);
	color: #9f1239;
}

.alert-success {
	background: #f0fdf4;
	border-color: rgba(34, 197, 94, 0.15);
	color: #166534;
}

.alert-info {
	background: #eff6ff;
	border-color: rgba(59, 130, 246, 0.15);
	color: #1e40af;
}

.alert-warning {
	background: #fffbeb;
	border-color: rgba(245, 158, 11, 0.2);
	color: #92400e;
}

/* ═══════════════════════════════════════
   Tables
   ═══════════════════════════════════════ */
.table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--radius);
	border: 1px solid var(--border);
	background: var(--bg-white);
}

table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td { padding: 0.6rem 0.75rem; text-align: left; }

th {
	font-weight: 700;
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	background: var(--bg-surface);
	border-bottom: 1px solid var(--border);
}

td {
	border-bottom: 1px solid var(--border);
	color: var(--text-secondary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: var(--red-subtle); }
.actions-cell { white-space: nowrap; }

/* ═══════════════════════════════════════
   Badges
   ═══════════════════════════════════════ */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.55rem;
	border-radius: var(--radius-full);
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.badge::before {
	content: '';
	display: inline-block;
	width: 6px; height: 6px;
	border-radius: 50%;
}

.badge-grey { background: #f1f5f9; color: #64748b; }
.badge-grey::before { background: #94a3b8; }

.badge-yellow { background: #fffbeb; color: #b45309; }
.badge-yellow::before { background: #f59e0b; }

.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-green::before { background: #22c55e; }

.badge-red { background: #fff1f2; color: #c41e3a; }
.badge-red::before { background: #c41e3a; }

/* ═══════════════════════════════════════
   Pagination
   ═══════════════════════════════════════ */
.pagination {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin-top: 1.25rem;
	justify-content: center;
}

.pagination a, .pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem; height: 2rem;
	padding: 0 0.45rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	text-decoration: none;
	color: var(--text-secondary);
	font-size: 0.72rem;
	font-weight: 600;
	background: var(--bg-white);
	transition: all 0.2s var(--ease);
}

.pagination a:hover {
	border-color: var(--red);
	color: var(--red);
	background: var(--red-light);
}

.pagination .active span {
	background: var(--red-gradient);
	color: var(--text-inverse);
	border-color: transparent;
	box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════
   Admin Layout
   ═══════════════════════════════════════ */
.admin-container {
	max-width: 800px;
	margin: 0 auto;
	min-width: 0;
}

.admin-container > h1 {
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin-bottom: 1.25rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.admin-container > h1 svg { color: var(--red); }

/* ─── Bottom Nav ─── */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 99;
	anchor-name: --bottom-nav;
	display: flex;
	justify-content: space-around;
	background: var(--bg-glass-solid);
	backdrop-filter: saturate(180%) var(--blur-heavy);
	-webkit-backdrop-filter: saturate(180%) var(--blur-heavy);
	border-top: 1px solid var(--border);
	padding: 0.35rem 0.5rem 0.35rem;
	/* Extend background past safe area */
	padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
	background: var(--bg-white);
}

.bottom-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	padding: 0.3rem 0.5rem;
	border: none;
	background: none;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.6rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: color 0.2s var(--ease);
	border-radius: var(--radius);
	min-width: 0;
}

.bottom-nav-item svg { width: 20px; height: 20px; }

.bottom-nav-item:hover,
.bottom-nav-item.active { color: var(--red); }

.bottom-nav-item.active svg { filter: drop-shadow(0 0 4px var(--red-glow)); }

.bottom-nav-item.nav-disabled { opacity: 0.35; pointer-events: none; }

/* More Drawer */
.more-drawer {
	display: none;
	flex-direction: column;
	gap: 0.25rem;
	position: fixed;
	bottom: anchor(--bottom-nav top);
	left: 0;
	right: 0;
	z-index: 94;
	padding: 0.5rem;
	background: var(--bg-white);
	border-top: 1px solid var(--border);
	border-radius: 0;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.1);
}

.more-drawer-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 0.85rem;
	border-radius: var(--radius);
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.85rem;
	transition: all 0.15s var(--ease);
}

.more-drawer-item svg { width: 18px; height: 18px; }
.more-drawer-item:hover { background: var(--bg-surface); }
.more-drawer-item.active { color: var(--red); background: var(--red-subtle); }

.bottom-nav-item.drawer-open svg {
	transform: rotate(90deg);
}

.bottom-nav-item svg {
	transition: transform 0.25s var(--ease);
}

/* Mobile/Desktop visibility */
.desktop-only { display: none !important; }

/* Sub Nav (e.g. Verlosung / Gewinner) */
.sub-nav {
	position: fixed;
	bottom: anchor(--bottom-nav top);
	left: 0;
	right: 0;
	z-index: 91;
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	padding: 0;
	background: var(--bg-white);
	border-top: 1px solid var(--border);
}

.sub-nav .btn {
	flex: 1 1 auto;
	justify-content: center;
	padding: 0.6rem 0.5rem;
	font-size: 0.72rem;
	border-radius: 0;
	border: none;
	border-right: 1px solid var(--border);
	background: var(--bg-white);
	color: var(--text-muted);
}

.sub-nav .btn:last-child { border-right: none; }

.sub-nav .btn-primary {
	background: var(--bg-white);
	color: var(--red);
	box-shadow: inset 0 -2px 0 var(--red);
}

.sub-nav .btn-secondary:hover {
	background: var(--bg-surface);
}

body:has(.sub-nav) main {
	padding-bottom: 7rem;
}


/* Body padding for bottom nav on mobile */
body:has(.bottom-nav) main {
	padding-bottom: 5.5rem;
}

/* Desktop: inline nav instead of fixed bottom */
@media (min-width: 640px) {
	.bottom-nav {
		position: static;
		justify-content: center;
		gap: 0.15rem;
		margin-bottom: 1.5rem;
		padding: 0.35rem;
		background: var(--bg-glass);
		backdrop-filter: var(--blur);
		border: 1px solid var(--border);
		border-top: 1px solid var(--border);
		border-radius: var(--radius-lg);
		box-shadow: var(--shadow-xs);
	}

	.bottom-nav-item {
		flex-direction: row;
		gap: 0.3rem;
		padding: 0.4rem 0.75rem;
		font-size: 0.72rem;
		border-radius: var(--radius-full);
	}

	.bottom-nav-item svg { width: 15px; height: 15px; }

	.bottom-nav-item.active {
		background: var(--red-gradient);
		color: var(--text-inverse);
		box-shadow: var(--shadow-glow);
	}

	.bottom-nav-item.active svg { filter: none; }

	body:has(.bottom-nav) main { padding-bottom: 0; }

	.desktop-only { display: flex !important; }
	.desktop-only span { display: none; } /* icon only on desktop */
	.mobile-only { display: none !important; }

	/* Desktop drawer: anchored below the Mehr button */
	.more-drawer {
		position: fixed;
		bottom: auto;
		top: anchor(--bottom-nav bottom);
		left: anchor(--more-btn left);
		right: auto;
		width: auto;
		min-width: 200px;
		margin-top: 0.25rem;
		border-top: none;
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
		z-index: 100;
	}

	.sub-nav {
		position: static;
		margin-bottom: 1.25rem;
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		overflow: hidden;
	}

	.sub-nav .btn { padding: 0.55rem 0.75rem; font-size: 0.75rem; }

	body:has(.sub-nav) main { padding-bottom: 0; }
}

/* ─── Stats ─── */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.65rem;
	margin-bottom: 1.25rem;
}

.stats-grid-sm { grid-template-columns: repeat(3, 1fr); }

.stat-card {
	background: var(--bg-glass);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1rem 0.85rem;
	text-align: center;
	transition: all 0.3s var(--ease);
	position: relative;
	overflow: hidden;
	box-shadow: var(--shadow-xs);
}

.stat-card::after {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--red-gradient);
	opacity: 0;
	transition: opacity 0.3s var(--ease);
}

.stat-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.stat-card:hover::after { opacity: 1; }

.stat-card .icon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px; height: 32px;
	background: var(--red-subtle);
	border-radius: 10px;
	margin-bottom: 0.5rem;
	color: var(--red);
}

.stat-card .icon-wrap svg { width: 16px; height: 16px; }

.stat-card .number {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--text);
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.stat-card .label {
	font-size: 0.6rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-top: 0.2rem;
	font-weight: 700;
}

/* ─── Stat Card Link ─── */
a.stat-card-link { text-decoration: none; color: inherit; }
a.stat-card-link:hover { color: inherit; border-color: var(--red); }

/* ─── Status Grid ─── */
.status-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

.status-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.6rem 0.75rem;
	background: var(--bg-surface);
	border-radius: var(--radius);
	font-size: 0.8rem;
}

.status-label {
	display: flex;
	align-items: center;
	gap: 0.3rem;
	color: var(--text-secondary);
	font-weight: 500;
}

.status-label svg { width: 14px; height: 14px; }

.status-value {
	font-weight: 700;
	color: var(--text);
}


/* ─── Setup Banner ─── */
.setup-banner {
	display: block;
	text-decoration: none;
	background: var(--bg-white);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin-bottom: 1.25rem;
	transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.setup-banner:hover {
	border-color: var(--red);
	box-shadow: var(--shadow-sm);
}

.setup-banner-progress {
	height: 3px;
	background: var(--bg-surface);
}

.setup-banner-bar {
	height: 100%;
	background: var(--red-gradient);
	border-radius: 0 2px 2px 0;
	transition: width 0.5s var(--ease);
}

.setup-banner-content {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1.15rem;
}

.setup-banner-main {
	flex: 1;
	min-width: 0;
}

.setup-banner-step {
	display: block;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-muted);
	margin-bottom: 0.15rem;
}

.setup-banner-label {
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.setup-banner-label svg { color: var(--red); }

.setup-banner-desc {
	display: block;
	font-size: 0.75rem;
	color: var(--text-secondary);
	margin-top: 0.2rem;
	line-height: 1.4;
}

.setup-banner-arrow {
	color: var(--text-muted);
	flex-shrink: 0;
	transition: transform 0.2s var(--ease);
}

.setup-banner:hover .setup-banner-arrow { transform: translateX(3px); color: var(--red); }

/* First step: extra prominent */
.setup-banner-first {
	border-color: var(--red);
	box-shadow: var(--shadow-md);
}

.setup-banner-first .setup-banner-content { padding: 1rem 1.25rem; }
.setup-banner-first .setup-banner-label { font-size: 1rem; }
.setup-banner-first .setup-banner-desc { font-size: 0.8rem; }

/* ─── Setup Highlight ─── */
@keyframes setup-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 53, 0); }
	50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
}

.setup-highlight {
	animation: setup-pulse 1.5s ease 2;
	
}

/* ─── Next Action (highlighted CTA) ─── */
.next-action {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem;
	background: var(--red-subtle);
	border: 1px solid rgba(185, 28, 53, 0.12);
	border-radius: var(--radius-lg);
}

.next-action-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--red-gradient);
	color: var(--text-inverse);
	border-radius: 12px;
	flex-shrink: 0;
}

.next-action-icon svg { width: 20px; height: 20px; }

.next-action-body { flex: 1; min-width: 0; }
.next-action-label { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.next-action-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.1rem; }

/* ─── Setup Steps ─── */
.setup-step {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.5rem;
	border-radius: var(--radius);
	transition: opacity 0.2s var(--ease);
	font-size: 0.8rem;
}

.setup-step.done { opacity: 0.45; }
.setup-step.current { opacity: 1; }

.setup-check { flex-shrink: 0; color: var(--text-muted); }
.setup-check svg { width: 16px; height: 16px; }
.setup-step.done .setup-check { color: #22c55e; }

.setup-text { font-weight: 600; color: var(--text); white-space: nowrap; }
.setup-step.done .setup-text { text-decoration: line-through; }

.setup-meta { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); text-align: right; }

/* ─── Quick Actions ─── */
.quick-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.5rem;
}

.quick-actions .btn { justify-content: flex-start; }

/* ─── Toolbar ─── */
.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 1rem;
}

.toolbar input[type="search"],
.toolbar input[type="text"] {
	flex: 1;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-full);
	font-size: 0.78rem;
	font-family: inherit;
	color: var(--text);
	background: var(--bg-white);
	transition: all 0.2s var(--ease);
}

.toolbar input:focus {
	outline: none;
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.08);
}

.toolbar input::placeholder { color: var(--text-muted); }

.toolbar select {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-full);
	font-size: 0.78rem;
	font-family: inherit;
	background: var(--bg-white);
	color: var(--text);
}

.toolbar select:focus { outline: none; border-color: var(--red); }

/* ─── Inline Edit ─── */
.inline-edit { display: inline-block; }
.inline-edit > summary { cursor: pointer; list-style: none; }
.inline-edit > summary::-webkit-details-marker { display: none; }

.inline-edit .edit-form {
	position: absolute;
	right: 0;
	z-index: 10;
	background: var(--bg-white);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
	margin-top: 0.5rem;
	min-width: 300px;
	box-shadow: var(--shadow-lg);
}

.inline-edit .edit-form .form-group { margin-bottom: 0.65rem; }

/* ─── Address Details ─── */
.address-detail { display: inline; }

.address-detail summary {
	cursor: pointer;
	color: var(--red);
	font-size: 0.72rem;
	font-weight: 600;
}

.address-detail summary:hover { color: var(--red-dark); }

.address-block {
	margin-top: 0.35rem;
	padding: 0.5rem 0.65rem;
	background: var(--bg-surface);
	border-radius: var(--radius);
	font-size: 0.72rem;
	line-height: 1.5;
	color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   Toggle Switch
   ═══════════════════════════════════════ */
.toggle-group {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	cursor: pointer;
}

.toggle-track {
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: var(--border-strong);
	position: relative;
	transition: background 0.25s var(--ease);
	flex-shrink: 0;
}

.toggle-track.on { background: var(--red); }

.toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--bg-white);
	box-shadow: var(--shadow-sm);
	transition: transform 0.25s var(--ease);
}

.toggle-track.on .toggle-thumb { transform: translateX(20px); }

.toggle-label {
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   Pill Toggle Group
   ═══════════════════════════════════════ */
.pill-group {
	display: flex;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	padding: 0.2rem;
	gap: 0.15rem;
}

.pill {
	padding: 0.3rem 0.7rem;
	border: none;
	border-radius: var(--radius-full);
	font-size: 0.72rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	background: transparent;
	color: var(--text-muted);
	transition: all 0.2s var(--ease);
	white-space: nowrap;
}

.pill:hover { color: var(--text); text-decoration: none; }
a.pill { text-decoration: none; color: inherit; }

.pill.active {
	background: var(--bg-white);
	color: var(--text);
	box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════
   Placeholder Cards
   ═══════════════════════════════════════ */
.placeholder-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

.placeholder-card {
	padding: 0.75rem;
	background: var(--bg-white);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s var(--ease);
}

.placeholder-card:hover {
	border-color: var(--red);
	background: var(--red-light);
}

.placeholder-card.copied {
	border-color: #22c55e;
	background: #f0fdf4;
}

.placeholder-card code {
	font-size: 0.82rem;
	font-weight: 700;
	background: var(--bg-surface);
}

.placeholder-card.copied code {
	background: #dcfce7;
}

.placeholder-desc {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text);
	margin-top: 0.3rem;
}

.placeholder-example {
	font-size: 0.68rem;
	color: var(--text-muted);
	margin-top: 0.1rem;
}

.placeholder-example em {
	font-style: normal;
	color: var(--text-secondary);
}

.placeholder-source {
	font-size: 0.62rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

@media (max-width: 480px) {
	.placeholder-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   File Drop Zone
   ═══════════════════════════════════════ */
.file-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 1.5rem 1rem;
	border: 2px dashed var(--border-strong);
	border-radius: var(--radius-lg);
	background: var(--bg-surface);
	cursor: pointer;
	transition: all 0.2s var(--ease);
	text-align: center;
}

.file-drop:hover, .file-drop.drag-over {
	border-color: var(--red);
	background: var(--red-light);
}

.file-drop.has-file {
	border-color: #22c55e;
	border-style: solid;
	background: #f0fdf4;
}

.file-drop-icon { color: var(--text-muted); }
.file-drop.has-file .file-drop-icon { color: #22c55e; }

.file-drop-text { font-size: 0.82rem; color: var(--text-secondary); }
.file-drop-hint { font-size: 0.68rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   Card Select (radio as cards)
   ═══════════════════════════════════════ */
.card-select {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

.card-select-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	padding: 1rem 0.75rem;
	background: var(--bg-white);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all 0.2s var(--ease);
	text-align: center;
}

.card-select-option:hover {
	border-color: var(--border-strong);
	background: var(--bg-surface);
}

.card-select-option.selected {
	border-color: var(--red);
	background: var(--red-light);
	box-shadow: 0 0 0 1px var(--red);
}

.card-select-icon {
	color: var(--text-muted);
	transition: color 0.2s var(--ease);
}

.card-select-option.selected .card-select-icon { color: var(--red); }

.card-select-label {
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--text);
}

.card-select-desc {
	font-size: 0.7rem;
	color: var(--text-muted);
}

/* ═══════════════════════════════════════
   Prize Cards (public)
   ═══════════════════════════════════════ */
.prize-card {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.2s var(--ease);
}

.prize-card:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow-xs);
}

.prize-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: var(--red-subtle);
	border-radius: 10px;
	color: var(--red);
	flex-shrink: 0;
}

.prize-card-icon svg { width: 18px; height: 18px; }

.prize-card-body { flex: 1; min-width: 0; }

.prize-card-title {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--text);
}

.prize-card-desc {
	font-size: 0.78rem;
	color: var(--text-secondary);
	margin-top: 0.2rem;
	line-height: 1.5;
}

.prize-card-qty {
	font-size: 0.9rem;
	font-weight: 800;
	color: var(--red);
	flex-shrink: 0;
	padding: 0.25rem 0.6rem;
	background: var(--red-subtle);
	border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════
   Code List (QR per row)
   ═══════════════════════════════════════ */
.code-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.code-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.65rem 0.75rem;
	background: var(--bg-white);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: all 0.2s var(--ease);
}

.code-row:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow-xs);
	cursor: pointer;
}

.code-row.selected {
	border-color: var(--red);
	background: var(--red-light);
	box-shadow: 0 0 0 1px var(--red);
}

.code-check { flex-shrink: 0; display: flex; cursor: pointer; }
.code-check input { accent-color: var(--red); width: 1rem; height: 1rem; cursor: pointer; }

.code-qr { flex-shrink: 0; line-height: 0; }
.code-qr svg { width: 44px; height: 44px; border-radius: 6px; }

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

.code-name code {
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.code-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.15rem;
}

.code-date {
	font-size: 0.65rem;
	color: var(--text-muted);
}

.code-actions {
	flex-shrink: 0;
	display: flex;
	gap: 0.15rem;
}

/* ═══════════════════════════════════════
   QR Grid
   ═══════════════════════════════════════ */
.qr-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.75rem;
}

.qr-item {
	text-align: center;
	padding: 1rem 0.65rem;
	background: var(--bg-white);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-xs);
	transition: all 0.3s var(--ease);
}

.qr-item:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.qr-item svg { width: 110px; height: 110px; }

.qr-item .code-label {
	margin-top: 0.5rem;
	font-family: 'SF Mono', 'JetBrains Mono', monospace;
	font-size: 0.68rem;
	font-weight: 700;
	color: var(--text-secondary);
	letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════
   Section Divider
   ═══════════════════════════════════════ */
.section-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	margin: 1.5rem 0 0.75rem;
}

.section-label::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}

/* ═══════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════ */
.toast-container {
	position: fixed;
	bottom: calc(70px + env(safe-area-inset-bottom));
	left: 50%;
	transform: translateX(-50%);
	z-index: 300;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	pointer-events: none;
}

.toast {
	padding: 0.6rem 1.1rem;
	border-radius: var(--radius-full);
	font-size: 0.78rem;
	font-weight: 600;
	box-shadow: var(--shadow-lg);
	pointer-events: auto;
	white-space: nowrap;
	max-width: 90vw;
	overflow: hidden;
	text-overflow: ellipsis;
}

.toast-success { background: #166534; color: #fff; }
.toast-error { background: #991b1b; color: #fff; }
.toast-info { background: var(--text); color: #fff; }

@media (min-width: 640px) {
	.toast-container { bottom: 2rem; }
}

/* ═══════════════════════════════════════
   Responsive — Mobile First
   ═══════════════════════════════════════ */
@media (min-width: 640px) {
	.container { padding: 0 1.5rem; }
	main { padding: 2rem 0 4rem; }
	.card { padding: 1.75rem; }
	.card h1 { font-size: 1.6rem; }
	.stats-grid { grid-template-columns: repeat(4, 1fr); }
	.stat-card { padding: 1.25rem; }
	.stat-card .number { font-size: 1.85rem; }
	.admin-container > h1 { font-size: 1.6rem; }
	.qr-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
	.qr-item svg { width: 130px; height: 130px; }
}

@media (min-width: 960px) {
	.qr-item svg { width: 140px; height: 140px; }
	.dashboard-tables { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════
   Print
   ═══════════════════════════════════════ */
@media print {
	body { background: white; }
	body::before, body::after { display: none; }

	.page-header, .page-footer, .admin-nav, .toolbar, .no-print { display: none !important; }

	.card, .stat-card, .qr-item, .table-wrap {
		background: white;
		border: 1px solid #ddd;
		box-shadow: none;
		backdrop-filter: none;
	}

	.qr-grid { grid-template-columns: repeat(3, 1fr); }
	.qr-item { page-break-inside: avoid; }
}

/* ═══════════════════════════════════════
   Standalone App Mode
   ═══════════════════════════════════════ */
@media (display-mode: standalone) {
	body {
		padding-top: env(safe-area-inset-top);
	}

	.page-header {
		padding-top: calc(0.25rem + calc(env(safe-area-inset-top) / 3));
	}

	.bottom-nav::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		height: calc(env(safe-area-inset-bottom, 0px) / 2);
		background: var(--bg-white);
		transform: translateY(100%);
	}

}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
