/* Administrace – vzhled podle Android aplikace (Material 3, oranžová). */
:root {
	--bg: #fbf8f5;
	--surface: #ece6e1;          /* karty */
	--surface-high: #f3eeea;     /* spodní lišta, menu */
	--indicator: #e2dbd5;        /* aktivní položka navigace */
	--text: #1f1b18;
	--muted: #5e5450;
	--outline: #8a7e78;
	--outline-soft: #d6ccc6;
	--primary: #ff6d00;
	--primary-hover: #f26500;
	--on-primary: #1f1200;
	--primary-text: #e25c00;     /* oranžový text na světlém */
	--primary-container: #ffdcc8;
	--on-primary-container: #331200;
	--error: #c4231b;
	--error-container: #f8d9d5;
	--warn: #8a5300;
	--warn-container: #ffe3b5;
	--ok: #1d6b3a;
	--ok-container: #d4ecd9;
	--radius: 22px;
	--nav-h: 80px;
	--appbar-h: 64px;
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary-text); }
img { max-width: 100%; }
.i { width: 24px; height: 24px; fill: currentColor; flex: none; display: inline-block; vertical-align: middle; }
.i-sm { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- kostra ---------- */
.shell { min-height: 100vh; }
.main { padding: 0 16px calc(var(--nav-h) + 96px); max-width: 1120px; margin: 0 auto; }
.main--narrow { max-width: 640px; }

.appbar {
	position: sticky; top: 0; z-index: 20;
	display: flex; align-items: center; gap: 4px;
	min-height: var(--appbar-h);
	margin: 0 -16px; padding: 8px 8px 8px 16px;
	background: var(--bg);
}
.appbar.has-back { padding-left: 4px; }
.appbar h1 {
	flex: 1; min-width: 0; margin: 0 0 0 4px;
	font-size: 22px; font-weight: 400; line-height: 1.25;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar .actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 48px; height: 48px; border-radius: 50%;
	border: 0; background: none; color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:hover, .icon-btn:focus-visible { background: rgba(31, 27, 24, .08); }

/* spodní navigace (mobil) / boční lišta (počítač) */
.nav {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
	display: flex; justify-content: space-around;
	height: var(--nav-h); padding: 12px 4px calc(12px + env(safe-area-inset-bottom));
	background: var(--surface-high);
}
.nav-item, .nav form button {
	flex: 1; max-width: 120px;
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	border: 0; background: none; padding: 0; cursor: pointer;
	color: var(--muted); font-family: inherit; font-size: 12px; line-height: 16px; font-weight: 500; text-decoration: none; letter-spacing: .02em;
}
.nav form { flex: 1; max-width: 120px; display: flex; margin: 0; }
.nav form button { max-width: none; }
.nav-item .pill, .nav form button .pill {
	display: grid; place-items: center; width: 64px; height: 32px; border-radius: 16px;
	transition: background-color .15s;
}
.nav-item:hover .pill, .nav form button:hover .pill { background: rgba(31, 27, 24, .06); }
.nav-item.is-active { color: var(--text); font-weight: 700; }
.nav-item.is-active .pill { background: var(--indicator); }
.nav details { flex: 1; max-width: 120px; position: relative; display: flex; }
.nav details > summary { list-style: none; flex: 1; max-width: none; }
.nav details > summary::-webkit-details-marker { display: none; }
.nav details .menu { bottom: calc(100% + 8px); top: auto; right: 4px; }

@media (min-width: 900px) {
	.nav {
		top: 0; right: auto; width: 96px; height: auto;
		flex-direction: column; justify-content: flex-start; gap: 12px;
		padding: 16px 0;
	}
	.nav a.brand { display: block; }
	.nav-item, .nav form, .nav details { flex: none; max-width: none; }
	.nav details .menu { bottom: auto; top: 0; left: calc(100% + 8px); right: auto; }
	.shell { padding-left: 96px; }
	.main { padding-bottom: 96px; }
	.appbar { margin: 0 -16px; padding-top: 12px; }
}
.nav .brand { display: none; margin: 4px auto 12px; width: 40px; height: 50px; }
.nav .brand img { width: 100%; height: 100%; display: block; }

/* přihlášení */
.login { max-width: 420px; margin: 0 auto; padding: 40px 0 24px; }
.login-logo { display: block; width: min(320px, 80%); margin: 0 auto 32px; }
.login-logo img { width: 100%; height: auto; display: block; }
.login-form { background: var(--surface); border-radius: 28px; padding: 24px 20px 28px; }
.login-form h1 { margin: 0 0 8px; font-size: 24px; font-weight: 500; text-align: center; }
.login-form .field label { background: var(--surface); }

/* rozbalovací menu (details) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.menu {
	position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
	min-width: 220px; padding: 8px 0; margin: 0;
	background: var(--surface-high); border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12);
}
.menu a, .menu button {
	display: flex; align-items: center; gap: 12px; width: 100%;
	padding: 12px 16px; border: 0; background: none; cursor: pointer;
	color: var(--text); font: inherit; text-align: left; text-decoration: none; white-space: nowrap;
}
.menu a:hover, .menu button:hover { background: rgba(31, 27, 24, .08); }
.menu .is-current { font-weight: 700; color: var(--primary-text); }
.menu .danger { color: var(--error); }
.menu hr { border: 0; border-top: 1px solid var(--outline-soft); margin: 8px 0; }
.menu .menu-label { padding: 8px 16px 4px; font-size: 12px; color: var(--muted); }

/* ---------- tlačítka ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px; border-radius: 999px;
	border: 1px solid transparent; cursor: pointer;
	font-family: inherit; font-size: 16px; line-height: 1.2; font-weight: 600; letter-spacing: .01em; text-decoration: none; text-align: center;
}
.btn-filled { background: var(--primary); color: var(--on-primary); }
.btn-filled:hover { background: var(--primary-hover); }
.btn-filled:disabled { background: rgba(31, 27, 24, .12); color: rgba(31, 27, 24, .38); cursor: default; }
.btn-outlined { background: none; border-color: var(--outline); color: var(--primary-text); }
.btn-outlined:hover { background: rgba(255, 109, 0, .08); }
.btn-tonal { background: var(--surface); color: var(--text); }
.btn-tonal:hover { background: var(--indicator); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; margin: 16px 0; }
.btn-row .btn { padding: 0 12px; }

.fab {
	position: fixed; z-index: 25; right: 16px; bottom: calc(var(--nav-h) + 16px);
	display: inline-flex; align-items: center; gap: 12px;
	height: 56px; padding: 0 20px 0 16px; border-radius: 16px;
	background: var(--primary-container); color: var(--on-primary-container);
	font-family: inherit; font-size: 16px; line-height: 1; font-weight: 600; text-decoration: none;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12);
}
.fab:hover { box-shadow: 0 6px 14px rgba(0, 0, 0, .22); }
@media (min-width: 900px) { .fab { bottom: 24px; right: max(24px, calc((100vw - 96px - 1120px) / 2 + 24px)); } }

/* ---------- karty ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.card > h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }

.chip {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 4px 12px; border-radius: 8px;
	font-size: 14px; font-weight: 600; letter-spacing: .02em; line-height: 1.35;
}
.chip-error { background: var(--error-container); color: var(--error); }
.chip-warn { background: var(--warn-container); color: var(--warn); }
.chip-ok { background: var(--ok-container); color: var(--ok); }
.chip-neutral { background: var(--indicator); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- vyhledávání a řazení ---------- */
.searchbar {
	display: flex; align-items: center; gap: 4px;
	height: 56px; margin: 4px 0 16px; padding: 0 4px 0 16px;
	background: var(--surface); border-radius: 28px;
}
.searchbar input {
	flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none;
	font: inherit; color: var(--text);
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.list-meta { margin: -6px 4px 12px; font-size: 14px; color: var(--muted); }

/* ---------- přehled vozů ---------- */
.car-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .car-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.car-card {
	display: flex; gap: 16px; align-items: center;
	padding: 16px; border-radius: var(--radius); background: var(--surface);
	color: inherit; text-decoration: none; transition: background-color .15s;
}
.car-card:hover, .car-card:focus-visible { background: var(--indicator); }
.car-card .thumb {
	flex: none; width: 128px; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden;
	background: var(--indicator); display: grid; place-items: center; color: var(--outline);
}
.car-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-card .thumb .i { width: 40px; height: 40px; }
.car-card .body { min-width: 0; flex: 1; }
.car-card h2 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.car-card .owner { margin: 4px 0 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-card .vin { margin: 2px 0 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .car-card .thumb { width: 104px; } .car-card { gap: 12px; padding: 12px; } }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .i { width: 56px; height: 56px; color: var(--outline-soft); }

/* ---------- detail vozu ---------- */
.detail-vin { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo { position: relative; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; background: var(--surface); display: grid; place-items: center; color: var(--outline); }
.photo > a:first-child { display: block; width: 100%; height: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .i { width: 48px; height: 48px; }
.photo .change {
	position: absolute; right: 8px; bottom: 8px;
	padding: 4px 10px; border-radius: 8px;
	background: rgba(20, 18, 16, .62); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
}
.photo .change:hover { background: rgba(20, 18, 16, .8); }
.detail-actions { margin: 16px 0; }
.detail-cols { display: grid; gap: 0 16px; }
@media (min-width: 900px) {
	.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-areas: "photos actions" "photos terms" "info terms"; gap: 0 24px; align-items: start; }
	.detail-grid > .photos { grid-area: photos; margin-bottom: 16px; }
	.detail-grid > .detail-actions { grid-area: actions; margin-top: 0; }
	.detail-grid > .terms-card { grid-area: terms; }
	.detail-grid > .info-card { grid-area: info; }
	.detail-cols { grid-template-columns: 1fr 1fr; align-items: start; }
}

.rows { margin: 0; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid var(--outline-soft); }
.rows > div:first-child { border-top: 0; padding-top: 4px; }
.rows dt { color: var(--text); }
.rows dd { margin: 0; text-align: right; color: var(--muted); overflow-wrap: anywhere; }
.rows dd strong { color: var(--text); font-weight: 700; }
.rows .status { display: block; font-size: 14px; font-weight: 600; }
.status-error { color: var(--error); }
.status-warn { color: var(--warn); }
.status-ok { color: var(--ok); }
.terms > div { border-top: 0; padding: 8px 0; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--warn-container); color: var(--warn); margin: 0 0 16px; font-weight: 600; }

/* obrazovka „Upravit“ uvnitř detailu: zobrazí se přes #upravit (tužka) nebo po chybě formuláře */
#upravit { display: none; }
#upravit:target, #upravit.is-open { display: block; }
#upravit:target ~ #detail, #upravit.is-open ~ #detail { display: none; }

/* ---------- formuláře ---------- */
.form { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid > .span-2 { grid-column: 1 / -1; }
.field { position: relative; margin: 12px 0 4px; }
.field input, .field select, .field textarea {
	display: block; width: 100%; min-height: 56px;
	padding: 16px; border: 1px solid var(--outline); border-radius: 6px;
	background: transparent; color: var(--text); font: inherit; font-size: 17px;
	-webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field input:disabled { color: var(--muted); border-color: var(--outline-soft); }
.field label {
	position: absolute; left: 12px; top: 16px; padding: 0 4px;
	color: var(--muted); font-size: 17px; line-height: 24px; pointer-events: none;
	background: var(--bg); transition: top .12s, font-size .12s, color .12s;
	max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* popisek na rámečku: vyplněné pole, fokus, datum, výběr */
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label,
.field.is-fixed label { top: -10px; font-size: 13px; line-height: 20px; }
.field input:focus + label, .field textarea:focus + label, .field select:focus + label { color: var(--primary-text); }
.field .help { margin: 4px 16px 0; font-size: 13px; color: var(--muted); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); }
.field.has-error label, .field .error { color: var(--error); }
.field .error { margin: 4px 16px 0; font-size: 13px; font-weight: 600; }
.form-errors { list-style: none; margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--error-container); color: var(--error); font-weight: 600; }
.form .btn-filled { margin-top: 20px; }
@media (max-width: 359px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- oznámení (flash) ---------- */
.snackbars { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px); z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 900px) { .snackbars { left: 112px; bottom: 24px; } }
.snackbar {
	pointer-events: auto;
	display: flex; align-items: center; gap: 12px; max-width: 560px; width: 100%;
	padding: 6px 6px 6px 16px; min-height: 48px; border-radius: 8px;
	background: #322f2c; color: #f5efeb; font-size: 15px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
	animation: snack-in .2s ease-out;
}
.snackbar.unsuccess { background: #8c1d18; color: #fff; }
.snackbar span { flex: 1; }
.snackbar button { color: inherit; width: 40px; height: 40px; }
@keyframes snack-in { from { transform: translateY(12px); opacity: 0; } }

/* oranžová navigace (spodní lišta v mobilu, boční na počítači) */
.nav { background: var(--primary); }
.nav-item, .nav form button { color: #2b1300; }
.nav-item:hover .pill, .nav form button:hover .pill { background: rgba(255, 255, 255, .25); }
.nav-item.is-active { color: #1f1200; }
.nav-item.is-active .pill { background: rgba(255, 255, 255, .5); }

/* úvodní stránka administrace */
.welcome { max-width: 760px; margin: 0 auto; padding: 32px 0 24px; text-align: center; }
.welcome-logo { width: min(360px, 80%); height: auto; display: block; margin: 0 auto 24px; }
.welcome h1 { margin: 0 0 24px; font-size: 24px; font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; max-width: 480px; margin: 0 auto 24px; }
.tile {
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 20px 12px; border-radius: var(--radius); background: var(--surface);
	color: var(--text); text-decoration: none; font-weight: 600; transition: background-color .15s;
}
.tile:hover, .tile:focus-visible { background: var(--indicator); }
.tile .i { width: 32px; height: 32px; color: var(--primary-text); }
.welcome-photo { width: 100%; max-width: 340px; display: block; margin: 8px auto 0; }

/* ---------- opravy ---------- */
.repair-list { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .repair-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.repair { position: relative; background: var(--surface); border-radius: var(--radius); padding: 20px; }
.repair-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.repair-km { margin: 0; font-size: 20px; font-weight: 700; }
.repair-price { font-size: 20px; font-weight: 700; color: var(--primary-text); white-space: nowrap; }
.repair-date { margin: 2px 0 8px; color: var(--muted); font-size: 15px; }
.repair-note { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.repair-parts { margin: 8px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.repair-empty { margin: 0; color: var(--muted); font-style: italic; }
.repair .dropdown { position: absolute; right: 4px; top: 10px; }
.repair.has-menu .repair-head { padding-right: 36px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs a, .thumbs .thumb-new { display: block; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--indicator); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.repair .repair-head + .repair-date { margin-top: 2px; }

/* galerie */
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; position: relative; }
.gallery a.ph { display: block; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { margin: 4px 2px 0; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.gallery figcaption a { color: var(--primary-text); }
.gallery .del { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; background: rgba(20, 18, 16, .6); color: #fff; }
.gallery .del:hover { background: rgba(140, 29, 24, .9); }
.gallery .del .i { width: 20px; height: 20px; }

/* přepínač (checkbox) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 4px; cursor: pointer; }
.switch-row .switch-text { font-size: 17px; }
.switch-row .switch-text small { display: block; color: var(--muted); font-size: 14px; }
.switch-row input {
	flex: none; -webkit-appearance: none; appearance: none; margin: 0; cursor: pointer;
	width: 52px; height: 32px; border-radius: 16px; border: 2px solid var(--outline); background: var(--surface);
	position: relative; transition: background-color .15s, border-color .15s;
}
.switch-row input::after {
	content: ""; position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--outline); transition: all .15s;
}
.switch-row input:checked { background: var(--primary); border-color: var(--primary); }
.switch-row input:checked::after { left: 22px; top: 2px; width: 24px; height: 24px; background: #fff; }
.switch-row input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* výběr fotek */
.form h2.section { margin: 24px 0 8px; font-size: 20px; font-weight: 600; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick label { position: relative; overflow: hidden; }
.pick label .i { color: var(--primary); }
.pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.pick-count { margin: 8px 4px 0; font-size: 14px; color: var(--muted); }
.pick-errors { margin: 8px 4px 0; color: var(--error); font-weight: 600; font-size: 14px; }

/* ---------- graf km ---------- */
.segmented { display: flex; margin: 4px 0 16px; border: 1px solid var(--outline); border-radius: 999px; overflow: hidden; max-width: 480px; }
.segmented a { flex: 1; text-align: center; padding: 10px 4px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; border-left: 1px solid var(--outline); }
.segmented a:first-child { border-left: 0; }
.segmented a:hover { background: rgba(255, 109, 0, .08); }
.segmented a.is-active { background: var(--primary-container); color: var(--on-primary-container); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; }
.stat-value { display: block; font-size: 26px; font-weight: 700; color: var(--primary-text); line-height: 1.2; }
.stat-label { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--outline-soft); stroke-width: 1; }
.chart .grid-v { stroke-dasharray: 3 4; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .today { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--primary); stroke-width: 3; }
.chart-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .chart .axis { font-size: 20px; } .chart-card { padding: 16px 12px; } }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 44px 1fr minmax(96px, auto); align-items: center; gap: 12px; }
.bar-year { font-weight: 600; }
.bar-track { height: 14px; border-radius: 7px; background: var(--indicator); overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 7px; background: var(--primary); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-value small { color: var(--muted); }

/* nahrávání fotek v obecném formuláři */
.field-upload { margin: 16px 0 4px; }
.field-upload label.btn { position: relative; overflow: hidden; width: 100%; }
.field-upload label .i { color: var(--primary); }
.field-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.field-upload .thumbs:empty { display: none; }

/* ---------- uživatelé ---------- */
.people { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.person { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.person:hover, .person:focus-visible { background: var(--indicator); }
.person[hidden] { display: none; }
.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 18px; }
.person-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-name { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name .chip { padding: 1px 8px; font-size: 12px; vertical-align: 2px; }
.person-sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- kalendář ---------- */
.month-title { margin: 0 0 12px; font-size: 22px; font-weight: 600; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-day {
	min-height: 64px; padding: 6px; border-radius: 12px; background: var(--surface);
	display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; overflow: hidden;
}
.cal-day.is-empty { background: none; }
.cal-day.is-weekend:not(.is-empty) { background: var(--surface-high); }
.cal-day:hover { background: var(--indicator); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-day.is-today .cal-num { background: var(--primary); color: var(--on-primary); }
.cal-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.ev { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-stk { background: #fbd5e0; color: #8e1640; }
.ev-trailer { background: #d9ddf8; color: #2c3a8c; }
.ev-acceptance { background: #cdeee9; color: #0f5f55; }
.ev-other { background: #f1e7b8; color: #6b5800; }
@media (max-width: 600px) {
	.cal { gap: 2px; margin: 0 -8px; }
	.cal-day { min-height: 56px; padding: 4px 2px; align-items: center; border-radius: 8px; }
	.cal-num { align-self: center; }
	.cal-events { flex-direction: row; flex-wrap: wrap; justify-content: center; }
	.cal-events .ev { padding: 0 4px; font-size: 11px; }
	.cal-events .ev-label { display: none; }
}
@media (min-width: 900px) { .cal-day { min-height: 104px; } }
.event-card.is-done { opacity: .7; }
.event-card .repair-head .ev { font-size: 14px; padding: 3px 10px; }

/* zvětšení fotky */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(12, 10, 9, .94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; padding: 56px 8px 16px; text-align: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; cursor: pointer; }
.lightbox figcaption { margin-top: 8px; color: #ddd; font-size: 14px; }
.lightbox .icon-btn { position: absolute; color: #fff; width: 56px; height: 56px; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.lightbox .icon-btn .i { width: 32px; height: 32px; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
