:root {
	--bg: #0e0e10;
	--panel: #141518;
	--card: #1a1c1f;
	--card-hi: #1e2126;
	--line: #2c3036;
	--text: #e8eaed;
	--muted: #9aa0a6;
	--accent: #8b5cf6;
	--accent-soft: rgba(139, 92, 246, 0.16);
	--ok: #6dd58c;
	--warn: #f0c674;
	--err: #f08a8a;
	--radius: 14px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	-webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }

/* --- Каркас --- */

.layout {
	display: flex;
	min-height: 100vh;
}

.sidebar {
	width: 232px;
	flex: 0 0 232px;
	background: var(--panel);
	border-right: 1px solid var(--line);
	padding: 18px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: sticky;
	top: 0;
	height: 100vh;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.brand-mark {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: linear-gradient(140deg, var(--accent), #5b8cf6);
	display: grid;
	place-items: center;
	font-size: 14px;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 12px;
	border-radius: 10px;
	color: var(--muted);
	font-size: 14px;
	transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover { background: #1c1e22; color: var(--text); }

.nav-item.active {
	background: var(--accent-soft);
	color: #d6c7ff;
	font-weight: 600;
}

.nav-icon { width: 18px; text-align: center; opacity: 0.9; }

.sidebar-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-top: 1px solid var(--line);
}

.avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #2a2d33;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 600;
}

.content {
	flex: 1;
	padding: 26px 30px 90px;
	max-width: 1180px;
}

/* --- Типографика --- */

.section-title {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 26px 0 12px;
}

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: 0.01em; }

.muted { color: var(--muted); font-size: 13px; }

/* --- Карточки --- */

.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
}

.hero {
	background:
		radial-gradient(120% 160% at 82% 0%, rgba(139, 92, 246, 0.28), transparent 60%),
		var(--card-hi);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 26px;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 14px;
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* --- Кнопки --- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #212429;
	color: var(--text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}

.btn:hover { background: #272b31; }

.btn-primary {
	background: #ffffff;
	color: #111214;
	border-color: #ffffff;
}

.btn-primary:hover { background: #e9e9ec; }

.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Бейджи --- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: #23262b;
	border: 1px solid var(--line);
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.badge-accent { background: var(--accent-soft); border-color: transparent; color: #cbb6ff; }
.badge-ok { background: rgba(109, 213, 140, 0.14); border-color: transparent; color: var(--ok); }
.badge-warn { background: rgba(240, 198, 116, 0.14); border-color: transparent; color: var(--warn); }
.badge-err { background: rgba(240, 138, 138, 0.14); border-color: transparent; color: var(--err); }

/* --- Формы --- */

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="url"],
textarea,
select {
	width: 100%;
	padding: 12px 13px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #131518;
	color: var(--text);
	font-size: 16px; /* 16px — iPhone не зумит при фокусе */
	font-family: inherit;
}

input:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--accent);
}

.field { margin-bottom: 14px; }

input[type="file"] {
	width: 100%;
	padding: 11px 12px;
	border-radius: 10px;
	border: 1px dashed var(--line);
	background: #131518;
	color: var(--muted);
	font-size: 14px;
	font-family: inherit;
}

input[type="file"]::file-selector-button {
	margin-right: 10px;
	padding: 7px 12px;
	border-radius: 8px;
	border: 1px solid var(--line);
	background: #22252a;
	color: var(--text);
	font-family: inherit;
	font-size: 13px;
}

.field-error {
	margin-top: 6px;
	font-size: 13px;
	color: var(--err);
}

.field:has(.field-error) input {
	border-color: var(--err);
}

/* Два поля в ряд: тайминги начала и конца. */
.row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* --- Сообщения --- */

.notice {
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13px;
	border: 1px solid transparent;
	margin-bottom: 14px;
}

.notice-warn { background: #2a2313; border-color: #6a5320; color: #f0d69a; }
.notice-err { background: #2b1717; border-color: #6a2424; color: #f3b0b0; }
.notice-ok { background: #16261b; border-color: #27512f; color: #a9e6bd; }

/* --- Страница входа --- */

.login-wrap {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 20px;
}

.login-card { width: 100%; max-width: 380px; }

/* --- Телефон --- */

.mobile-only { display: none; }

@media (max-width: 820px) {
	.layout { flex-direction: column; }

	.sidebar { display: none; }

	.content { padding: 16px 14px 92px; }

	.mobile-only { display: flex; }

	.topbar {
		align-items: center;
		justify-content: space-between;
		padding: 12px 14px;
		border-bottom: 1px solid var(--line);
		background: var(--panel);
		position: sticky;
		top: 0;
		z-index: 20;
	}

	.tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 20;
		background: var(--panel);
		border-top: 1px solid var(--line);
		padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
		justify-content: space-around;
	}

	.tabbar .nav-item {
		flex-direction: column;
		gap: 4px;
		font-size: 11px;
		padding: 6px 10px;
		flex: 1;
		justify-content: center;
		text-align: center;
	}

	h1 { font-size: 21px; }

	.hero { padding: 18px; }

	.btn { padding: 13px 18px; } /* крупнее для пальца */
}
