.bibi-dash {
	--bibi-bg: #eef0f3;
	--bibi-card: #ffffff;
	--bibi-ink: #1e2a4a;
	--bibi-muted: #6b7280;
	--bibi-teal: #14b8a6;
	--bibi-amber: #f59e0b;
	--bibi-pink: #ec4899;
	--bibi-radius: 20px;
	background: var(--bibi-bg);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--bibi-ink);
	box-sizing: border-box;
	/* Break out of the theme's boxed content container (~960-1140px) so the
	   dashboard can use the real width of the screen. */
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	padding: 40px 0 60px;
}
.bibi-dash * { box-sizing: border-box; }

.bibi-dash-inner {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 32px;
}

.bibi-dash-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}
.bibi-dash-header h1 {
	font-size: 34px;
	font-weight: 800;
	margin: 0 0 6px;
	color: var(--bibi-ink);
}
.bibi-subtitle { margin: 0; color: var(--bibi-muted); font-size: 15px; }

.bibi-dash-header-right { display: flex; align-items: center; gap: 10px; }
.bibi-live-dot {
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--bibi-teal);
	box-shadow: 0 0 0 0 rgba(20,184,166,.6);
	animation: bibi-pulse 2s infinite;
}
@keyframes bibi-pulse {
	0% { box-shadow: 0 0 0 0 rgba(20,184,166,.55); }
	70% { box-shadow: 0 0 0 8px rgba(20,184,166,0); }
	100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}
.bibi-last-updated { font-size: 13px; color: var(--bibi-muted); }
.bibi-logout { font-size: 13px; color: var(--bibi-muted); text-decoration: underline; margin-left: auto; }

.bibi-status-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.bibi-period { position: relative; }
.bibi-period-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bibi-card);
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 9px 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--bibi-ink);
	cursor: pointer;
}
.bibi-period-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.bibi-period-btn:hover { border-color: #d1d5db; }

.bibi-period-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	background: #1e2a4a;
	border-radius: 10px;
	padding: 6px;
	min-width: 200px;
	box-shadow: 0 10px 30px rgba(16,24,40,.25);
	z-index: 20;
}
.bibi-period-option {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	color: #e5e7eb;
	font-size: 14px;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
}
.bibi-period-option:hover,
.bibi-period-option.is-active { background: rgba(255,255,255,.1); color: #fff; }

.bibi-period-custom {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
	background: var(--bibi-card);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 16px;
}
.bibi-period-custom label { font-size: 13px; color: var(--bibi-muted); display: flex; flex-direction: column; gap: 4px; }
.bibi-period-custom input[type="date"] {
	padding: 8px 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
}
.bibi-btn-sm { width: auto; padding: 9px 18px; font-size: 14px; margin-top: 0; }

.bibi-alert {
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 14px;
	margin-bottom: 20px;
}
.bibi-alert-warning { background: #fff7ed; color: #9a5b13; border: 1px solid #fde3c4; }
.bibi-alert-error { background: #fef2f2; color: #b32d2e; border: 1px solid #fbd5d5; }

.bibi-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.bibi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.bibi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.bibi-grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 980px) {
	.bibi-grid-3, .bibi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
	.bibi-grid-3, .bibi-grid-4, .bibi-grid-2 { grid-template-columns: 1fr; }
	.bibi-dash-header { flex-direction: column; }
}

.bibi-card {
	background: var(--bibi-card);
	border-radius: var(--bibi-radius);
	padding: 22px 24px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	transition: box-shadow .2s ease;
	display: flex;
	flex-direction: column;
}
.bibi-card-top { margin-bottom: 10px; flex-shrink: 0; }

.bibi-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 10px;
}
.bibi-icon svg { width: 17px; height: 17px; }
.bibi-icon-sm { width: 32px; height: 32px; margin-bottom: 10px; }
.bibi-icon-teal { background: #0f172a; color: #fff; }
.bibi-icon-mint { background: #0f172a; color: #fff; }
.bibi-icon-amber { background: #0f172a; color: #fff; }
.bibi-icon-slate { background: #fff; color: var(--bibi-ink); border: 1px solid #e5e7eb; }

.bibi-card-label { font-size: 14px; color: var(--bibi-muted); margin: 0 0 4px; white-space: nowrap; }
.bibi-card-value { font-size: 30px; font-weight: 800; margin: 0 0 10px; color: var(--bibi-ink); line-height: 1.15; }

.bibi-card-body-split {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
}
.bibi-card-body-split > div:first-child { flex: 1; min-width: 0; }

.bibi-legend { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--bibi-ink); }
.bibi-legend li { margin-bottom: 6px; line-height: 1.3; }
.bibi-legend li:last-child { margin-bottom: 0; }
.bibi-legend-count { color: var(--bibi-muted); margin-left: 16px; }
.bibi-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.bibi-donut-wrap { flex-shrink: 0; }
.bibi-donut {
	width: 112px; height: 112px; border-radius: 50%;
	position: relative;
	transition: background 0.4s ease;
}
.bibi-donut::after {
	content: '';
	position: absolute; inset: 22px;
	background: var(--bibi-card);
	border-radius: 50%;
}

.bibi-card-stat { text-align: left; }

.bibi-demo-badge {
	text-align: center;
	color: var(--bibi-muted);
	font-size: 13px;
	margin-top: 8px;
}

.bibi-dash-center { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.bibi-login-card {
	background: var(--bibi-card);
	border-radius: var(--bibi-radius);
	padding: 40px;
	max-width: 380px;
	width: 100%;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	text-align: center;
}
.bibi-login-card h1 { font-size: 22px; margin: 0 0 6px; }
.bibi-login-card form { text-align: left; margin-top: 20px; }
.bibi-login-card label { display: block; font-size: 13px; color: var(--bibi-muted); margin-bottom: 4px; }
.bibi-login-card input[type="text"],
.bibi-login-card input[type="password"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-bottom: 14px;
	font-size: 14px;
}
.bibi-remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bibi-muted); }
.bibi-remember label { display: flex; align-items: center; gap: 6px; }

.bibi-btn {
	width: 100%;
	background: var(--bibi-ink);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 12px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	margin-top: 6px;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}
.bibi-btn:hover { background: #111827; color: #fff; }

.bibi-dash.bibi-updating .bibi-card-value { opacity: .55; transition: opacity .2s ease; }
