/* klivo-manager — jediný ručně psaný stylesheet. Vzhled převzatý z klivo-admin (www/css/admin.css):
   stejné tokeny (Radix Colors v3 — slate, blue, green, red, amber, violet), fonty, shell a komponenty.
   CSP nepouští inline styly ani skripty (Pitfall 25) — všechno je tady, motiv přepíná www/js/theme-init.js
   + www/js/manager.js přes atribut data-theme na <html>. */

/* Fonty — self-host (OFL-1.1), variabilní řez, latin + latin-ext kvůli češtině */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 100 800;
	font-display: swap;
	src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 100 800;
	font-display: swap;
	src: url("../fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tmavý i světlý motiv (2026-10-25, spec redesignu D1–D2). Komponenty smí používat jen role tokeny;
   barvy (hex, rgba, škály --slate-*) patří jen do bloků tokenů — hlídá StylesheetTokensTest. */
:root {
	color-scheme: dark;

	/* Neutrály — Radix slateDark */
	--slate-1: #111113;
	--slate-2: #18191b;
	--slate-3: #212225;
	--slate-4: #272a2d;
	--slate-5: #2e3135;
	--slate-6: #363a3f;
	--slate-7: #43484e;
	--slate-8: #5a6169;
	--slate-9: #696e77;
	--slate-11: #b0b4ba;
	--slate-12: #edeef0;

	/* Role */
	--bg: var(--slate-1);
	--surface: var(--slate-2);
	--surface-2: var(--slate-3);
	--surface-hover: var(--slate-4);
	--border-subtle: var(--slate-4);
	--border: var(--slate-6);
	--border-strong: var(--slate-7);
	--text: var(--slate-12);           /* 15.2 : 1 na slate-2 */
	--text-2: var(--slate-11);         /*  8.5 : 1 na slate-2 */
	--icon-muted: var(--slate-9);      /*  3.4 : 1 — jen ikony a pomlčky, ne text */
	--avatar: var(--slate-5);
	--sep: var(--slate-8);             /* tečky-oddělovače, okraj prázdné vlajky */
	--hover-tint: rgba(255, 255, 255, .02);
	--danger-tint: rgba(229, 72, 77, .06);
	--chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b0b4ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	--log-bg: var(--slate-1);
	--log-text: var(--slate-11);
	--input-bg: var(--slate-1);
	--focus-input: 0 0 0 3px rgba(0, 144, 255, .25);
	--tooltip-bg: #0b0c0e;
	--tooltip-shadow: 0 8px 24px rgba(0, 0, 0, .45);

	/* Akcent — Radix blueDark */
	--accent: #70b8ff;                 /* blue-11: odkazy, 8.4 : 1 na slate-2 */
	--accent-solid: #0090ff;           /* blue-9: výplň primárního tlačítka */
	--accent-solid-hover: #3b9eff;     /* blue-10 */
	--bad-on: #1a0a0c;                 /* text na červené výplni: 4.9 : 1 */
	--accent-on: #0b1220;              /* tmavý text na blue-9: 5.7 : 1 (bílý jen 3.3 : 1) */

	/* Sémantika — Radix dark, kroky 3 / 6 / 9 / 11 */
	--ok-bg: #132d21;   --ok-border: #20573e;   --ok-solid: #29a383;   --ok: #3dd68c;
	--bad-bg: #3b1219;  --bad-border: #72232d;  --bad-solid: #e5484d;  --bad: #ff9592;
	--bad-solid-hover: #ec5d5e; /* red-10 */
	--warn-bg: #302008; --warn-border: #5c3d05; --warn-solid: #ffc53d; --warn: #ffca16;
	--info-bg: #0d2847; --info-border: #104d87; --info-solid: var(--accent-solid); --info: var(--accent);
	--info-glow: rgba(0, 144, 255, .18); --info-glow-0: rgba(0, 144, 255, 0);
	--leg-bg: #291f43;  --leg-border: #473876;  --leg-solid: #6e56cf;  --leg: #baa7ff;
	--off-bg: var(--slate-3); --off-border: var(--slate-6); --off-solid: var(--slate-9); --off: var(--slate-11);
	--leg-label-bg: rgba(41, 31, 67, .85);

	/* Grafy observability (čte je observability.js) */
	--c-web: #1f8cf0; --c-worker: #b8860f; --c-bad: #e5484d;
	--c-grid: #2b2d31; --c-grid-zero: #3a3d42; --c-mark: #fff;

	/* Typografie — škála 1.25 od 15 px */
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--fs-xs: 12px;   /* VERZÁLKOVÉ štítky */
	--fs-sm: 13px;   /* metadata, časy, nápovědy */
	--fs-base: 15px; /* tělo */
	--fs-md: 19px;   /* hodnoty v dlaždicích */
	--fs-lg: 24px;   /* h1 */

	/* Mezery — 4px rastr */
	--s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
	--s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

	--r-sm: 6px;
	--r-md: 8px;
	--r-lg: 12px;

	/* Na tmavém podkladu nese hloubku hlavně rámeček; stín jen pro plovoucí vrstvy */
	--shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset;

	--ease: cubic-bezier(.2, .7, .2, 1);
	--t-fast: 120ms;
	--t: 180ms;

	--focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
	--container: 1240px;
}

/* Světlý motiv: ručně (data-theme) i podle systému, pokud uživatel netlačí tmavý. Obě sady drž shodné. */
:root[data-theme="light"] {
	color-scheme: light;
	--bg: #f9f9fb; --surface: #ffffff; --surface-2: #f0f0f3; --surface-hover: #e8e8ec; --avatar: #e0e1e6;
	--border-subtle: #e8e8ec; --border: #d9d9e0; --border-strong: #cdced6; --sep: #b9bbc6;
	--text: #1c2024; --text-2: #60646c; --icon-muted: #8b8d98;
	--accent: #0d74ce; --accent-solid: #0d74ce; --accent-solid-hover: #0b66b5; --accent-on: #ffffff;
	--ok-bg: #e6f6eb; --ok-border: #adddc0; --ok-solid: #30a46c; --ok: #1d7a50;
	--bad-bg: #feebec; --bad-border: #f4a9aa; --bad-solid: #cd2b2f; --bad-solid-hover: #b8262a; --bad-on: #ffffff; --bad: #ce2c31;
	--warn-bg: #fff7c2; --warn-border: #f3d673; --warn-solid: #ffc53d; --warn: #9a5800;
	--info-bg: #e6f4fe; --info-border: #b7d9f8; --info-solid: #0d74ce; --info: #0b68b8;
	--info-glow: rgba(13, 116, 206, .2); --info-glow-0: rgba(13, 116, 206, 0);
	--leg-bg: #f4f0fe; --leg-border: #d4caf4; --leg-solid: #6e56cf; --leg: #6550b9;
	--off-bg: #f0f0f3; --off-border: #d9d9e0; --off-solid: #8b8d98; --off: #60646c;
	--shadow-1: 0 1px 2px rgba(28, 32, 36, .04);
	--focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
	--focus-input: 0 0 0 3px rgba(13, 116, 206, .2);
	--hover-tint: rgba(28, 32, 36, .03);
	--danger-tint: rgba(220, 62, 66, .06);
	--chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360646c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	--log-bg: #f0f0f3; --log-text: #60646c;
	--input-bg: #ffffff;
	--tooltip-bg: #ffffff;
	--tooltip-shadow: 0 8px 24px rgba(28, 32, 36, .12);
	--leg-label-bg: rgba(244, 240, 254, .92);
	--c-web: #0d74ce; --c-worker: #ab6400; --c-bad: #ce2c31;
	--c-grid: #e8e8ec; --c-grid-zero: #d9d9e0; --c-mark: #1c2024;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		color-scheme: light;
		--bg: #f9f9fb; --surface: #ffffff; --surface-2: #f0f0f3; --surface-hover: #e8e8ec; --avatar: #e0e1e6;
		--border-subtle: #e8e8ec; --border: #d9d9e0; --border-strong: #cdced6; --sep: #b9bbc6;
		--text: #1c2024; --text-2: #60646c; --icon-muted: #8b8d98;
		--accent: #0d74ce; --accent-solid: #0d74ce; --accent-solid-hover: #0b66b5; --accent-on: #ffffff;
		--ok-bg: #e6f6eb; --ok-border: #adddc0; --ok-solid: #30a46c; --ok: #1d7a50;
		--bad-bg: #feebec; --bad-border: #f4a9aa; --bad-solid: #cd2b2f; --bad-solid-hover: #b8262a; --bad-on: #ffffff; --bad: #ce2c31;
		--warn-bg: #fff7c2; --warn-border: #f3d673; --warn-solid: #ffc53d; --warn: #9a5800;
		--info-bg: #e6f4fe; --info-border: #b7d9f8; --info-solid: #0d74ce; --info: #0b68b8;
		--info-glow: rgba(13, 116, 206, .2); --info-glow-0: rgba(13, 116, 206, 0);
		--leg-bg: #f4f0fe; --leg-border: #d4caf4; --leg-solid: #6e56cf; --leg: #6550b9;
		--off-bg: #f0f0f3; --off-border: #d9d9e0; --off-solid: #8b8d98; --off: #60646c;
		--shadow-1: 0 1px 2px rgba(28, 32, 36, .04);
		--focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
		--focus-input: 0 0 0 3px rgba(13, 116, 206, .2);
		--hover-tint: rgba(28, 32, 36, .03);
		--danger-tint: rgba(220, 62, 66, .06);
		--chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2360646c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
		--log-bg: #f0f0f3; --log-text: #60646c;
		--input-bg: #ffffff;
		--tooltip-bg: #ffffff;
		--tooltip-shadow: 0 8px 24px rgba(28, 32, 36, .12);
		--leg-label-bg: rgba(244, 240, 254, .92);
		--c-web: #0d74ce; --c-worker: #ab6400; --c-bad: #ce2c31;
		--c-grid: #e8e8ec; --c-grid-zero: #d9d9e0; --c-mark: #1c2024;
	}
}

/* ---------- Základ ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--fs-base);
	line-height: 1.5;
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
summary { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: var(--fs-base); font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 var(--s-3); }
code { font-family: var(--font-mono); font-size: .88em; }
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-sm { width: 14px; height: 14px; vertical-align: -2px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.hint { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.empty { color: var(--text-2); padding: var(--s-8) var(--s-5); text-align: center; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.label {
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text-2);
}

/* ---------- Sidebar + štíhlý topbar ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.page { min-width: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; z-index: 10; }
.topbar-inner { padding: 0 var(--s-6); display: flex; align-items: center; justify-content: flex-end; gap: var(--s-3); height: 56px; }
.brand { display: flex; align-items: center; gap: var(--s-2); color: var(--text); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; flex: none; display: block; }
.brand-sub { color: var(--text-2); font-weight: 500; }
.sidenav { background: var(--surface); border-right: 1px solid var(--border-subtle); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: var(--s-3) 0; }
.sidenav .brand { padding: var(--s-1) var(--s-5) var(--s-4); }
.sidenav-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s-3); }
.sidenav-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.sidenav-nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.sidenav-nav a.on { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent-solid); }
.sidenav-nav a .count { margin-left: auto; color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.sidenav-nav a .env { margin-left: auto; height: 20px; font-size: 10px; line-height: 18px; padding: 0 6px; }
.sidenav-nav a .badge { margin-left: auto; height: 20px; font-size: 11px; line-height: 18px; }
.sidenav-nav .badge-bad { min-width: 20px; justify-content: center; padding: 0 6px; }
.sidenav-nav .badge-bad::before { display: none; }
.sidenav-nav a .pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav-sec { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border-subtle); }
.sidenav-label { padding: 0 var(--s-5) 6px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ok-solid); }
.sdot.bad { background: var(--bad-solid); }
.inline { display: inline-flex; align-items: center; gap: var(--s-2); }
.sdot.off { background: var(--off-solid); }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--r-md); }
.btn-icon.btn-ghost { color: var(--text-2); }
.btn-icon.btn-ghost:hover { color: var(--text); }
.topbar-user { display: flex; align-items: center; gap: var(--s-3); color: var(--text-2); font-size: var(--fs-sm); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--avatar); color: var(--text); display: grid; place-items: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.signout-form { display: inline; margin: 0; }
.topbar-account { display: flex; align-items: center; gap: var(--s-3); color: inherit; text-decoration: none; }
.topbar-account:hover .username { color: var(--text); }

/* ---------- Layout ---------- */
.content { max-width: var(--container); margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-12); }
.content.content-wide { max-width: none; }
.page .content { margin: 0; }
.crumbs { display: flex; align-items: center; gap: var(--s-1); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--s-4); flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs .i { color: var(--icon-muted); }

.page-head { display: flex; justify-content: space-between; gap: var(--s-4) var(--s-6); align-items: flex-start; margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.page-title .count { color: var(--text-2); font-size: var(--fs-md); font-weight: 500; }
.page-title .muted { font-size: var(--fs-sm); font-weight: 400; }
.page-meta { display: flex; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-2); color: var(--text-2); font-size: var(--fs-sm); flex-wrap: wrap; }
.page-meta a.host { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-base); font-weight: 500; }
.page-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--sep); }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.cms-login-missing { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
.job-steps { padding: 6px 0; }

.stack { display: grid; gap: var(--s-6); min-width: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-6); align-items: start; }
.layout > .stack:last-child { position: sticky; top: 80px; }
.narrow { max-width: 760px; }

/* ---------- Karta ---------- */
.card {
	background: var(--surface);
	border: 1px solid var(--border-subtle);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-1);
	min-width: 0;
}
.card-head {
	display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3);
	padding: var(--s-4) var(--s-5);
	border-bottom: 1px solid var(--border-subtle);
	flex-wrap: wrap;
}
.card-head .hint { margin: 0; }
.card-head .note { font-size: var(--fs-sm); color: var(--text-2); }
.card-head .count { flex: none; }
.card-head .act { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }
.card-body { padding: var(--s-5); }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.card-foot .hint { margin: 0; }
.card-danger { border-color: var(--bad-border); }

/* ---------- Flash zprávy a bannery ---------- */
.flash, .banner {
	display: flex; align-items: center; gap: var(--s-3);
	padding: var(--s-3) var(--s-4);
	border: 1px solid var(--off-border);
	border-radius: var(--r-lg);
	background: var(--surface-2);
	margin-bottom: var(--s-6);
}
.flash-success { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.flash-error { border-color: var(--bad-border); background: var(--bad-bg); color: var(--bad); }
.flash-info { border-color: var(--info-border); background: var(--info-bg); color: var(--info); }

.banner { padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5); gap: var(--s-4); }
.banner-running { border-color: var(--info-border); background: var(--info-bg); }
.banner-failed { border-color: var(--bad-border); background: var(--bad-bg); }
.banner-warn { border-color: var(--warn-border); background: var(--warn-bg); }
.banner-icon { display: grid; }
.banner-running .banner-icon { color: var(--info); }
.banner-failed .banner-icon { color: var(--bad); }
.banner-warn .banner-icon { color: var(--warn); }
.banner-text { flex: 1; min-width: 0; }
.banner-title { font-weight: 600; }
.banner-sub { font-size: var(--fs-sm); color: var(--text-2); }
.banner-sub code { color: var(--text); }
.banner-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.banner-actions form { margin: 0; }
.banner p { margin: 0; }

/* ---------- Badge (stav) — tónovaná pilulka + tečka: barva nikdy sama, text nese stav ---------- */
.badge {
	--b-bg: var(--off-bg); --b-bd: var(--off-border); --b-dot: var(--off-solid); --b-fg: var(--off);
	display: inline-flex; align-items: center; gap: 6px;
	padding: 1px 8px 1px 7px;
	border: 1px solid var(--b-bd);
	border-radius: 999px;
	background: var(--b-bg);
	color: var(--b-fg);
	font-size: var(--fs-xs);
	font-weight: 600;
	line-height: 20px;
	white-space: nowrap;
	vertical-align: middle;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--b-dot); flex: none; }
.badge-lg { font-size: var(--fs-sm); padding: 2px 10px 2px 9px; line-height: 22px; }
.badge-lg::before { width: 7px; height: 7px; }
.badge-ready, .badge-done, .badge-ok { --b-bg: var(--ok-bg); --b-bd: var(--ok-border); --b-dot: var(--ok-solid); --b-fg: var(--ok); }
.badge-provisioning, .badge-running, .badge-info { --b-bg: var(--info-bg); --b-bd: var(--info-border); --b-dot: var(--info-solid); --b-fg: var(--info); }
.badge-warn { --b-bg: var(--warn-bg); --b-bd: var(--warn-border); --b-dot: var(--warn-solid); --b-fg: var(--warn); }
.badge-failed, .badge-bad { --b-bg: var(--bad-bg); --b-bd: var(--bad-border); --b-dot: var(--bad-solid); --b-fg: var(--bad); }
.badge-imported, .badge-legacy { --b-bg: var(--leg-bg); --b-bd: var(--leg-border); --b-dot: var(--leg-solid); --b-fg: var(--leg); }
.badge-off { --b-bg: var(--surface-2); --b-bd: var(--border); --b-dot: var(--off-solid); --b-fg: var(--text-2); }
.badge-suspended { --b-bg: var(--warn-bg); --b-bd: var(--warn-border); --b-dot: var(--warn-solid); --b-fg: var(--warn); }
.badge-suspending, .badge-resuming { --b-bg: var(--info-bg); --b-bd: var(--info-border); --b-dot: var(--info-solid); --b-fg: var(--info); }
.badge-legacy::before { display: none; }
/* pending / deprovisioning / deleted / skipped zůstávají šedé výchozí */
@media (prefers-reduced-motion: no-preference) {
	.badge-running::before, .badge-provisioning::before, .badge-deprovisioning::before,
	.badge-suspending::before, .badge-resuming::before { animation: pulse 1.4s var(--ease) infinite; }
	.spin { animation: spin 1.2s linear infinite; }
}
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tlačítka ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
	height: 36px; padding: 0 var(--s-4);
	border: 1px solid var(--border);
	border-radius: var(--r-md);
	background: var(--surface-2);
	color: var(--text);
	font: inherit; font-size: 14px; font-weight: 500;
	cursor: pointer; white-space: nowrap;
	transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--accent-on); font-weight: 600; }
.btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); }
.btn-danger { background: var(--bad-solid); border-color: var(--bad-solid); color: var(--bad-on); font-weight: 600; } /* tmavý 4.9 : 1, světlý 5.3 : 1 */
.btn-danger:hover { background: var(--bad-solid-hover); border-color: var(--bad-solid-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-link { border: none; background: none; color: var(--accent); padding: 0; cursor: pointer; font: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--bad); }
.inline-form { display: inline; margin: 0; }
.inline-form select { width: auto; min-width: 120px; height: 32px; font-size: var(--fs-sm); }

/* ---------- Tabulky ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
	text-align: left;
	padding: var(--s-3) var(--s-4);
	border-bottom: 1px solid var(--border-subtle);
	vertical-align: middle;
}
.table th:first-child, .table td:first-child { padding-left: var(--s-5); }
.table th:last-child, .table td:last-child { padding-right: var(--s-5); }
.table thead th {
	font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
	color: var(--text-2); background: var(--surface); white-space: nowrap;
	padding-top: var(--s-2); padding-bottom: var(--s-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--hover-tint); }
/* Skryté popisky (.sr-only, label pole v řádku) jsou absolutní — bez pozicovaného předka by utekly ze scrollu a rozšířily stránku */
.table-wrap { position: relative; }
.table td.row-actions { width: 1%; white-space: nowrap; text-align: right; }
.table td.row-actions > form { display: inline-block; vertical-align: middle; }
.table td.row-actions > .muted { margin-left: var(--s-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .time { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .slug { font-weight: 600; }
/* Smazané instance (tab Smazané) — historie, ne provoz: tlumeně */
.table tbody tr.is-deleted td { color: var(--text-2); }
.table tbody tr.is-deleted .slug a { color: var(--text-2); font-weight: 500; }
.table tbody tr.is-deleted .slug a:hover { color: var(--text); }
.table code { color: var(--text); }
.mono td, .mono code { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Key–value seznam ---------- */
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); margin: 0; }
.kv dt, .kv dd { margin: 0; padding: var(--s-3) 0; border-bottom: 1px solid var(--border-subtle); }
.kv dt { color: var(--text-2); font-size: 14px; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.kv .none, .kv-list .none { color: var(--icon-muted); }
.kv .note, .kv-list .note { color: var(--text-2); font-size: var(--fs-sm); }
.kv-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-8); }
.kv-2 .kv { grid-template-columns: 140px minmax(0, 1fr); }
.kv-compact { grid-template-columns: 96px minmax(0, 1fr); }
.notes { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 14px; white-space: pre-line; }
.notes strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; font-size: var(--fs-sm); white-space: normal; }

/* ---------- Formuláře ---------- */
.form-row { display: grid; gap: 6px; margin-bottom: var(--s-4); align-content: start; }
.form-row > label { font-size: 14px; font-weight: 500; }
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) :where(input:not([type]), input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea),
.input, .filters select, .filters input[type="search"], .toolbar select {
	width: 100%; height: 36px; padding: 0 var(--s-3);
	border: 1px solid var(--border); border-radius: var(--r-md);
	background: var(--input-bg); color: var(--text);
	font: inherit; font-size: 14px;
	transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) textarea { height: auto; min-height: 96px; padding: var(--s-2) var(--s-3); }
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) select, .filters select, .toolbar select {
	appearance: none;
	padding-right: var(--s-8);
	background-image: var(--chevron);
	background-repeat: no-repeat;
	background-position: right 10px center;
}
/* Filtry v toolbaru v jednom řádku — musí stát ZA společným pravidlem selectů (to nastavuje width: 100 %). */
.toolbar select { width: auto; flex: 0 0 auto; min-width: 150px; height: 36px; font-size: var(--fs-sm); }
/* Barva: vlastní vzhled místo nativního — nativní pilulka po :hover (border-color)
   spadne do čtvercového fallbacku prohlížeče a ztratí zaoblení. */
/* Soubor: nativní tlačítko „Vybrat soubor“ ostylované jako sekundární btn, zbytek jako ostatní inputy. */
:where(.form-row, .kv-row) input[type="file"] {
	width: 100%; padding: 4px var(--s-2); min-height: 36px;
	border: 1px solid var(--border); border-radius: var(--r-md);
	background: var(--input-bg); color: var(--text-2);
	font: inherit; font-size: var(--fs-sm); cursor: pointer;
	transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
:where(.form-row, .kv-row) input[type="file"]::file-selector-button {
	height: 26px; margin-right: var(--s-3); padding: 0 var(--s-3);
	border: 1px solid var(--border); border-radius: var(--r-sm, var(--r-md));
	background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
:where(.form-row, .kv-row) input[type="file"]:hover { border-color: var(--border-strong); }
:where(.form-row, .kv-row) input[type="file"]:focus-visible { outline: none; border-color: var(--accent-solid); box-shadow: var(--focus-input); }
.form-row input[type="color"] {
	appearance: none; -webkit-appearance: none;
	width: 100%; height: 36px; padding: 3px; cursor: pointer;
	border: 1px solid var(--border); border-radius: 999px; background: var(--input-bg);
	transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.form-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 999px; }
.form-row input[type="color"]::-moz-color-swatch { border: none; border-radius: 999px; }
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) :where(input:not([type]), input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea):hover, .filters :is(input, select):hover, .toolbar select:hover, .input:hover { border-color: var(--border-strong); }
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) :where(input:not([type]), input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea):focus, .filters :is(input, select):focus, .toolbar select:focus, .input:focus {
	outline: none; border-color: var(--accent-solid); box-shadow: var(--focus-input);
}
:where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) :is(input, select, textarea)[aria-invalid="true"], :where(.form-row, .kv-row, .editbar, .inline-form, .cms-user-group, .danger-confirm, .card-form) .has-error :is(input, select, textarea) { border-color: var(--bad-solid); }
.mono-input :where(input:not([type]), input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea) { font-family: var(--font-mono); font-size: 13px; }
.form-row .hint { margin: 0; }
.form-error { color: var(--bad); font-size: var(--fs-sm); display: block; }
.form-errors {
	list-style: none; margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4);
	border: 1px solid var(--bad-border); background: var(--bad-bg); color: var(--bad);
	border-radius: var(--r-md); font-size: 14px;
}
.form-hidden { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid > .hint { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
.form-section + .form-section { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--border-subtle); }
.form-section h3 { margin-bottom: var(--s-3); }
.form-section-title { grid-column: 1 / -1; margin: var(--s-2) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--border-subtle); }
.form-section-title:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.form-actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-2); }
.form-actions .hint { margin: 0; }
/* Formulář v řádku přes celou šířku karty (label · pole · tlačítko), pod hlavičkou karty. */
.card-form { display: flex; align-items: center; gap: var(--s-2) var(--s-3); flex-wrap: wrap; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border-subtle); margin: 0; }
.card-form > label { font-size: 14px; font-weight: 500; color: var(--text-2); flex: none; }
.card-form > :where(input:not([type="submit"]), select) { flex: 1 1 240px; width: auto; min-width: 0; max-width: 420px; }
.card-form > :where(.form-errors, .form-error) { flex-basis: 100%; margin: 0; }
/* Pole s tlačítkem vedle sebe (Uložit / Nastavit) — tlačítko drží výšku pole. */
.field-action { display: flex; gap: var(--s-2); align-items: center; }
.field-action > :where(input:not([type="submit"]), select) { flex: 1 1 auto; min-width: 0; }
.field-action > .btn { flex: none; }
.stack > .form-row, .stack > form > .form-grid > .form-row { margin-bottom: 0; }
.stack > form > .form-grid { row-gap: var(--s-3); margin-bottom: var(--s-3); align-items: end; }
/* Checkbox z Nette = {input}{label} vedle sebe */
.checkbox-row { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-solid); flex: none; cursor: pointer; }
/* Nette checkbox kreslí <label><input>text</label> */
.checkbox-row label { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 14px; font-weight: 400; cursor: pointer; }

/* ---------- Filtry a stránkování ---------- */
.filters { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border-subtle); margin: 0; }
.filters select { width: auto; min-width: 150px; height: 32px; font-size: var(--fs-sm); }
.filters input[type="search"] { width: auto; flex: 1; min-width: 200px; max-width: 320px; height: 32px; font-size: var(--fs-sm); }
.filters .btn { height: 32px; }
.pagination { display: flex; gap: var(--s-2); justify-content: flex-end; }

/* ---------- Login + error stránky ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .card-body { padding: var(--s-8) var(--s-6) var(--s-6); }
.auth-brand { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-6); font-size: var(--fs-md); font-weight: 700; }
.auth-brand .brand-mark { width: 32px; height: 32px; }
.auth-card .btn-primary { width: 100%; margin-top: var(--s-2); }
.error-page { text-align: center; padding-top: 14vh; max-width: 520px; }
.error-page .code { font-size: 72px; font-weight: 700; letter-spacing: -.03em; color: var(--icon-muted); margin: 0 0 var(--s-2); font-variant-numeric: tabular-nums; line-height: 1; }
.error-page h1 { margin-bottom: var(--s-3); }
.error-page .brand { justify-content: center; margin-bottom: var(--s-10); }
.error-page .muted { margin-bottom: var(--s-6); }

/* ---------- Manager: ikony, stránky, drobnosti ---------- */
/* Sprite ikon v těle stránky — místo inline style (CSP) */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Organizace vlevo v topbaru (admin ho má prázdný), uživatel vpravo */
.topbar-inner .topbar-org { margin-right: auto; display: flex; align-items: center; gap: var(--s-3); min-width: 0; font-size: var(--fs-sm); color: var(--text-2); }
.topbar-org .org { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-org .org-switch { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; }
.topbar-org .org-switch:hover { color: var(--text); text-decoration: none; }
/* Odhlášené stránky (přihlášení, heslo, pozvánka): karta uprostřed, flash nad ní ve stejné šířce */
.auth-wrap { width: 100%; max-width: 380px; display: grid; gap: var(--s-4); }
.auth-wrap:has(.auth-card-wide) { max-width: 480px; }
.auth-wrap > .flash { margin-bottom: 0; }
.auth-card-wide { max-width: 480px; }
.auth-card h1 { font-size: var(--fs-md); margin-bottom: var(--s-4); }
.auth-card .hint { margin-bottom: var(--s-4); }
.auth-foot { margin: var(--s-4) 0 0; text-align: center; font-size: var(--fs-sm); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-start; }
.actions > form { min-width: 0; }
.actions > .action-block { min-width: 0; flex: 1 1 16rem; }
.action-block h3 { margin-bottom: var(--s-2); }
.card-body > h3 { margin: var(--s-5) 0 var(--s-2); }
.card-body ul { margin: 0 0 var(--s-3); padding-left: var(--s-5); }
.card-body > .table-wrap { margin: 0 calc(-1 * var(--s-5)); }
.card > .table-wrap + .card-foot { border-top: 1px solid var(--border-subtle); }
.qr { width: 200px; height: 200px; max-width: 100%; display: block; border: 1px solid var(--border-subtle); border-radius: var(--r-md); margin-bottom: var(--s-3); }
.secret { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); letter-spacing: .08em; word-break: break-all; }
.job-status { display: flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--info); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
.previews figure { margin: 0; min-width: 0; }
.previews figcaption { color: var(--text-2); font-size: var(--fs-sm); margin-top: var(--s-1); overflow-wrap: anywhere; }
.previews img { width: 100%; display: block; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--surface-2); }
.step-list { display: grid; gap: var(--s-2); margin: 0; }
.cms-login-page form { display: grid; gap: var(--s-3); }
.cms-login-page form .btn-primary { margin-top: 0; }

/* ---------- Formuláře z {control} — výchozí renderer Nette kreslí <table><tr><th>label</th><td>pole</td></tr>.
   Tabulku rozkládáme do sloupce řádků jako admin .form-row (label nad polem). ---------- */
form { margin: 0; }
form > table { display: block; width: 100%; max-width: 480px; border-collapse: collapse; }
form > table:has(textarea) { max-width: none; }
form > table > tbody { display: block; }
form > table tr { display: grid; gap: 6px; margin-bottom: var(--s-4); min-width: 0; }
form > table tr:last-child { margin-bottom: 0; }
form > table th { display: block; padding: 0; text-align: left; font-size: 14px; font-weight: 500; }
form > table th:empty { display: none; }
form > table td { display: block; padding: 0; min-width: 0; }
form > table :where(input:not([type]), input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"], input[type="number"], input[type="tel"], select, textarea) {
	width: 100%; height: 36px; padding: 0 var(--s-3);
	border: 1px solid var(--border); border-radius: var(--r-md);
	background: var(--input-bg); color: var(--text);
	font: inherit; font-size: 14px;
	transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
form > table textarea { height: auto; min-height: 96px; padding: var(--s-2) var(--s-3); line-height: 1.5; }
form > table textarea.code { font-family: var(--font-mono); font-size: 13px; min-height: 24rem; }
form > table select { appearance: none; padding-right: var(--s-8); background-image: var(--chevron); background-repeat: no-repeat; background-position: right 10px center; }
form > table :where(input, select, textarea):hover { border-color: var(--border-strong); }
form > table :where(input:not([type="submit"]):not([type="checkbox"]), select, textarea):focus { outline: none; border-color: var(--accent-solid); box-shadow: var(--focus-input); }
form > table input[type="file"] {
	width: 100%; padding: 4px var(--s-2); min-height: 36px;
	border: 1px solid var(--border); border-radius: var(--r-md);
	background: var(--input-bg); color: var(--text-2);
	font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
form > table input[type="file"]::file-selector-button {
	height: 26px; margin-right: var(--s-3); padding: 0 var(--s-3);
	border: 1px solid var(--border); border-radius: var(--r-sm);
	background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
/* Checkbox z Nette = <label><input type=checkbox>text</label> v buňce bez labelu v <th> */
form > table td > label { display: inline-flex; align-items: flex-start; gap: var(--s-2); font-size: 14px; cursor: pointer; }
form > table input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-solid); flex: none; cursor: pointer; }
form > table small { display: block; color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
form > table .required th label::after { content: " *"; color: var(--text-2); }
span.error { display: block; color: var(--bad); font-size: var(--fs-sm); margin-top: 2px; }
form > table tr:has(span.error) :where(input, select, textarea) { border-color: var(--bad-solid); }
ul.error {
	list-style: none; margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4);
	border: 1px solid var(--bad-border); background: var(--bad-bg); color: var(--bad);
	border-radius: var(--r-md); font-size: 14px;
}
/* Odeslání = .btn .btn-primary; form.secondary = výchozí .btn; form.danger = .btn-danger (třídy z presenterů) */
input.button {
	display: inline-flex; align-items: center; justify-content: center;
	height: 36px; padding: 0 var(--s-4);
	border: 1px solid var(--accent-solid); border-radius: var(--r-md);
	background: var(--accent-solid); color: var(--accent-on);
	font: inherit; font-size: 14px; font-weight: 600;
	cursor: pointer; white-space: nowrap;
	transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
input.button:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); }
input.button:active { transform: translateY(1px); }
input.button:focus-visible { outline: none; box-shadow: var(--focus); }
form.secondary input.button { background: var(--surface-2); border-color: var(--border); color: var(--text); font-weight: 500; }
form.secondary input.button:hover { background: var(--surface-hover); border-color: var(--border-strong); }
form.danger input.button { background: var(--bad-solid); border-color: var(--bad-solid); color: var(--bad-on); }
form.danger input.button:hover { background: var(--bad-solid-hover); border-color: var(--bad-solid-hover); }
/* Přihlášení a další odhlášené stránky: tlačítko přes celou šířku karty jako v adminu */
.auth-card form > table { max-width: none; }
.auth-card input.button { width: 100%; margin-top: var(--s-2); }
/* Formuláře v řádku tabulky (role člena, odebrat, zrušit pozvánku): v jednom řádku, label jen pro čtečky */
.table td form > table, .table td form > table > tbody { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); max-width: none; width: auto; }
.table td form > table tr { display: block; margin: 0; }
/* :not(.table) zvedá specificitu nad .table td:first-child — vnořené buňky formuláře nesmí dědit padding ani linky řádku */
.table td form > table:not(.table) :is(th, td) { padding: 0; border: 0; background: none; }
.table td form > table:not(.table) tr:hover { background: none; }
.table td form > table th:not(:empty) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.table td form > table select { width: auto; min-width: 120px; height: 28px; font-size: var(--fs-sm); }
.table td input.button { height: 28px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }

/* ---------- Responzivita ---------- */
@media (max-width: 1080px) {
	.shell { grid-template-columns: minmax(0, 1fr); }
	.sidenav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); flex-direction: row; align-items: center; padding: var(--s-2) var(--s-3); gap: var(--s-2); }
	.sidenav .brand { padding: 0 var(--s-2); }
	.sidenav > .sidenav-nav { flex-direction: row; overflow-x: auto; min-width: 0; padding: 0; }
}
@media (max-width: 760px) {
	.topbar-inner { padding: 0 var(--s-4); }
	.topbar-user .username { display: none; }
	.topbar-user .avatar { display: none; }
	.content { padding: var(--s-4) var(--s-4) var(--s-10); }
	.kv { grid-template-columns: 120px minmax(0, 1fr); }
	.page-actions { width: 100%; }
	.filters input[type="search"] { max-width: none; flex-basis: 100%; }
	.filters select { flex: 1 1 140px; min-width: 0; }
	/* Tabulka se na telefonu posouvá do strany uvnitř .table-wrap — buňky nelámat */
	.table th, .table td { white-space: nowrap; }
	.sidenav .brand-sub { display: none; }
	/* Text přepínače jen pro čtečky, vidět zůstane ikona */
	.org-switch-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (max-width: 480px) {
	.sidenav .brand { font-size: 0; gap: 0; }
	.sidenav-nav a { padding: 0 var(--s-2); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}
