/* Admin panel styles, in the colors of globalproxy.store. */
:root {
	--bg-dark: #0d0d0d;
	--bg-card: #1a1a1a;
	--bg-elevated: #242424;
	--accent: #f59e0b;
	--accent-light: #fbbf24;
	--accent-dark: #d97706;
	--text-primary: #fafafa;
	--text-secondary: #a3a3a3;
	--text-muted: #737373;
	--border: #2e2e2e;
	--success: #22c55e;
	--danger: #ef4444;
	--radius: 14px;
}

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

body {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	background: var(--bg-dark);
	color: var(--text-primary);
	line-height: 1.55;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

/* Top bar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(13, 13, 13, 0.9);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border);
}
.topbar-inner {
	max-width: 1440px;
	margin: 0 auto;
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	gap: 1.25rem;
}
.brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	color: var(--text-primary);
	white-space: nowrap;
}
.brand-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}
.brand small { color: var(--text-muted); font-weight: 500; }
.nav-links {
	display: flex;
	gap: 0.25rem;
	overflow-x: auto;
	scrollbar-width: none;
	flex: 1;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
	color: var(--text-secondary);
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-links a.active { color: #111; background: var(--accent); }
.logout { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.logout:hover { color: var(--danger); }

/* Page */
.page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem 4rem;
}
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { color: var(--text-secondary); margin-top: 0.25rem; }

.grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	align-items: start;
}
.stack > * + * { margin-top: 1rem; }

.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
}
.card h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.card .hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.card-danger { border-color: rgba(239, 68, 68, 0.35); }

/* Forms */
form.form { display: grid; gap: 0.75rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.inline-form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
	width: 100%;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text-primary);
	font: inherit;
	padding: 0.65rem 0.8rem;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, textarea:focus, select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.choices { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.choice {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 0.8rem;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-elevated);
	cursor: pointer;
	font-size: 0.9rem;
}
.choice input { accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); color: var(--accent-light); }

.btn, button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	background: var(--accent);
	color: #111;
	border: 0;
	border-radius: 10px;
	padding: 0.65rem 1.1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, transform 0.05s;
	white-space: nowrap;
}
.btn:hover, button:hover { background: var(--accent-light); color: #111; }
.btn:active, button:active { transform: translateY(1px); }
.btn-ghost { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { background: #2c2c2c; color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #f87171; color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

/* Messages */
.alert {
	border-radius: 10px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border: 1px solid;
	font-size: 0.95rem;
}
.alert-success { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.alert-info { background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.3); color: var(--accent-light); }
.alert-error { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }

/* Stats */
.stats {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	margin-bottom: 1rem;
}
.stat .label { color: var(--text-secondary); font-size: 0.85rem; }
.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.2; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--text-muted); font-size: 0.85rem; }
.stat.accent .value { color: var(--accent); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
	text-align: left;
	color: var(--text-muted);
	font-weight: 500;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}
td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--text-muted); text-align: center; padding: 1.5rem; }

.badge {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: var(--bg-elevated);
	color: var(--text-secondary);
	border: 1px solid var(--border);
}
.badge-accent { color: var(--accent-light); border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.muted { color: var(--text-muted); }

/* Key-value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.92rem; }
.kv dt { color: var(--text-muted); }
.kv dd { word-break: break-all; }

/* Bar chart (visitors per day) */
.bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 180px;
	padding-top: 1.25rem;
}
.bar {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
	min-width: 0;
}
.bar-fill {
	width: 100%;
	max-width: 36px;
	background: var(--accent);
	border-radius: 6px 6px 2px 2px;
	min-height: 2px;
	position: relative;
}
.bar-fill span {
	position: absolute;
	top: -1.25rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.75rem;
	color: var(--text-secondary);
	font-variant-numeric: tabular-nums;
}
.bar-day { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.4rem; white-space: nowrap; }

/* Share lists (countries, devices...) */
.shares { list-style: none; display: grid; gap: 0.55rem; }
.shares li { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.75rem; font-size: 0.92rem; }
.shares .track { grid-column: 1 / -1; height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.shares .track i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.shares .count { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; color: var(--text-secondary); }

/* Login pages */
.auth {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: radial-gradient(ellipse at top, rgba(245, 158, 11, 0.12), transparent 60%), var(--bg-dark);
}
.auth .card { width: 100%; max-width: 380px; padding: 2rem; }
.auth .brand { justify-content: center; margin-bottom: 1.25rem; font-size: 1.1rem; }
.auth h1 { font-size: 1.35rem; text-align: center; margin-bottom: 0.25rem; }
.auth p.lead { text-align: center; color: var(--text-secondary); margin-bottom: 1.25rem; font-size: 0.92rem; }
.auth button { width: 100%; }
.auth .code-input { text-align: center; font-size: 1.6rem; letter-spacing: 0.4em; font-variant-numeric: tabular-nums; }
.auth .below { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

@media (max-width: 640px) {
	.page { padding-top: 1.25rem; }
	.page-head h1 { font-size: 1.4rem; }
	.brand small { display: none; }
	.stat .value { font-size: 1.6rem; }
	.bars { gap: 3px; }
	.bar-fill span { display: none; }
}
