:root {
	--c-bg: #f4f6f8;
	--c-surface: #ffffff;
	--c-border: #e1e5ea;
	--c-text: #1a2434;
	--c-muted: #6b7383;
	--c-primary: #2c5cdd;
	--c-primary-dark: #1d44a8;
	--c-success: #1f9d55;
	--c-warning: #d97706;
	--c-danger: #c0392b;
	--c-accent: #f0f4ff;
	--radius: 6px;
	--shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--c-bg);
	color: var(--c-text);
	font-size: 14px;
	line-height: 1.5;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
	display: flex; align-items: center;
	background: #fff;
	border-bottom: 1px solid var(--c-border);
	padding: 12px 24px;
	gap: 32px;
}
.topbar__brand { font-weight: 700; font-size: 18px; }
.topbar__brand a { color: var(--c-text); }
.topbar__hint { font-weight: 400; color: var(--c-muted); font-size: 12px; margin-left: 8px; }
.topbar__nav { display: flex; gap: 20px; flex: 1; }
.topbar__nav a { color: var(--c-muted); font-weight: 500; }
.topbar__nav a:hover { color: var(--c-primary); text-decoration: none; }
.topbar__user { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; }
.topbar__user span { font-weight: 500; }
.topbar__switch a { margin: 0 4px; }

/* Layout */
.layout { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Headings */
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }

/* Cards */
.card {
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 16px;
	box-shadow: var(--shadow);
}
.card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card__title { font-weight: 600; font-size: 16px; }

/* ======= Klientský dashboard: barevné rozlišení sekcí =======
   Každá sekce klientské zóny má vlastní tón (levý pruh + jemné pozadí
   hlavičky). Cíl: klient rychle odliší, o jaký typ obsahu jde. Barvy
   jsou tlumené, neprosazují se přes text. */
.client-card { position: relative; padding-left: 22px; }
.client-card::before {
	content: ''; position: absolute; left: 0; top: 0; bottom: 0;
	width: 5px; border-radius: var(--radius) 0 0 var(--radius);
}
.client-card .card__header {
	margin-left: -22px; padding: 12px 20px 12px 22px;
	border-bottom: 1px solid var(--c-border);
	margin-right: -20px; margin-top: -20px; margin-bottom: 16px;
	border-radius: var(--radius) var(--radius) 0 0;
}
.client-card .card__title { display: flex; align-items: center; gap: 8px; }
/* Muted podtitul v barevné hlavičce — sladíme kontrast s pozadím karty. */
.client-card .card__header .muted { color: inherit; opacity: 0.75; font-weight: 500; }

/* Identifikace (KYC/AML) — jantarová, upozorňující. */
.client-card--identifikace::before { background: #f2b90b; }
.client-card--identifikace .card__header { background: #fef7e0; color: #7a4d00; }
.client-card--identifikace.client-card--warn { background: #fff8e1; }

/* Dokumenty od auditora (příchozí smlouvy) — modrá, informativní. */
.client-card--dokumenty::before { background: #4d7df0; }
.client-card--dokumenty .card__header { background: #eaf1ff; color: #1a3a70; }

/* Požadované dokumenty (klient dodává) — fialová, akční. */
.client-card--pozadavky::before { background: #7c3aed; }
.client-card--pozadavky .card__header { background: #f3ecff; color: #4c1d95; }

/* Stálá složka (dlouhodobě uložené) — zelená, klidná. */
.client-card--stala::before { background: #2f9e44; }
.client-card--stala .card__header { background: #e6f4e8; color: #1e4d16; }

/* Upozornění na vzor u nahrávání — text vlevo, tlačítko ke stažení vpravo. */
.sample-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sample-notice__text { flex: 1; }

/* Vzory ke stažení — tyrkysová, aby se knihovna předloh nepletla s úkoly. */
.client-card--vzory::before { background: #0d9488; }
.client-card--vzory .card__header { background: #e0f2f1; color: #0f5c53; }

/* Vnitřní tabulka klientských karet: jemný hover, čitelné odsazení řádků.
   Nechává badge, kód a akce v jedné vertikální středové linii. */
.client-card table.data { margin: 0; border-collapse: collapse; }
.client-card table.data tr { border-bottom: 1px solid #eef2f7; transition: background .12s ease; }
.client-card table.data tr:last-child { border-bottom: none; }
.client-card--identifikace table.data tr:hover { background: #fef7e0; }
.client-card--dokumenty table.data tr:hover { background: #eaf1ff; }
.client-card--pozadavky table.data tr:hover { background: #f3ecff; }
.client-card--stala table.data tr:hover { background: #e6f4e8; }
.client-card--vzory table.data tr:hover { background: #e0f2f1; }
.client-card table.data td { padding: 8px 12px; vertical-align: middle; }
/* Malá jemná mezera mezi kódem a názvem — kód mřížka vypadá klidněji. */
.client-card .spis-item__code code { background: rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.06); }

/* Buttons */
.btn {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-size: 13px; font-weight: 500;
	cursor: pointer;
	background: #f1f3f6;
	color: var(--c-text);
	text-decoration: none;
}
.btn:hover { background: #e6e9ee; text-decoration: none; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--c-border); }
.btn--small { padding: 4px 10px; font-size: 12px; }
/* Mini POST formulář kolem mutační akce (CSRF token) — chová se jako inline odkaz */
.inline-form { display: inline; }
.inline-form .btn { font-family: inherit; }

/* Tables */
table.data {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	overflow: hidden;
}
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
table.data th { background: #fafbfc; font-size: 12px; text-transform: uppercase; color: var(--c-muted); letter-spacing: .02em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover { background: #fafbfc; }

/* Forms */
form .form-row { margin-bottom: 14px; }
form label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 13px; }
form input[type=text], form input[type=email], form input[type=date], form input[type=number],
form select, form textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 14px;
	background: #fff;
}
form textarea { min-height: 80px; resize: vertical; }
form .form-actions { display: flex; gap: 8px; margin-top: 16px; }
form .form-help { color: var(--c-muted); font-size: 12px; margin-top: 4px; }

/* Badges */
.badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	white-space: nowrap;
}
.badge--awaited { background: #f1f3f6; color: var(--c-muted); }
/* „Nepožadováno" — klientský dokument, který auditor ještě klientovi
   nevyžádal. Klik na pilulku otevře dialog „Zažádat klienta?". */
.badge--not-requested {
	background: #eef2f7; color: #64748b; border: 1px dashed #94a3b8;
	cursor: pointer; font-style: italic;
}
.badge--not-requested:hover { background: #dbeafe; color: #1e3a8a; border-color: #4d7df0; }
.badge--review { background: #fff3cd; color: #856404; }
.badge--approved { background: #d4edda; color: #155724; }
.badge--returned { background: #f8d7da; color: #721c24; }
.badge--mandatory { background: #fde2e1; color: #9c2924; }
.badge--optional { background: #e1f0fa; color: #1e5d8a; }

/* Flash */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.flash--info { background: #e1f0fa; color: #1e5d8a; }
.flash--success { background: #d4edda; color: #155724; }
.flash--error { background: #f8d7da; color: #721c24; }
.flash--warning { background: #fff3cd; color: #856404; }

/* Empty state */
.empty { text-align: center; color: var(--c-muted); padding: 40px; }

/* Requirement matrix */
.matrix__filter { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.matrix__filter select, .matrix__filter input { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius); }

.template-picker {
	max-height: 360px; overflow-y: auto;
	border: 1px solid var(--c-border); border-radius: var(--radius);
	padding: 8px; background: #fafbfc;
}
.template-picker label {
	display: flex; align-items: flex-start; padding: 8px;
	border-radius: var(--radius); cursor: pointer;
	gap: 10px;
}
.template-picker label:hover { background: #eef2f9; }
.template-picker label.disabled { opacity: .5; cursor: not-allowed; }
.template-picker .tp-name { font-weight: 500; }
.template-picker .tp-desc { color: var(--c-muted); font-size: 12px; margin-top: 2px; }
.template-picker input[type=checkbox] { margin-top: 3px; }

/* Upload zone (thermometer) */
.upload-zone {
	border: 2px dashed #b6c0d2;
	border-radius: var(--radius);
	padding: 32px 20px;
	text-align: center;
	background: #fafbfc;
	transition: all .15s ease;
}
.upload-zone.dragover {
	background: var(--c-accent);
	border-color: var(--c-primary);
}
.upload-zone__hint { color: var(--c-muted); font-size: 13px; margin-top: 6px; }
.upload-zone input[type=file] { display: none; }
.upload-zone__btn {
	display: inline-block; cursor: pointer;
	margin-top: 12px;
	padding: 10px 18px;
	background: var(--c-primary); color: #fff;
	border-radius: var(--radius); font-weight: 500;
}

.upload-list { list-style: none; padding: 0; margin: 16px 0 0; }
.upload-item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 16px;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	margin-bottom: 8px;
}
.upload-item__name { font-weight: 500; word-break: break-all; }
.upload-item__meta { color: var(--c-muted); font-size: 12px; text-align: right; }
.upload-item__progress { grid-column: 1 / -1; }

/* Thermometer */
.thermo {
	position: relative;
	height: 18px;
	background: #eef1f5;
	border-radius: 9px;
	overflow: hidden;
	margin-top: 6px;
}
.thermo__bar {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #2c5cdd 0%, #4d7df0 100%);
	border-radius: 9px;
	transition: width .2s ease;
}
.thermo__bar--done { background: linear-gradient(90deg, #1f9d55 0%, #2dbf6c 100%); }
.thermo__bar--error { background: linear-gradient(90deg, #c0392b 0%, #e85f50 100%); }
.thermo__label {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 600;
	color: #1a2434;
	mix-blend-mode: difference;
	color: #fff;
}

.upload-item__status { font-size: 12px; }
.upload-item__status--done { color: var(--c-success); }
.upload-item__status--error { color: var(--c-danger); }

/* Submission history */
.submission { border-left: 3px solid var(--c-primary); padding: 10px 14px; margin-bottom: 10px; background: #fafbfc; border-radius: var(--radius); }
.submission__meta { color: var(--c-muted); font-size: 12px; }
.submission__files { margin-top: 6px; }
.submission__files li { margin: 2px 0; }

.dl-actions { display: flex; gap: 8px; margin-top: 8px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
	background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
	padding: 16px;
}
.stat__label { color: var(--c-muted); font-size: 12px; text-transform: uppercase; }
.stat__value { font-size: 26px; font-weight: 700; margin-top: 4px; }

/* Delivery progress (klient list) */
.delivery { min-width: 140px; }
.delivery__count { font-size: 13px; margin-bottom: 4px; }
.delivery__count strong { font-size: 14px; }
.delivery__bar {
	height: 6px;
	background: #eef1f5;
	border-radius: 3px;
	overflow: hidden;
}
.delivery__fill {
	height: 100%;
	background: linear-gradient(90deg, #2c5cdd 0%, #4d7df0 100%);
	transition: width .2s ease;
}
.delivery__fill--done {
	background: linear-gradient(90deg, #1f9d55 0%, #2dbf6c 100%);
}

/* Online form */
.online-form .card { padding: 24px 28px; }
.online-form label { display: block; margin-bottom: 4px; font-weight: 500; }
.online-form input[type=text], .online-form input[type=email], .online-form input[type=number],
.online-form input[type=date], .online-form textarea, .online-form select {
	width: 100%; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px;
}
.online-form textarea { min-height: 80px; }
.online-form .row { margin-bottom: 12px; }
.online-form h2, .online-form h3 { margin: 18px 0 10px; }

.form-preview {
	background: #fafbfc;
	padding: 20px 24px;
	border-radius: var(--radius);
	border: 1px dashed var(--c-border);
}
.form-preview input, .form-preview textarea, .form-preview select {
	background: #fff;
	pointer-events: none;
}

/* Signature methods */
.signature-methods { display: grid; gap: 10px; }
.signature-method {
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	padding: 14px 18px;
	background: #fff;
}
.signature-method.disabled { opacity: .5; }
.signature-method__label { margin-bottom: 8px; }
.signature-method__detail input[type=text] {
	font-size: 18px;
	letter-spacing: .3em;
	text-align: center;
	font-family: 'SF Mono', Consolas, monospace;
}

.muted { color: var(--c-muted); }
.text-right { text-align: right; }
.small { font-size: 12px; }

/* ======================================================================
   Auth screen — login, forgot, reset
   ====================================================================== */
body.auth-body {
	min-height: 100vh;
	background: #0a1628;
}
.auth-bg {
	position: fixed; inset: 0; z-index: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.auth-bg__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(
		135deg,
		rgba(10, 22, 40, .35) 0%,
		rgba(10, 22, 40, .55) 50%,
		rgba(10, 22, 40, .75) 100%
	);
}
.auth-shell {
	position: relative; z-index: 1;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.auth-card {
	width: 100%;
	max-width: 420px;
	background: rgba(255, 255, 255, .97);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 14px;
	padding: 36px 40px 32px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35), 0 0 1px rgba(255, 255, 255, .2);
}
.auth-card__brand {
	text-align: center;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--c-border);
}
.auth-card__home {
	display: block;
	transition: opacity .15s;
}
.auth-card__home:hover { opacity: .75; }
.auth-card__logo {
	display: block;
	width: 100%; height: auto;
}
.auth-card__title {
	font-size: 18px;
	margin: 0 0 18px;
	color: var(--c-text);
	font-weight: 600;
}
.auth-card__back { text-align: center; margin-top: 16px; }

.auth-card form .form-row { margin-bottom: 14px; }
.auth-card form .form-row label { font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.auth-card form input[type=email],
.auth-card form input[type=password],
.auth-card form input[type=text] {
	padding: 10px 12px;
	font-size: 14px;
	border-radius: 8px;
}
.auth-card form input[type=email]:focus,
.auth-card form input[type=password]:focus,
.auth-card form input[type=text]:focus {
	outline: 2px solid var(--c-primary);
	outline-offset: -1px;
	border-color: var(--c-primary);
}

.form-row--inline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 18px !important;
}
.checkbox {
	display: flex; align-items: center; gap: 8px;
	font-size: 13px; color: var(--c-muted);
	cursor: pointer;
	font-weight: 400 !important;
	margin-bottom: 0 !important;
}
.checkbox input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.checkbox span { user-select: none; }

.auth-link {
	font-size: 13px;
	color: var(--c-primary);
	text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.btn--block { display: block; width: 100%; padding: 12px; font-size: 14px; font-weight: 600; }

.auth-footer {
	color: rgba(255, 255, 255, .6);
	font-size: 12px;
	margin-top: 24px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.auth-shell .flash {
	width: 100%;
	max-width: 420px;
	margin-bottom: 12px;
}

/* Skupina tlačítek v buňce tabulky — udrží tlačítka na jednom řádku */
.row-actions {
	display: inline-flex;
	gap: 6px;
	justify-content: flex-end;
	white-space: nowrap;
}

/* ===== Grid zakázek (excel-like) ===== */
/* Toolbar sedí nad full-bleed gridem — sdílí s ním horizontální rozsah,
   aby h1 „Zakázky / Klienti" bylo u levého okraje stránky, ne uprostřed
   1200-wide layoutu jako ostatní obsah. */
.egrid-toolbar {
	display: flex; align-items: center; gap: 16px; margin-bottom: 8px;
	width: calc(100vw - 48px);
	margin-left: calc(50% - 50vw + 24px);
}
.egrid-toolbar__count { color: var(--c-muted); font-size: 13px; white-space: nowrap; }
.egrid-toolbar__years { display: flex; gap: 6px; flex: 1; }
.egrid-create { position: relative; }
.egrid-create summary { list-style: none; }
.egrid-create summary::-webkit-details-marker { display: none; }
.egrid-create__panel {
	position: absolute; right: 0; top: calc(100% + 6px);
	width: 360px; padding: 16px;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	z-index: 60;
}
.egrid-create__panel label { display: block; font-weight: 500; margin: 8px 0 2px; }
.egrid-create__panel select { width: 100%; padding: 6px; border: 1px solid var(--c-border); border-radius: var(--radius); }
.egrid-create__panel button { margin-top: 12px; }

.egrid-wrap {
	/* full-bleed — tabulka je širší než layout (max-width 1200px) */
	width: calc(100vw - 48px);
	margin-left: calc(50% - 50vw + 24px);
	max-height: calc(100vh - 220px);
	overflow: auto;
	background: var(--c-surface);
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.egrid {
	border-collapse: separate; border-spacing: 0;
	font-size: 12px;
	width: max-content;
}
.egrid th, .egrid td {
	border-right: 1px solid var(--c-border);
	border-bottom: 1px solid var(--c-border);
	padding: 4px 8px;
	white-space: nowrap;
	background: var(--c-surface);
}

/* Záhlaví — ukotvené nahoře (řádek skupin + řádek popisků) */
.egrid thead th { position: sticky; z-index: 3; font-weight: 600; text-align: left; }
.egrid__grouprow th { top: 0; height: 28px; background: var(--c-accent); }
.egrid__group { color: var(--c-primary-dark); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.egrid__headrow th { top: 28px; background: #f8fafc; max-width: 150px; white-space: normal; vertical-align: bottom; font-weight: 500; line-height: 1.25; }

/* První sloupce — ukotvené vlevo */
.egrid__sticky { position: sticky; z-index: 2; }
/* šířka pro až 7 ikon (✕ 🚗 📋 🤝 💰 + zámeček a stažení u smlouvy) */
.egrid__sticky--icons { left: 0; min-width: 164px; max-width: 164px; }
.egrid__sticky--client { left: 164px; min-width: 180px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.egrid thead .egrid__sticky { z-index: 5; background: var(--c-accent); vertical-align: middle; }

.egrid tbody tr.egrid__row--even td { background: #fafbfc; }
.egrid tbody tr:hover td { background: var(--c-accent); }

/* Součtový řádek — ukotvený dole, aby zůstal vidět při scrollu dlouhého gridu */
.egrid tfoot td {
	position: sticky; bottom: 0; z-index: 3;
	background: #f1f5f9; font-weight: 600;
	border-top: 2px solid var(--c-border);
}
.egrid tfoot .egrid__sticky { z-index: 5; background: var(--c-accent); }
.egrid--selectable tfoot .egrid__sticky--check { min-width: 76px; max-width: 76px; }

/* Průběžkové sloupce — jemně žluté; zebra i hover mají vlastní žluté odstíny */
.egrid td.egrid__col--interim { background: #fdf9e3; }
.egrid tbody tr.egrid__row--even td.egrid__col--interim { background: #f8f2d6; }
.egrid tbody tr:hover td.egrid__col--interim { background: #f1e7bd; }
.egrid__grouprow th.egrid__col--interim { background: #f3edd2; }
.egrid__headrow th.egrid__col--interim { background: #faf5df; }

/* Řazení — klik na záhlaví sloupce */
.egrid__sortable { cursor: pointer; user-select: none; }
.egrid__sortable[data-dir='asc']::after { content: ' ▲'; font-size: 9px; }
.egrid__sortable[data-dir='desc']::after { content: ' ▼'; font-size: 9px; }

/* Filtrovací řádek pod záhlavím u ostatních gridů (faktury, klienti, šablony).
   Grid zakázek přešel na popover pattern (viz .egrid__filterbtn níže) — ostatní
   gridy pořád vytvářejí <tr class="egrid__filterrow"> a čekají tato pravidla. */
.egrid thead .egrid__filterrow th { background: #f1f5f9; padding: 2px 4px; }
.egrid__filterrow .egrid__filter {
	width: 100%; min-width: 70px; box-sizing: border-box;
	font: inherit; font-size: 11px; padding: 2px 4px;
	border: 1px solid var(--c-border); border-radius: 3px; background: #fff;
}
.egrid__filterrow .egrid__filterwrap { display: flex; gap: 2px; }
.egrid__filterrow .egrid__filterop { width: auto; min-width: 0; flex: 0 0 auto; padding: 2px 1px; }
.egrid__filterrow .egrid__filterwrap input.egrid__filter { flex: 1 1 auto; width: auto; min-width: 84px; }

/* Filtr popover v záhlaví — místo filtrovacího řádku pod záhlavím sedí
   ikonka 🔍 vedle popisku sloupce, klik otevře plovoucí popover s ovládáním
   filtru. Aktivní filtr se pozná modrým kruhovým badgem kolem lupy. */
.egrid__filterbtn {
	background: none; border: 0; cursor: pointer;
	color: var(--c-muted); font-size: 12px;
	padding: 0; margin-left: 6px;
	line-height: 1; vertical-align: middle;
	opacity: 0.55;
	width: 22px; height: 22px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
}
.egrid__filterbtn:hover { opacity: 1; background: rgba(44, 92, 221, 0.1); }
.egrid__filterbtn--active {
	opacity: 1;
	background: var(--c-primary);
	color: #fff;
	box-shadow: 0 1px 3px rgba(44, 92, 221, 0.4);
}
.egrid__filterbtn--active:hover { background: var(--c-primary-dark); }
.egrid__filterpopover {
	position: fixed; z-index: 200;
	background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
	box-shadow: var(--shadow); padding: 10px 12px;
	min-width: 220px; font-size: 12px;
}
.egrid__filterpopover .egrid__filter {
	width: 100%; box-sizing: border-box;
	font: inherit; font-size: 13px; padding: 4px 8px;
	border: 1px solid var(--c-border); border-radius: 3px; background: #fff;
}
.egrid__filterpopover .egrid__filterwrap { display: flex; gap: 4px; margin-top: 4px; }
.egrid__filterpopover .egrid__filterop { flex: 0 0 auto; width: auto; }
.egrid__filterpopover .egrid__filterwrap input.egrid__filter { flex: 1 1 auto; min-width: 0; }
.egrid__filterlist { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.egrid__filterlist__item {
	display: flex; align-items: center; gap: 6px;
	padding: 3px 4px; border-radius: 3px; cursor: pointer;
	font-size: 13px; white-space: nowrap;
}
.egrid__filterlist__item:hover { background: var(--c-accent); }
.egrid__filterlist__item input { margin: 0; cursor: pointer; }
.egrid__filterpopover__actions {
	display: flex; justify-content: space-between; align-items: center;
	margin-top: 8px; gap: 6px;
}
.egrid__filterpopover__label {
	font-size: 11px; color: var(--c-muted);
	text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.egrid__filterpopover__clear {
	background: none; border: 0; cursor: pointer;
	color: var(--c-muted); font-size: 12px; padding: 2px 6px;
}
.egrid__filterpopover__clear:hover { color: var(--c-danger); }
.egrid__filterreset {
	background: none; border: 1px solid var(--c-border); border-radius: 3px;
	cursor: pointer; font-size: 12px; padding: 2px 8px; color: var(--c-muted);
	margin-left: 6px;
}
.egrid__filterreset:hover { color: var(--c-danger); border-color: var(--c-danger); }

.egrid__icons { text-align: center; }
.egrid__icons form { display: inline; }
.egrid__iconbtn {
	display: inline-block; background: none; border: 0; cursor: pointer;
	font-size: 13px; padding: 0 3px; text-decoration: none; vertical-align: middle;
}
.egrid__iconbtn:hover { text-decoration: none; transform: scale(1.2); }
.egrid__iconbtn--danger { color: var(--c-danger); font-weight: 700; }
.egrid__iconbtn--warn { filter: drop-shadow(0 0 2px rgba(217, 119, 6, 0.6)); }

/* Dropdown menu akcí v gridu zakázek — místo řady ikonek jedna ikona ⋯,
   klik otevře plovoucí panel s pojmenovanými akcemi. Panel je fixed a JS
   ho polohuje k tlačítku, aby ho sticky sousední buňky neschovaly. */
.egrid-menu { display: inline-block; }
.egrid-menu__trigger { font-size: 18px; font-weight: 700; padding: 0 6px; }
.egrid-menu__panel {
	display: none; position: fixed; z-index: 200;
	background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
	box-shadow: var(--shadow); min-width: 220px; padding: 4px 0;
	text-align: left;
}
.egrid-menu--open .egrid-menu__panel,
.egrid-menu__panel--open { display: block; }
.egrid-menu__item {
	display: flex; align-items: center; gap: 8px; width: 100%;
	padding: 8px 12px; background: none; border: 0;
	color: var(--c-text); font-size: 13px; text-align: left;
	cursor: pointer; text-decoration: none;
	font-family: inherit;
}
.egrid-menu__item:hover { background: var(--c-accent); text-decoration: none; }
.egrid-menu__icon { display: inline-block; width: 20px; text-align: center; }
.egrid-menu__separator {
	height: 1px; background: var(--c-border); margin: 4px 0;
}
.egrid-menu__form { margin: 0; padding: 0; display: block; }
.egrid-menu__item--danger { color: var(--c-danger); }
.egrid-menu__item--danger:hover { background: #fde2e1; }

.egrid__cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.egrid__cell--num { text-align: right; }
.egrid__cell--edit { cursor: cell; }
/* jen ztlumený text — opacity na celé buňce by zprůhlednila i rámečky */
.egrid__cell--faded { color: rgba(26, 36, 52, .22); }
.egrid__cell--editing { padding: 0; overflow: visible; }
.egrid__cell--saved { animation: egrid-saved .9s; }
@keyframes egrid-saved { from { background: #d6f5e3; } }
.egrid__triplink { display: block; }

.egrid__editor {
	width: 100%; min-width: 110px;
	font: inherit; padding: 3px 6px;
	border: 2px solid var(--c-primary); border-radius: 0;
	outline: none; background: #fff;
}
select[multiple].egrid__editor { min-width: 90px; }

/* ===== Grid klientů (variant egrid) ===== */
/* Klientský grid — širší client sloupec (jméno klienta), užší icons sloupec (3 akce) */
.cgrid .egrid__sticky--icons { min-width: 96px; max-width: 96px; }
.cgrid .egrid__sticky--client { left: 96px; min-width: 220px; max-width: 220px; }
.cgrid .egrid__sticky--client a { color: inherit; text-decoration: none; }
.cgrid .egrid__sticky--client a:hover { color: var(--c-primary); text-decoration: underline; }
/* Zástupce — dlouhý text s ellipsis */
.cgrid__cell--long { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* Kompaktní zobrazení dodáno/požadováno */
.cgrid__delivery { font-size: 12px; white-space: nowrap; }
.cgrid__delivery--done { color: var(--c-success, #16a34a); font-weight: 600; }
/* Toolbar rozšíření — oddělovač a AML label */
.cgrid-toolbar__divider { color: var(--c-muted); margin: 0 4px; }
.cgrid-toolbar__label { color: var(--c-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Grid šablon — širší jméno pro popis, kompaktní ikony (jen 3 akce) */
.tgrid .egrid__sticky--icons { min-width: 88px; max-width: 88px; }
.tgrid .egrid__sticky--client { left: 88px; min-width: 300px; max-width: 300px; white-space: normal; }
.tgrid .egrid__sticky--client a { color: inherit; text-decoration: none; }
.tgrid .egrid__sticky--client a:hover { color: var(--c-primary); text-decoration: underline; }
.tgrid .egrid__sticky--client .small { white-space: normal; line-height: 1.3; }

/* ===== Potvrzovací dialog ===== */
dialog.confirm {
	border: 0; border-radius: var(--radius);
	box-shadow: 0 12px 40px rgba(15, 23, 42, .25);
	padding: 22px 24px; max-width: 420px; min-width: 300px;
}
dialog.confirm::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.confirm__title { font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.confirm__message { color: var(--c-muted); line-height: 1.5; margin-bottom: 18px; }
.confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Plán, program a rozpočet auditorské zakázky ===== */
.plan tbody td { vertical-align: top; }
.plan .plan__sectionrow th {
	background: var(--c-accent); color: var(--c-primary-dark);
	font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
	text-align: left; padding: 8px 12px;
}
.plan .plan__titlecell span:first-child { margin-right: 4px; }
.plan__pencil { color: var(--c-muted); font-size: 11px; }
.plan__notecell { min-width: 10em; }

/* Buňka termínu: [−][+] čtvereček s posunem, datum, pod tím vysvětlivka */
.plan__dateline { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.plan__hint { margin-top: 3px; line-height: 1.3; max-width: 16em; }
.plan__shiftbtn {
	width: 20px; height: 20px; padding: 0; line-height: 1;
	border: 1px solid var(--c-border); border-radius: 3px; background: #fff;
	color: var(--c-muted); font-size: 13px; cursor: pointer;
}
.plan__shiftbtn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.plan__shiftbtn:disabled { opacity: .4; cursor: default; }
.plan__offset {
	display: inline-block; min-width: 24px; padding: 1px 3px; text-align: center;
	border: 1px solid var(--c-border); border-radius: 3px; background: #fafbfc;
	font-size: 11px; color: var(--c-muted); font-variant-numeric: tabular-nums;
}

/* Inline editace — vzor gridu zakázek */
.plan__cell--edit { cursor: cell; }
.plan td.plan__cell--editing { padding: 4px 6px; }
.plan__editor {
	width: 100%; min-width: 6em; box-sizing: border-box;
	font: inherit; padding: 3px 6px;
	border: 2px solid var(--c-primary); border-radius: 0;
	outline: none; background: #fff;
}
.plan__cell--saved { animation: plan-saved .9s; }
@keyframes plan-saved { from { background: #d6f5e3; } }

/* Překročení smluvní ceny — decentní zvýraznění v rozpočtu */
.plan__over { color: var(--c-danger); }
.plan__overnote { color: var(--c-danger); margin: 8px 2px 0; }

/* ===== Dialog smlouvy zakázky (contract.js) ===== */
dialog.cdialog {
	border: 0; border-radius: var(--radius);
	box-shadow: 0 12px 40px rgba(15, 23, 42, .25);
	padding: 22px 24px; width: 560px; max-width: calc(100vw - 32px);
}
dialog.cdialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.cdialog__title { font-weight: 600; font-size: 16px; margin-bottom: 14px; }
.cdialog__note { color: var(--c-muted); }
.cdialog__loading { padding: 20px 0; text-align: center; }
.cdialog__error { background: #f8d7da; color: #721c24; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; font-size: 13px; }
.cdialog__error[hidden] { display: none; }
.cdialog__warning { background: #fff3cd; color: #856404; padding: 8px 12px; border-radius: var(--radius); font-size: 12px; margin: 10px 0; }
.cdialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Kroky 1–3: číslovaná sekce, hotový krok zelené ✓, neaktivní ztlumený */
.cstep { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.cstep--inactive { opacity: .55; }
.cstep--done { border-color: #bfe5cd; background: #f4fbf7; }
.cstep__head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cstep__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 20px; height: 20px; border-radius: 50%; flex: none;
	background: var(--c-accent); color: var(--c-primary-dark);
	font-size: 11px; font-weight: 700;
}
.cstep--done .cstep__num { background: var(--c-success); color: #fff; }
.cstep__body { margin-top: 8px; }
.cstep__body p { margin: 6px 0; }
.cstep__ok { color: var(--c-success); font-weight: 500; }
.cstep__fields { display: grid; gap: 8px; margin-bottom: 10px; }
.cstep__field label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.cstep__field input { width: 100%; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius); font: inherit; }

/* ===== Dialog fakturace (invoice.js) ===== */
dialog.idialog { width: 860px; }
.idialog__sectiontitle { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); margin-bottom: 6px; }
.idialog__issued { margin-bottom: 4px; }
.idialog__table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.idialog__table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); padding: 4px 8px; border-bottom: 2px solid var(--c-border); }
.idialog__table td { padding: 5px 8px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.idialog__row--editing td { background: #eef3fd; }
.idialog__num { text-align: right; white-space: nowrap; }
.idialog__state span { margin-right: 4px; }
.idialog__paid { white-space: nowrap; }
.idialog__paid input { font: inherit; font-size: 12px; padding: 2px 4px; border: 1px solid var(--c-border); border-radius: 4px; }
.idialog__paid .egrid__iconbtn { margin-left: 4px; }
/* akce jsou <td> — flex by rozbil table layout, mezery řeší marginy */
.idialog__rowactions { text-align: right; white-space: nowrap; }
.idialog__rowactions > * + * { margin-left: 6px; }
.idialog__rowactions .btn,
.idialog__rowactions .egrid__iconbtn { vertical-align: middle; }

/* formulář nové/editované faktury — vizuálně oddělený box pod seznamem dokladů */
.iform { background: #f6f8fc; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px 16px; margin-top: 16px; }
.iform__heading { font-weight: 600; margin: 0 0 10px; }
.iform__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; margin-bottom: 12px; }
.iform__advance { display: flex; align-items: center; gap: 6px; font-weight: 500; padding: 6px 0; }
.iform__advance input { width: auto; }
.iform__items { border-top: 1px solid var(--c-border); padding-top: 8px; }
.iform__itemrow { display: grid; grid-template-columns: 1fr 90px 120px 120px 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.iform__itemrow--head { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.iform__itemrow input { width: 100%; padding: 6px 8px; border: 1px solid var(--c-border); border-radius: var(--radius); font: inherit; }
.iform__linetotal { font-size: 13px; }
.iform__itemsfoot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 8px; }
.iform__totals { text-align: right; font-size: 13px; }
.iform__grand { font-weight: 700; font-size: 14px; margin-top: 2px; }
.iform__buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Seznam faktur (/auditor/faktury) — bez skupinového řádku má záhlaví top 0 */
.egrid.ilist .egrid__headrow th { top: 0; }
.ilist__num { text-align: right; }
.ilist__state span { margin-right: 4px; }
/* akce jsou <td> — flex by rozbil table layout */
.ilist__actions { white-space: nowrap; }
.ilist__actions > * + * { margin-left: 6px; }
.ilist__actions .btn,
.ilist__actions .egrid__iconbtn { vertical-align: middle; }

/* Editor šablony smlouvy — textarea je fallback bez JS, jinak ji nahradí Quill */
textarea.contract-editor {
	width: 100%; min-height: 60vh;
	font-family: 'SF Mono', Consolas, Menlo, monospace;
	font-size: 13px; line-height: 1.5;
}
.contract-editor__quill { background: #fff; }
.contract-editor__quill .ql-editor { min-height: 60vh; font-size: 14px; line-height: 1.55; }

/* Sticky toolbar — smlouva je dlouhá, panel nesmí odscrollovat s obsahem.
   Umístěn nad textareou (Quill jej vloží před .contract-editor__quill), proto
   vybíráme přes sourozeneckou vazbu — vyplňuje šířku karty, drží se u vrcholu. */
.card .ql-toolbar.ql-snow {
	position: sticky; top: 0; z-index: 5;
	background: #fff;
	border-top-left-radius: var(--radius);
	border-top-right-radius: var(--radius);
	box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}

/* Vlastní tlačítko „Zalomit stránku" — Quill snow tlačítka jsou 28×24, s textem
   potřebují automatickou šířku. Necháváme dostatek prostoru a stylujeme jako pill. */
.ql-toolbar.ql-snow button.ql-pagebreak {
	width: auto; height: 24px; padding: 0 10px;
	border: 1px solid var(--c-border); border-radius: 12px;
	background: #f6f7fb;
	margin-left: 6px;
}
.ql-toolbar.ql-snow button.ql-pagebreak:hover { background: var(--c-accent); border-color: var(--c-primary); }
.ql-pagebreak__label { font-size: 11px; font-weight: 500; letter-spacing: .02em; }

/* Vizuální marker zalomení stránky v editoru — přerušovaná čára s popiskem */
.contract-editor__quill .ql-editor hr.page-break {
	position: relative;
	border: 0;
	height: 24px;
	margin: 12px 0;
	background:
		linear-gradient(to right, transparent 50%, transparent 50%) no-repeat center/100% 2px,
		repeating-linear-gradient(90deg, var(--c-primary) 0 8px, transparent 8px 16px) no-repeat center/100% 2px;
	background-position: center;
	cursor: default;
	user-select: none;
}
.contract-editor__quill .ql-editor hr.page-break::after {
	content: "— zalomení stránky —";
	position: absolute; left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	padding: 0 12px;
	font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
	color: var(--c-primary);
}

/* ===== Hodnocení AML rizik (checklist 55 položek, Auditor:Kyc:assess) ===== */
.risk-table { width: 100%; border-collapse: collapse; }
.risk-table td { padding: 6px 4px; border-bottom: 1px solid var(--c-border); vertical-align: top; transition: background-color .12s ease; }
.risk-table tr:last-child td { border-bottom: 0; }
/* Zebra + modrý hover — stejný feel jako v gridu klientů a v ARES panelu.
   Aplikujeme na <td> (ne na <tr>), protože při `border-collapse: collapse`
   se background na řádku v některých prohlížečích neaplikuje na buňky. */
.risk-table tr:nth-child(odd) td { background-color: #fafbfc; }
.risk-table tr:hover td { background-color: var(--c-accent); }
.risk-table__item { padding-right: 16px; }
/* Trojice radií na jednom řádku vpravo — přepisuje globální blokové labely formulářů */
.risk-table__answers { white-space: nowrap; text-align: right; width: 1%; }
.risk-table__answers label {
	display: inline-flex; align-items: center; gap: 4px;
	font-weight: 400; font-size: 13px;
	margin: 0 0 0 14px; cursor: pointer;
}
.risk-table__answers input[type=radio] { margin: 0; }

/* Chybové hlášky AJAX akcí ve vizuálu flash zpráv */
.toast-stack {
	position: fixed; top: 16px; right: 16px; z-index: 1000;
	display: flex; flex-direction: column; gap: 8px; max-width: 380px;
}
.toast-stack .flash { margin: 0; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }

/* Tabby — přepínání sekcí na detailu (JS setuje aria-selected/hidden podle hashe) */
.tabs {
	display: flex; gap: 4px; border-bottom: 2px solid var(--c-border);
	margin: 16px 0 20px;
}
.tabs__btn {
	background: transparent; border: none; padding: 10px 18px;
	font: inherit; color: var(--c-muted); cursor: pointer;
	border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs__btn:hover { color: var(--c-text); }
.tabs__btn[aria-selected="true"] { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.tab-panel[hidden] { display: none; }

/* Dvojpanel „naše DB ‖ ARES" v tabu Obecné */
.dualpanel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .dualpanel { grid-template-columns: 1fr; } }
.dualpanel .card { margin-top: 0; }
.dualpanel .card--ares { background: #eff5ff; border-color: #cfe0ff; }

/* Řádky panelu — na obou stranách stejná mřížka, aby label/hodnota seděly vedle sebe.
   Levý panel (formulář) používá stejné row grid layoutem `.arespanel-row` obalujícím formulářová pole. */
.arespanel-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--c-border); min-height: 44px; }
.arespanel-row:last-child { border-bottom: none; }
.arespanel-row > label { color: var(--c-muted); font-size: 12px; margin: 0; font-weight: normal; }
.arespanel-row input[type=text], .arespanel-row input:not([type]), .arespanel-row select { width: 100%; margin: 0; }
.arespanel-extra { margin-top: 16px; padding-top: 12px; border-top: 2px solid var(--c-border); }
.arespanel-extra > h4 { margin: 0 0 8px; font-size: 12px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }

.field-diff { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px 12px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--c-border); min-height: 44px; }
.field-diff:last-child { border-bottom: none; }
.field-diff__label { color: var(--c-muted); font-size: 12px; }
.field-diff__value { word-break: break-word; }
.field-diff__value--empty { color: var(--c-muted); font-style: italic; }
.field-diff__value--diff { background: #fff8e1; padding: 2px 6px; border-radius: 3px; }
.field-diff__copy { font-size: 11px; padding: 3px 8px; }

/* Zebra + modrý hover na řádcích detailu klienta — stejný feel jako grid klientů.
   Kryjeme oba panely (form + ARES); nth-child pracuje v rámci vlastního parentu,
   takže levý formulář a pravý panel počítají řádky samostatně, ale vizuálně to
   sedí — obě strany začínají první „obchodní jméno" a mají stejnou výšku řádku. */
.arespanel-row,
.field-diff { transition: background-color .12s ease; }
.arespanel-row:nth-child(odd),
.field-diff:nth-child(odd) { background-color: #fafbfc; }
.arespanel-row:hover,
.field-diff:hover { background-color: var(--c-accent); }

.ares-empty { text-align: center; padding: 20px; color: var(--c-muted); }
.ares-error { background: #f8d7da; color: #721c24; padding: 8px 12px; border-radius: var(--radius); margin: 8px 0; }
.ares-buffered { background: #fff8e1; border-left: 4px solid #f2b90b; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }

/* Historie snapshotů */
.snapshot-list { max-height: 260px; overflow-y: auto; }

/* Porovnání aktuální vs vybraný snapshot — dvousloupcová mřížka, uvnitř kartu ARES-only. */
.snapcompare { display: grid; grid-template-columns: 200px 1fr 1fr; gap: 4px 12px; align-items: start; }
.snapcompare__label { color: var(--c-muted); font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--c-border); }
.snapcompare__cell { padding: 6px 8px; border-bottom: 1px solid var(--c-border); word-break: break-word; }
.snapcompare__cell--diff { background: #fff8e1; }
.snapcompare__header { font-weight: 600; padding: 6px 8px; background: var(--c-accent); border-bottom: 2px solid var(--c-border); }
.snapcompare__section { grid-column: 1 / -1; margin-top: 16px; padding-top: 8px; border-top: 2px solid var(--c-border); font-weight: 600; font-size: 13px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }
.snapcompare__cell table { width: 100%; font-size: 12px; }
.snapcompare__cell table th, .snapcompare__cell table td { padding: 4px 6px; }
.snapshot-picker { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.snapshot-picker select { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius); }

/* Panel „detaily z ARES" (VR) — rozbalovací */
.ares-vr { margin-top: 12px; }
.ares-vr__section { margin: 12px 0; }
.ares-vr__section h4 { margin: 8px 0 6px; font-size: 13px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }
.ares-vr table { width: 100%; }

/* Sankční kontroly EU — bloky prověřených subjektů v tabu AML */
.sanction-subject { margin: 10px 0; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.sanction-subject:last-of-type { border-bottom: none; }

/* ===== E-mailové notifikace klientům ===== */
/* Podnavigace sekcí (Odeslání | Šablony | Historie) + skupina toolbar tlačítek */
.subnav { display: flex; gap: 6px; align-items: center; }

/* Sloupec výběru v gridu zakázek — sticky úplně vlevo. Offsety následujících
   sticky sloupců posouvá jen varianta egrid--selectable, aby se nerozbily
   ostatní gridy (cgrid, tgrid, ilist) bez checkboxů. Ikonový sloupec drží
   trigger dropdown menu (⋯) + volitelně 🙈 pro nepublikovanou smlouvu —
   výrazně užší než dřív (88 px místo 188 px). Záhlaví sloupce výběru je
   širší (76 px), aby se do něj vešly velké přepínače „vybrat vše / zrušit". */
.egrid--selectable .egrid__sticky--check { left: 0; min-width: 36px; max-width: 36px; text-align: center; }
.egrid--selectable .egrid__sticky--check-head { min-width: 76px; max-width: 76px; padding: 4px 4px; }
.egrid--selectable thead ~ tbody .egrid__sticky--check { min-width: 76px; max-width: 76px; }
.egrid--selectable .egrid__sticky--icons { left: 76px; min-width: 88px; max-width: 88px; }
.egrid--selectable .egrid__sticky--client { left: 164px; }
.egrid__clientlink { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.egrid__clientlink:hover { color: var(--c-primary); text-decoration: underline; }

/* Pozvánkový odkaz klienta — URL je dlouhá, drží se v readonly inputu vedle tlačítka. */
.invite-link { display: flex; align-items: center; gap: 6px; }
.invite-link__url {
	flex: 1; min-width: 240px; padding: 4px 8px; border: 1px solid var(--c-border);
	border-radius: var(--radius); font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
	background: #f8fafc; color: var(--c-muted);
}
.notify-check { margin: 0; vertical-align: middle; cursor: pointer; width: 18px; height: 18px; }
.egrid__checktoggle { display: flex; gap: 3px; justify-content: center; }
.egrid__checkbtn {
	background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
	cursor: pointer; font-size: 16px; line-height: 1; padding: 3px 6px;
	color: var(--c-primary);
}
.egrid__checkbtn:hover { background: var(--c-accent); }

/* Badge pilulky v gridu zakázek — HTML `<span class="egrid-badge …">` renderuje
   server (EngagementGridService::badgeHtml). JS při AJAX úpravě zapíše
   innerHTML jen pro buňky se `data-html="1"`. Barvy stejné jako u pilulek
   na stránce klientů, jen s tmavším podbarvením pro lepší kontrast. */
.egrid-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	line-height: 1.4;
	white-space: nowrap;
}
.egrid__cell[data-field="wg_interim"],
.egrid__cell[data-field="wg_inventory"],
.egrid__cell[data-field="wg_final"] { line-height: 1.8; }
.egrid__cell[data-field="wg_interim"] .egrid-badge,
.egrid__cell[data-field="wg_inventory"] .egrid-badge,
.egrid__cell[data-field="wg_final"] .egrid-badge { margin-right: 2px; }

/* Kategorie zakázky */
.egrid-badge--category-AUD { background: #d4edda; color: #155724; }
.egrid-badge--category-USC { background: #e1f0fa; color: #1e5d8a; }
.egrid-badge--category-NEZI { background: #e5e0ff; color: #4b3a99; }
.egrid-badge--category-DOT { background: #fff3cd; color: #856404; }
.egrid-badge--category-KON { background: #ffe8d1; color: #7a3e00; }
.egrid-badge--category-PRO { background: #fde2e1; color: #9c2924; }
.egrid-badge--category-ZAH { background: #f1f3f6; color: var(--c-muted); }

/* Velikost jednotky */
.egrid-badge--size-M { background: #f0f4ff; color: var(--c-primary-dark); }
.egrid-badge--size-L { background: #e1f0fa; color: #1e5d8a; }
.egrid-badge--size-S { background: #fff3cd; color: #856404; }
.egrid-badge--size-V { background: #fde2e1; color: #9c2924; }

/* Zálohová faktura */
.egrid-badge--advance-0\.5 { background: #fff3cd; color: #856404; }
.egrid-badge--advance-1\.0 { background: #d4edda; color: #155724; }

/* Uživatelské pilulky (referent + pracovní skupina) — paleta 8 barev
   deterministicky přiřazená podle user_id % 8, aby si uživatel držel
   stejnou barvu napříč gridem. Kontrastní tmavý text na světlém pozadí. */
/* Zdroj dokumentu — interní oranžová (auditor pracuje sám), klient světle modrá (očekává upload) */
.egrid-badge--source-internal { background: #ffedd5; color: #7c2d12; }
.egrid-badge--source-client { background: #e1f0fa; color: #1e5d8a; }

/* Fáze požadavku — průběžná kontrola se odlišuje od ročního auditu, aby dvojice
   dokladů z téže šablony (stav k 30.9. vs. k 31.12.) nesplynula. */
.egrid-badge--phase-interim { background: #ede9fe; color: #5b21b6; }

/* Klikatelný badge klient ve spisu → modal zámku. Reset button defaults,
   aby vypadal identicky jako <span class="egrid-badge"> (interní badge). */
button.egrid-badge--clickable {
	border: 0; margin: 0; cursor: pointer; font-family: inherit;
	/* Musíme znovu zopakovat některé egrid-badge hodnoty, protože button
	   je form control a browser reset (`font: -webkit-small-control`) je
	   silnější než parent inheritance. */
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	line-height: 1.4;
	transition: filter .12s ease;
	vertical-align: middle;
}
button.egrid-badge--clickable:hover { filter: brightness(0.92); }

/* Malý zámek nalevo od badge zdroje ve spisu. Vertikální zarovnání jde
   na střed badge — obojí vertical-align: middle, ať se nekryjí špatně. */
.lock-icon {
	display: inline-block; vertical-align: middle;
	margin-right: 4px; font-size: 13px; line-height: 1;
}


.egrid-badge--user-0 { background: #dbeafe; color: #1e3a8a; }
.egrid-badge--user-1 { background: #dcfce7; color: #14532d; }
.egrid-badge--user-2 { background: #fef3c7; color: #78350f; }
.egrid-badge--user-3 { background: #fce7f3; color: #831843; }
.egrid-badge--user-4 { background: #ede9fe; color: #4c1d95; }
.egrid-badge--user-5 { background: #ffedd5; color: #7c2d12; }
.egrid-badge--user-6 { background: #ccfbf1; color: #134e4a; }
.egrid-badge--user-7 { background: #fee2e2; color: #7f1d1d; }

/* Compose — řádek příjemce bez primárního kontaktu (přeskočí se) */
tr.notify-skip td { color: var(--c-muted); background: #fafbfc; }

/* Náhledy šablon na compose obrazovce */
.notification-previews details { border-bottom: 1px solid var(--c-border); padding: 4px 0; }
.notification-previews details:last-child { border-bottom: 0; }
.notification-previews summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
.notification-preview {
	border: 1px solid var(--c-border); border-radius: var(--radius);
	background: #fafbfc; padding: 12px 16px; margin: 4px 0 12px;
}

/* Editor šablony notifikace — textarea je fallback bez JS, jinak ji nahradí Quill.
   E-mail je krátký — nižší minimální výška než u smluv. */
.form-fields--meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .form-fields--meta { grid-template-columns: 1fr; } }
textarea.notification-editor {
	width: 100%; min-height: 320px;
	font-family: 'SF Mono', Consolas, Menlo, monospace;
	font-size: 13px; line-height: 1.5;
}
.notification-editor__quill { background: #fff; }
.notification-editor__quill .ql-editor { min-height: 320px; font-size: 14px; line-height: 1.55; }

/* ===== Šablona spisu — stromový pohled (grid s vloženými řádky kapitol) ===== */
/* Používá stejné .egrid třídy jako plochý seznam; kapitoly a subkategorie
   jsou plnošířkové řádky vsazené mezi dokumenty, barevně dle Excelu KAČR. */
.tgrid__chapter td {
	padding: 10px 16px !important;
	font-size: 14px; font-weight: 600;
	background: #a8c4f2; color: #0f2b5b !important;
}
.tgrid__chapter--stala td { background: #a9d99e; color: #1e4d16 !important; }
.tgrid__chapter--interni td { background: #f4b184; color: #6b2c0b !important; }
.tgrid__chapter-code {
	display: inline-block; min-width: 44px;
	font-family: 'SF Mono', Menlo, monospace; font-size: 12px; opacity: 0.85;
}
.tgrid__chapter-name { margin-right: 12px; }
.tgrid__chapter-count { color: rgba(0,0,0,.5); font-size: 11px; font-weight: 400; }

.tgrid__sub td {
	padding: 6px 16px !important;
	font-size: 12px; font-weight: 500;
	background: #d6e4f7 !important; color: #1a3a70 !important;
}
.tgrid__sub--stala td { background: #d5efc9 !important; color: #1e4d16 !important; }
.tgrid__sub--interni td { background: #fadfcb !important; color: #6b2c0b !important; }
.tgrid__sub-code {
	display: inline-block; min-width: 44px;
	font-family: 'SF Mono', Menlo, monospace; font-size: 11px; opacity: 0.85;
}
.tgrid__sub-name { margin-right: 12px; }
.tgrid__sub-count { color: rgba(0,0,0,.5); font-size: 11px; font-weight: 400; }

/* ===== Legacy .spis-tree (spis zakázky používá jinak, ale ponecháno) ===== */
/* Kapitoly = tmavší modrá (variant main), subkategorie = světlejší modrá.
   Odstín přesně kopíruje Excel obsahu spisu (theme 4 tint 0.6 vs 0.8).
   Stálá složka (A.) = zelenkavá, interní část (Z.) = oranžová. */
.spis-tree { margin-top: 12px; }
.spis-chapter { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spis-chapter__header {
	display: flex; align-items: baseline; gap: 12px;
	padding: 10px 16px; font-size: 15px; font-weight: 600;
	background: #a8c4f2; color: #0f2b5b;
}
.spis-chapter__code { min-width: 44px; font-family: 'SF Mono', Menlo, monospace; font-size: 13px; opacity: 0.85; }
.spis-chapter--stala .spis-chapter__header { background: #a9d99e; color: #1e4d16; }
.spis-chapter--interni .spis-chapter__header { background: #f4b184; color: #6b2c0b; }

.spis-sub { background: #fff; border-top: 1px solid var(--c-border); }
.spis-sub__header {
	display: flex; align-items: baseline; gap: 12px;
	padding: 6px 16px; font-size: 13px; font-weight: 500;
	background: #d6e4f7; color: #1a3a70;
}
.spis-sub__code { min-width: 44px; font-family: 'SF Mono', Menlo, monospace; font-size: 12px; opacity: 0.85; }
.spis-sub__name { flex: 1; }
.spis-sub__count { color: var(--c-muted); font-size: 11px; font-weight: 400; }
.spis-chapter--stala .spis-sub__header { background: #d5efc9; color: #1e4d16; }
.spis-chapter--interni .spis-sub__header { background: #fadfcb; color: #6b2c0b; }

.spis-sub__items { width: 100%; border-collapse: collapse; margin: 0; }
.spis-sub__items tr:not(:last-child) td { border-bottom: 1px solid #eef2f7; }
.spis-sub__items td { padding: 4px 12px; vertical-align: middle; }
.spis-item__code { width: 70px; }
.spis-item__code code {
	font-family: 'SF Mono', Menlo, monospace; font-size: 11px;
	background: #f1f5f9; padding: 1px 6px; border-radius: 3px; color: #334155;
}
.spis-item__name { }
/* Zarovnáno vpravo — badge zdroje (interní/klient) je vždy u pravé hrany,
   případný zámek 🔒 vlevo od něj. Řádky se pak zarovnají svisle: badge sedí
   na stejné pozici bez ohledu na to, jestli je před ním zámek nebo ne. */
.spis-item__source { width: 90px; text-align: right; white-space: nowrap; }
.spis-item__source .lock-icon,
.spis-item__source .egrid-badge { display: inline-block; vertical-align: middle; }
.spis-item__scope { width: 220px; }
.spis-item__scope .badge { margin-right: 3px; }
.spis-item__status { width: 150px; white-space: nowrap; }
.spis-item__status .badge { white-space: nowrap; }
.spis-item__due { width: 100px; white-space: nowrap; font-size: 12px; color: #334155; }
.spis-item__due--overdue { color: #b91c1c; font-weight: 600; }
.spis-item__due--editable { cursor: pointer; border-bottom: 1px dashed transparent; }
.spis-item__due--editable:hover { border-bottom-color: #94a3b8; }
.spis-item__due-input { width: 130px; font-size: 12px; padding: 2px 4px; border: 1px solid var(--c-primary); border-radius: 3px; }
.spis-item__due-icon { opacity: 0.35; font-size: 14px; }
.spis-item__due--editable:hover .spis-item__due-icon { opacity: 0.75; }
.spis-item__comment {
	margin-top: 4px; padding: 4px 8px;
	background: #fef2f2; color: #7f1d1d; font-size: 12px; line-height: 1.4;
	border-left: 3px solid #dc2626; border-radius: 2px;
}
.spis-item__actions { width: 200px; text-align: right; white-space: nowrap; }

/* Spis zakázky — dialogy pro náhled PDF a editor interního dokumentu.
   <dialog> HTML5 element: modální backdrop řeší prohlížeč, iframe zobrazí obsah. */
.spis-preview, .spis-editor {
	padding: 0; border: 0; border-radius: var(--radius);
	width: min(95vw, 1100px); height: min(92vh, 900px);
	box-shadow: 0 10px 40px rgba(15, 23, 42, .3);
}
/* Wide varianta — pro strukturované dotazníky (201.5a, 201.6a/b, 202.3a, 204.1)
   potřebujeme skoro celou stránku (100vw × 100vh) a plnou šířku obsahu. */
.spis-editor--wide { width: 99vw; height: 98vh; max-width: none; max-height: none; }
/* Inline lock modal (bez iframe) — pouze potvrzovací dialog. Height se
   nastaví podle obsahu, nemá zbytečné prázdno pod tlačítky. */
.spis-lock {
	padding: 24px 28px; border: 0; border-radius: var(--radius);
	width: min(90vw, 440px);
	box-shadow: 0 10px 40px rgba(15, 23, 42, .3);
	text-align: center;
}
.spis-lock::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.spis-lock__title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.spis-lock__doc { margin: 0 0 12px; color: var(--c-muted); font-size: 13px; }
.spis-lock__hint { margin: 0 0 20px; font-size: 14px; line-height: 1.5; }
.spis-lock__actions { display: flex; justify-content: center; gap: 8px; }
.spis-preview::backdrop, .spis-editor::backdrop {
	background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px);
}
.spis-preview__header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 14px; border-bottom: 1px solid var(--c-border);
	background: #f8fafc;
}
.spis-preview__title { font-weight: 500; font-size: 14px; }
.spis-preview__frame {
	width: 100%; height: calc(100% - 46px); border: 0; display: block;
}
/* Editor už nemá externí hlavičku — chrome je uvnitř iframe (editor-head). */
.spis-editor__frame {
	width: 100%; height: 100%; border: 0; display: block;
}

/* Interní editor — Quill mount pro editor spisu */
textarea.internal-editor { width: 100%; min-height: 400px; font-family: monospace; font-size: 13px; }
.internal-editor__quill { background: #fff; }
.internal-editor__quill .ql-editor { min-height: 480px; font-size: 14px; line-height: 1.6; }
.internal-editor__wrap { max-width: 900px; margin: 0 auto; }
.internal-editor__title { display: flex; gap: 10px; align-items: center; font-size: 16px; }

/* Sjednocená hlavička editorů v sekci spisu (fillInternal, editInternal). */
.editor-head {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
	gap: 12px 16px; padding-bottom: 12px; margin-bottom: 16px;
	border-bottom: 1px solid var(--c-border);
}
.editor-head__main { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.editor-head__ref code {
	font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
	background: #f1f5f9; padding: 3px 8px; border-radius: 3px; color: #334155;
	font-weight: 600;
}
.editor-head__title { margin: 0; font-size: 18px; font-weight: 600; color: #1a2a44; line-height: 1.3; }
.editor-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.editor-head__saved { color: var(--c-muted); }
.editor-head__saved--stale { color: #a25200; text-decoration: line-through; }
.editor-head__dirty { color: #b3251b; font-weight: 600; }
.editor-head__due { color: #334155; }
.editor-head__due--overdue { color: #b91c1c; font-weight: 600; }
.online-preview { max-width: 900px; margin: 0 auto; }
.online-preview__title { display: flex; gap: 10px; align-items: center; font-size: 16px; margin-bottom: 12px; }
.online-preview__body { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px 20px; background: #fafbfc; }
.online-preview__body h2 { margin-top: 0; }

/* Interní online formulář — memo layout (100.1 a další strukturované formuláře). */
.memo-form { color: #222; }
.memo-form__head { border-bottom: 2px solid var(--c-border); padding-bottom: 12px; margin-bottom: 20px; }
.memo-form__title { margin: 0 0 10px; font-size: 20px; }
.memo-form__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 24px; margin: 0; font-size: 13px; }
.memo-form__meta > div { display: flex; gap: 6px; }
.memo-form__meta dt { color: var(--c-muted); font-weight: 500; }
.memo-form__meta dt::after { content: ':'; }
.memo-form__meta dd { margin: 0; font-weight: 600; }

.memo-form__intro { margin-bottom: 20px; font-size: 14px; line-height: 1.55; }
.memo-form__intro p { margin: 0; }

.memo-form__section { margin-bottom: 24px; }
.memo-form__section-title { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: #1a2a44; }
.memo-form__help { margin: -4px 0 12px; color: var(--c-muted); font-size: 13px; }

.memo-form__choice { display: flex; flex-wrap: wrap; gap: 8px; }
.memo-form__radio {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px; border: 1px solid var(--c-border); border-radius: var(--radius);
	background: #fff; cursor: pointer; font-size: 14px; user-select: none;
	transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.memo-form__radio:hover { background: #f4f7fb; border-color: #b7c3d6; }
.memo-form__radio:has(input:checked) { background: #eaf1ff; border-color: #4d7df0; box-shadow: inset 0 0 0 1px #4d7df0; font-weight: 600; }
.memo-form__radio input { margin: 0; }

.memo-form__table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.memo-form__table thead th {
	background: #f4f7fb; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase;
	letter-spacing: .04em; color: var(--c-muted); padding: 10px 12px; border-bottom: 1px solid var(--c-border);
}
.memo-form__table tbody tr { border-bottom: 1px solid #eef2f7; transition: background .12s ease; }
.memo-form__table tbody tr:hover { background: #eaf1ff; }
.memo-form__table tbody tr:last-child { border-bottom: none; }
.memo-form__table td { padding: 10px 12px; vertical-align: middle; }
.memo-form__col-num { width: 36px; color: var(--c-muted); text-align: center; font-variant-numeric: tabular-nums; }
.memo-form__col-q { line-height: 1.45; }
.memo-form__col-ans { width: 100px; white-space: nowrap; text-align: right; }
.memo-form__ans-group { display: inline-flex; }

/* Survey formulář 201.5a v iframe wide dialogu — obsah zabírá plnou šířku,
   nemá max-width 900px jako klasický fill-internal. */
body.bare .memo-form--survey { max-width: none; margin: 0; padding: 8px 16px; }
body.bare .internal-editor__wrap > .memo-form--survey { max-width: none; }

/* Klientská status karta u dotazníku 201.5a. */
.client-survey-status { padding: 12px 16px; margin-bottom: 16px; }
.client-survey-status__badge { margin-bottom: 8px; }
.client-survey-status__return {
	margin-top: 8px; padding: 12px 14px; border-left: 4px solid #e14b3f;
	background: #fdecea; border-radius: 4px;
}
.client-survey-status__return blockquote { margin: 6px 0; font-style: italic; color: #b3251b; }

/* Varianta pro 201.6 INFO list: strukturovaná pole s předvyplněnými hodnotami
   z ARES. Prefill banner nad formulářem + grid layout pro pole + kompaktnější
   tabulky pro opakující se sekce (akcionáři, zákazníci …). */
.memo-form__prefill {
	background: #e8f5e9; border-left: 4px solid #43a047; color: #1b5e20;
	padding: 10px 14px; margin: 0 0 20px; border-radius: 4px; font-size: 13px; line-height: 1.5;
}
.memo-form__prefill em { color: #2e7d32; }
/* Žluté upozornění uvnitř formuláře — použito např. u sekce 3 v 201.6b
   pro varování, že ARES seznam zřízených organizací je jen heuristika. */
.memo-form__warn {
	background: #fff8e1; border-left: 4px solid #f2b90b; color: #6b4a00;
	padding: 10px 14px; margin: 0 0 12px; border-radius: 4px; font-size: 13px; line-height: 1.5;
}
.memo-form__warn em { color: #8a5a00; font-style: normal; font-weight: 600; }
.memo-form__subtitle { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: #1a2a44; }
.memo-form__grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px 16px; margin-bottom: 10px;
}
.memo-form__field { display: flex; flex-direction: column; gap: 4px; }
.memo-form__field > span { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.memo-form__field--wide { grid-column: 1 / -1; }
.memo-form__field input[type=text],
.memo-form__field textarea {
	padding: 6px 8px; border: 1px solid var(--c-border); border-radius: 4px;
	font-family: inherit; font-size: 14px; background: #fff;
}
.memo-form__field input[type=text]:focus,
.memo-form__field textarea:focus { border-color: var(--c-primary); outline: 2px solid #dbe6ff; }
.memo-form__field textarea { resize: vertical; min-height: 44px; }
.memo-form__field .memo-form__ans-group { align-self: flex-start; margin-top: 2px; }
/* Kompaktní tabulka „opakujících se řádků" (akcionáři, zákazníci, …). */
.memo-form__table--rows td { padding: 4px 6px; }
.memo-form__table--rows td input[type=text] {
	width: 100%; box-sizing: border-box;
	padding: 4px 6px; border: 1px solid var(--c-border); border-radius: 3px;
	font-family: inherit; font-size: 13px; background: #fff;
}
.memo-form__table--rows td input[type=text]:focus { border-color: var(--c-primary); outline: 2px solid #dbe6ff; }
.memo-form__table--rows tbody tr:hover { background: transparent; }

/* Repeater 201.6 INFO list — tlačítko „+ přidat řádek", akce mazání. */
.info-form__table { table-layout: auto; }
.info-form__col-num { text-align: center; width: 36px; color: var(--c-muted); }
.info-form__col-actions { width: 32px; text-align: center; }
.info-form__remove {
	background: transparent; border: 0; color: #b91c1c; cursor: pointer;
	font-size: 14px; line-height: 1; padding: 2px 6px; border-radius: 3px;
	opacity: 0.4; transition: opacity .12s;
}
.info-form__remove:hover { opacity: 1; background: #fef2f2; }
.info-form__toolbar { margin: 8px 0 16px; text-align: right; }
.info-form__nace-code { font-family: 'SF Mono', Menlo, monospace; }

/* Varianta pro survey (201.5a): kompaktnější řádek, textareas pro dva
   komentáře (ÚJ + odborník). Použije `.memo-form__table--survey`. */
.memo-form__table--survey td { padding: 6px 8px; vertical-align: top; }
.memo-form__table--survey .memo-form__col-comment { width: 25%; min-width: 160px; }
.memo-form__table--survey .memo-form__col-comment textarea {
	width: 100%; min-height: 32px; padding: 4px 6px;
	border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 13px; line-height: 1.4; resize: vertical;
}
.memo-form__col-q--sub { padding-left: 24px; color: var(--c-muted); font-style: italic; }
.memo-form__q--sub { background: #fafbfc; }
.memo-form__q--sub:hover { background: #f0f4fa; }

.memo-form__ans {
	display: inline-flex; align-items: center; justify-content: center; padding: 2px 10px;
	border: 1px solid var(--c-border); background: #fff; cursor: pointer;
	font-size: 12px; line-height: 1.5; user-select: none; min-width: 36px;
	transition: background .12s ease, border-color .12s ease, color .12s ease;
	position: relative;
}
.memo-form__ans + .memo-form__ans { margin-left: -1px; }
.memo-form__ans--yes { border-radius: 4px 0 0 4px; }
.memo-form__ans--no { border-radius: 0 4px 4px 0; }
.memo-form__ans:hover { z-index: 2; }
.memo-form__ans--yes:hover { background: #f3faf5; border-color: #86c79a; color: #1e7c37; }
.memo-form__ans--no:hover { background: #fdf5f4; border-color: #eb9a92; color: #b3251b; }
.memo-form__ans input { position: absolute; opacity: 0; pointer-events: none; }
.memo-form__ans--yes:has(input:checked) { background: #e6f4ea; border-color: #34a853; color: #1e7c37; font-weight: 600; z-index: 1; }
.memo-form__ans--no:has(input:checked) { background: #fdecea; border-color: #e14b3f; color: #b3251b; font-weight: 600; z-index: 1; }

/* Jemné zvýraznění celého řádku podle aktuální odpovědi. */
.memo-form__q--ano { background: #fbfdfb; }
.memo-form__q--ne { background: #fdfbfb; }
.memo-form__q--ano:hover { background: #f2faf4; }
.memo-form__q--ne:hover { background: #fcf3f2; }
.memo-form__q--0 { background: #fbfbfd; }
.memo-form__q--nk { background: #fbfbfb; }
.memo-form__q--0:hover { background: #eef1fb; }
.memo-form__q--nk:hover { background: #f3f3f3; }

/* 4-tlačítková varianta A/N/0/NK (VKS 204.1) — přebíjí border-radius pro
   krajní tlačítka a přidá stavy pro 0 (šedomodré) a NK (šedé). */
.memo-form__ans-group--vks .memo-form__ans--yes { border-radius: 4px 0 0 4px; }
.memo-form__ans-group--vks .memo-form__ans--no { border-radius: 0; }
.memo-form__ans-group--vks .memo-form__ans--neutral { border-radius: 0; }
.memo-form__ans-group--vks .memo-form__ans--nk { border-radius: 0 4px 4px 0; }
.memo-form__ans--neutral:hover { background: #eef1fb; border-color: #93a7db; color: #1e3a70; }
.memo-form__ans--neutral:has(input:checked) { background: #dbe6ff; border-color: #4d7df0; color: #1e3a70; font-weight: 600; z-index: 1; }
.memo-form__ans--nk:hover { background: #f2f2f2; border-color: #b3b3b3; color: #444; }
.memo-form__ans--nk:has(input:checked) { background: #e2e2e2; border-color: #888; color: #333; font-weight: 600; z-index: 1; }

/* === VKS 204.1 — barevné rozlišení sekcí ===
   Každá oblast má vlastní tón levého pruhu + hlavičky. Cyklus 6 barev
   (A modrá, B fialová, C zelená, D oranžová, E červená, F tyrkysová). */
/* Sekce má levý barevný pruh (6 px), který začíná v levém horním rohu a končí
   v levém dolním. Tabulka i header sedí těsně za pruhem — žádný bílý pruh mezi
   barvou a obsahem. Toho dosáhneme border-left u sekce (namísto ::before), aby
   se tabulka/header přirozeně přišpendlily k okraji. */
.vks-section {
	position: relative;
	border: 1px solid var(--c-border);
	border-left: 6px solid transparent;
	border-radius: var(--radius);
	background: #fff; box-shadow: var(--shadow);
	margin-bottom: 20px; overflow: hidden;
}
.vks-section__header {
	display: flex; align-items: baseline; gap: 12px;
	padding: 12px 20px;
	border-bottom: 1px solid var(--c-border);
}
.vks-section__code {
	min-width: 40px; font-family: 'SF Mono', Menlo, monospace;
	font-size: 13px; font-weight: 600; opacity: 0.75;
}
.vks-section__title { margin: 0; font-size: 15px; font-weight: 600; }
.vks-section__table {
	margin: 0; width: 100%; table-layout: auto;
}
.vks-section__table td, .vks-section__table th { padding: 8px 12px; }

.vks-section--A { border-left-color: #4d7df0; } /* modrá */
.vks-section--A .vks-section__header { background: #eaf1ff; color: #1e3a70; }
.vks-section--B { border-left-color: #7c3aed; } /* fialová */
.vks-section--B .vks-section__header { background: #f3ecff; color: #4c1d95; }
.vks-section--C { border-left-color: #2f9e44; } /* zelená */
.vks-section--C .vks-section__header { background: #e6f4e8; color: #1e4d16; }
.vks-section--D { border-left-color: #f2b90b; } /* oranžová */
.vks-section--D .vks-section__header { background: #fef7e0; color: #7a4d00; }
.vks-section--E { border-left-color: #dc2626; } /* červená */
.vks-section--E .vks-section__header { background: #fef2f2; color: #7f1d1d; }
.vks-section--F { border-left-color: #0d9488; } /* tyrkysová */
.vks-section--F .vks-section__header { background: #ecfeff; color: #134e4a; }

/* Podnadpis skupiny (např. „B. Dodávky") — bez A/N tlačítek, tmavší pozadí. */
.vks-row-header td { padding: 10px 12px; background: rgba(0, 0, 0, .03); color: #1a2a44; }
.vks-row-header td strong { font-size: 13px; }

/* Závěrečné vyhodnocení VKS — matice oblastí × míra spolehlivosti + rozhodnutí. */
.vks-eval__table { width: 100%; border-collapse: collapse; }
.vks-eval__table thead th {
	background: #f4f7fb; padding: 8px 10px; font-size: 12px; font-weight: 600;
	text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted);
	border-bottom: 1px solid var(--c-border); text-align: center; vertical-align: middle;
}
.vks-eval__table thead .vks-eval__vks-group { text-transform: none; letter-spacing: 0; }
.vks-eval__table tbody td { padding: 10px; border-bottom: 1px solid #eef2f7; }
.vks-eval__table tbody tr:last-child td { border-bottom: none; }
.vks-eval__area { text-align: left; min-width: 200px; }
.vks-eval__opt { text-align: center; width: 15%; cursor: pointer; }
.vks-eval__opt label { display: block; padding: 6px; border-radius: 4px; cursor: pointer; transition: background .12s; }
.vks-eval__opt label:hover { background: rgba(0,0,0,.04); }
.vks-eval__opt input[type=radio] { transform: scale(1.3); accent-color: var(--c-primary); }
.vks-eval__opt--good th { color: #1e7c37; }
.vks-eval__opt--good input:checked + span,
.vks-eval__opt--good label:has(input:checked) { background: #e6f4ea; }
.vks-eval__opt--avg th { color: #7a4d00; }
.vks-eval__opt--avg label:has(input:checked) { background: #fef7e0; }
.vks-eval__opt--bad th { color: #b3251b; }
.vks-eval__opt--bad label:has(input:checked) { background: #fdecea; }
.vks-eval__decision { text-align: center; width: 130px; }
.vks-eval__decision .memo-form__ans-group { justify-content: center; }
.vks-eval__row:hover { background: #fafbfd; }

/* Wide dialog (204.1 VKS): plná šířka bez bočních paddingů — sekce a matice
   využijí celý viewport. */
body.bare--wide .bare__content { padding: 12px 16px; max-width: none; }
body.bare--wide .memo-form { max-width: none; }
body.bare--wide .memo-form--vks .memo-form__section { padding: 0; }

/* ============================================================================
   PRŮVODCE „Poznání klienta" (KAČR 1-140) — .uw-* třídy
   Vzdělávací wizard pro juniorního asistenta. 7 stránek × 2-3 body.
   Grafika: každý bod má barevný „pás", boxy typu Proč / Jak / Otázky /
   Příklady / Rizika / Vzor jsou vizuálně odlišené.
   ============================================================================ */
.uw-wrap { max-width: 1150px; margin: 0 auto; padding: 0 12px; }

.uw-header {
	background: linear-gradient(135deg, #eef4ff 0%, #f6ecff 100%);
	border-radius: 12px; padding: 20px 24px; margin-bottom: 20px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.uw-header__nav { display: flex; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.uw-header__title { margin: 0 0 8px; font-size: 26px; color: #1a2a44; }
.uw-header__meta { font-size: 14px; color: #465370; line-height: 1.5; }
.uw-header__ico { margin-left: 4px; }

.uw-progress { margin-top: 14px; }
.uw-progress__bar { height: 8px; background: rgba(255,255,255,.7); border-radius: 4px; overflow: hidden; }
.uw-progress__fill {
	height: 100%;
	background: linear-gradient(90deg, #4d7df0, #7c3aed);
	transition: width .3s ease;
}
.uw-progress__text { margin-top: 6px; font-size: 12px; color: #465370; }

/* Kroková navigace: horizontální flex s wrapem, klikatelné pilulky. */
.uw-steps {
	display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
	padding: 12px; background: #f7f9fc; border-radius: 8px;
}
.uw-step {
	display: flex; align-items: center; gap: 6px;
	padding: 6px 12px; border-radius: 20px;
	background: #fff; color: #465370; text-decoration: none;
	border: 1px solid var(--c-border); font-size: 12px;
	transition: all .15s ease;
}
.uw-step:hover { border-color: #4d7df0; color: #1e3a70; }
.uw-step__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; border-radius: 50%;
	background: #e5e7eb; color: #374151; font-weight: 600; font-size: 11px;
}
.uw-step--active { background: #4d7df0; color: #fff; border-color: #4d7df0; }
.uw-step--active .uw-step__num { background: rgba(255,255,255,.25); color: #fff; }

.uw-page-title {
	font-size: 20px; color: #1a2a44; margin: 24px 0 16px;
	padding-bottom: 10px; border-bottom: 2px solid #e5e7eb;
}

/* Bod (article) — barevný levý pruh, header s číslem, boxy uvnitř */
.uw-point {
	background: #fff; border-radius: 10px; overflow: hidden;
	margin-bottom: 24px; box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
	border: 1px solid #e5e7eb; border-left: 5px solid #4d7df0;
}
.uw-point--0 { border-left-color: #7c3aed; }
.uw-point--1 { border-left-color: #4d7df0; }
.uw-point--2 { border-left-color: #2f9e44; }
.uw-point--3 { border-left-color: #f2b90b; }
.uw-point--4 { border-left-color: #dc2626; }
.uw-point--5 { border-left-color: #0d9488; }

.uw-point__header {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 20px; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
}
.uw-point__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 50%;
	background: #1a2a44; color: #fff; font-weight: 700; font-size: 15px;
	flex-shrink: 0;
}
.uw-point__num--0 { background: #7c3aed; }
.uw-point__num--1 { background: #4d7df0; }
.uw-point__num--2 { background: #2f9e44; }
.uw-point__num--3 { background: #f2b90b; color: #7a4d00; }
.uw-point__num--4 { background: #dc2626; }
.uw-point__num--5 { background: #0d9488; }
.uw-point__title { margin: 0; font-size: 17px; color: #1a2a44; flex: 1; }
.uw-point__isa {
	font-size: 11px; color: #6b7280; background: #fff;
	padding: 4px 10px; border-radius: 4px; border: 1px solid #e5e7eb;
	line-height: 1.4; max-width: 45%;
}

/* Boxy uvnitř bodu: barevně odlišené podle typu */
.uw-box { padding: 14px 20px; border-top: 1px solid #f3f4f6; }
.uw-box:first-of-type { border-top: none; }
.uw-box__label {
	font-size: 12px; font-weight: 600; text-transform: uppercase;
	letter-spacing: .04em; margin-bottom: 8px;
}
.uw-box__body { line-height: 1.55; color: #1f2937; }

.uw-box--why { background: linear-gradient(90deg, #fef3c7 0%, transparent 60%); }
.uw-box--why .uw-box__label { color: #92400e; }

.uw-box--howto { background: linear-gradient(90deg, #dbeafe 0%, transparent 60%); }
.uw-box--howto .uw-box__label { color: #1e40af; }

.uw-box--questions { background: linear-gradient(90deg, #ede9fe 0%, transparent 60%); }
.uw-box--questions .uw-box__label { color: #5b21b6; }

.uw-box--examples { background: linear-gradient(90deg, #d1fae5 0%, transparent 60%); }
.uw-box--examples .uw-box__label { color: #065f46; }

.uw-box--risks { background: linear-gradient(90deg, #fee2e2 0%, transparent 60%); }
.uw-box--risks .uw-box__label { color: #991b1b; }

.uw-box--sample { background: linear-gradient(90deg, #f3f4f6 0%, transparent 60%); }
.uw-box--sample .uw-box__label { color: #374151; }

.uw-list { margin: 0; padding-left: 22px; line-height: 1.6; }
.uw-list li { margin-bottom: 4px; }

.uw-risks { width: 100%; border-collapse: collapse; margin-top: 6px; }
.uw-risks thead th {
	background: transparent; text-align: left; padding: 6px 8px;
	font-size: 11px; color: #7c2d12; font-weight: 600;
	text-transform: uppercase; letter-spacing: .04em;
	border-bottom: 1px solid #fecaca;
}
.uw-risks tbody td { padding: 8px; border-bottom: 1px solid #fee2e2; vertical-align: top; }
.uw-risks tbody tr:last-child td { border-bottom: none; }
.uw-risks tbody td:first-child { font-weight: 500; color: #7f1d1d; width: 40%; }

.uw-sample {
	margin: 0; padding: 12px 14px; background: #fff;
	border: 1px solid #e5e7eb; border-radius: 6px;
	font-family: 'SF Mono', Menlo, monospace; font-size: 13px;
	white-space: pre-wrap; word-wrap: break-word;
	color: #1f2937;
}

/* Otázky uvnitř bodu */
.uw-questions { display: flex; flex-direction: column; gap: 14px; }
.uw-q {
	padding: 12px 14px; background: #fff;
	border-radius: 6px; border: 1px solid #e5e7eb;
}
.uw-q__label { display: block; font-weight: 500; color: #1f2937; margin-bottom: 6px; }
.uw-q__hint { margin: 4px 0 8px; font-size: 12px; color: #6b7280; font-style: italic; }

.uw-input, .uw-textarea, .uw-select {
	width: 100%; padding: 8px 10px;
	border: 1px solid #d1d5db; border-radius: 4px;
	font-family: inherit; font-size: 14px; background: #fff;
	box-sizing: border-box;
}
.uw-input:focus, .uw-textarea:focus, .uw-select:focus {
	outline: 2px solid #dbe6ff; border-color: var(--c-primary);
}
.uw-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* A/N/Nevím pilulky */
.uw-yesno { display: inline-flex; gap: 0; }
.uw-yesno__opt {
	padding: 6px 16px; border: 1px solid #d1d5db;
	background: #fff; cursor: pointer; font-size: 13px;
	user-select: none; transition: all .12s ease;
	position: relative;
}
.uw-yesno__opt input { position: absolute; opacity: 0; pointer-events: none; }
.uw-yesno__opt:first-child { border-radius: 4px 0 0 4px; }
.uw-yesno__opt:last-child { border-radius: 0 4px 4px 0; }
.uw-yesno__opt + .uw-yesno__opt { margin-left: -1px; }
.uw-yesno__opt--yes:hover { background: #d1fae5; border-color: #86efac; color: #065f46; z-index: 1; }
.uw-yesno__opt--yes:has(input:checked) { background: #a7f3d0; border-color: #10b981; color: #065f46; font-weight: 600; z-index: 2; }
.uw-yesno__opt--no:hover { background: #fee2e2; border-color: #fca5a5; color: #991b1b; z-index: 1; }
.uw-yesno__opt--no:has(input:checked) { background: #fecaca; border-color: #ef4444; color: #991b1b; font-weight: 600; z-index: 2; }
.uw-yesno__opt--unknown:hover { background: #f3f4f6; border-color: #9ca3af; color: #374151; z-index: 1; }
.uw-yesno__opt--unknown:has(input:checked) { background: #e5e7eb; border-color: #6b7280; color: #374151; font-weight: 600; z-index: 2; }

/* Multi-choice check */
.uw-multi { display: flex; flex-wrap: wrap; gap: 6px; }
.uw-multi__opt {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 20px;
	background: #fff; cursor: pointer; font-size: 13px;
	transition: all .12s ease;
}
.uw-multi__opt:hover { background: #eef4ff; border-color: #93c5fd; }
.uw-multi__opt:has(input:checked) { background: #dbeafe; border-color: #4d7df0; color: #1e3a70; font-weight: 500; }
.uw-multi__opt input { margin: 0; }

/* Návrh z ARES — kliknutelné doplnění */
.uw-suggestion {
	margin-top: 10px; padding: 10px 12px;
	background: linear-gradient(90deg, #fff7ed 0%, #fff 100%);
	border-left: 3px solid #f59e0b; border-radius: 4px;
}
.uw-suggestion__label { font-size: 12px; color: #92400e; font-weight: 500; margin-bottom: 4px; }
.uw-suggestion__text {
	margin: 4px 0; padding: 6px 8px; background: #fff;
	border: 1px solid #fde68a; border-radius: 4px;
	font-size: 13px; line-height: 1.4; white-space: pre-wrap;
	max-height: 200px; overflow-y: auto;
}
.uw-suggestion__use {
	background: #f59e0b; color: #fff; border: 0;
	padding: 5px 12px; border-radius: 4px; cursor: pointer;
	font-size: 12px; font-weight: 500;
}
.uw-suggestion__use:hover { background: #d97706; }
.uw-suggestion__use:disabled { background: #10b981; cursor: default; }

.uw-actions {
	display: flex; justify-content: space-between; gap: 12px;
	margin: 24px 0; padding: 16px; background: #f9fafb; border-radius: 8px;
	flex-wrap: wrap;
}
.uw-actions .btn { margin-left: 0; }
.uw-actions form.inline-form { display: inline; }

/* Souhrn */
.uw-summary-card {
	background: #fff; border-radius: 10px; padding: 20px;
	margin-bottom: 20px; box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
	border: 1px solid #e5e7eb;
}
.uw-summary-card--rec {
	border-left: 5px solid #7c3aed;
	background: linear-gradient(90deg, #f3ecff 0%, #fff 40%);
}
.uw-summary-card__title { margin: 0 0 12px; font-size: 18px; color: #1a2a44; }
.uw-summary-page-title {
	margin: 20px 0 10px; font-size: 14px; color: #4b5563;
	padding-bottom: 6px; border-bottom: 1px solid #e5e7eb;
}
.uw-rec-list { list-style: none; padding: 0; margin: 0; }
.uw-rec {
	display: flex; gap: 12px; padding: 12px;
	background: #fff; border-radius: 6px; margin-bottom: 8px;
	border: 1px solid #e5e7eb;
}
.uw-rec__badge {
	background: #7c3aed; color: #fff; padding: 4px 10px;
	border-radius: 4px; font-size: 12px; font-weight: 600;
	flex-shrink: 0; height: fit-content;
}
.uw-rec__body { flex: 1; }
.uw-rec__action { margin-bottom: 4px; color: #1f2937; }
.uw-rec__reason { line-height: 1.4; }

.uw-summary-point {
	background: #f9fafb; border-radius: 6px; padding: 10px 14px;
	margin-bottom: 8px; border: 1px solid #e5e7eb;
}
.uw-summary-point__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.uw-summary-answers { margin: 0; padding: 0; }
.uw-summary-answer { display: flex; gap: 10px; padding: 4px 0; border-top: 1px dashed #e5e7eb; }
.uw-summary-answer:first-child { border-top: none; }
.uw-summary-answer dt { flex: 1; color: #6b7280; font-size: 13px; }
.uw-summary-answer dd { flex: 1; margin: 0; font-weight: 500; color: #1f2937; font-size: 13px; }

/* ---- Dvousloupcový layout: otázky vlevo, zpráva do spisu vpravo ---- */
.uw-wrap--wide { max-width: 1600px; }
.uw-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.uw-split__left { border-right: 1px solid #e5e7eb; }
.uw-split__right { background: #fafbfd; }
@media (max-width: 1200px) { .uw-split { grid-template-columns: 1fr; } .uw-split__left { border-right: 0; border-bottom: 1px solid #e5e7eb; } }

/* Zpráva do spisu — pravý sloupec */
.uw-report {
	padding: 16px 20px;
	font-size: 14px; line-height: 1.7; color: #1f2937;
}
.uw-report__header {
	display: flex; align-items: baseline; gap: 10px;
	margin: -16px -20px 14px; padding: 10px 20px;
	background: #f3f4f6; border-bottom: 1px solid #e5e7eb;
	position: sticky; top: 0; z-index: 5;
}
.uw-report__label { font-weight: 600; color: #1a2a44; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.uw-report__sub { color: #6b7280; font-size: 12px; }
.uw-report__body { white-space: normal; }
.uw-report__body p { margin: 0 0 10px; }
.uw-report__body strong { color: #1a2a44; }

/* Placeholder z odpovědi — dynamický (mění se s formulářem) */
.uw-report__answer {
	background: #eef4ff; color: #1e3a70;
	padding: 1px 6px; border-radius: 3px;
	border: 1px dashed #bfdbfe; font-weight: 500;
	transition: all .15s ease;
}
.uw-report__answer--empty { background: #fef3c7; border-color: #fde68a; color: #92400e; font-style: italic; }

/* Placeholder z ARES — statická hodnota z veřejného rejstříku */
.uw-report__ares {
	background: linear-gradient(180deg, #f0fdf4 0%, #d1fae5 100%);
	color: #065f46; padding: 1px 6px; border-radius: 3px;
	border: 1px solid #a7f3d0; font-weight: 500;
	white-space: pre-wrap;
}
.uw-report__ares--empty { background: #fef3c7; border-color: #fde68a; color: #92400e; font-style: italic; }

/* Volný editovatelný blok — auditor sem přímo píše */
.uw-report__editor {
	display: inline-block; min-width: 200px;
	background: #fff7ed; color: #7c2d12;
	padding: 4px 10px; border-radius: 4px;
	border: 1px dashed #fdba74;
	transition: all .15s ease; outline: none;
	white-space: pre-wrap;
}
.uw-report__editor:hover { border-color: #fb923c; background: #ffedd5; }
.uw-report__editor:focus {
	background: #fff; border-color: #f97316; border-style: solid;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, .15);
	color: #1f2937;
}
.uw-report__editor--empty::before {
	content: '✏ ' attr(data-empty-placeholder);
	color: #9a3412; font-style: italic;
}
.uw-report__editor--empty:focus::before { content: none; }

/* If-then/else — zobrazený je vždy jeden ze span'ů; JS je při načtení
   správně přepne. Do doby, než JS proběhne, oba text ukazuje (aby se
   nezacyklilo prázdno). */
.uw-report__if { display: contents; }
.uw-report__if-then, .uw-report__if-else { display: inline; }

.memo-form__note {
	width: 100%; min-height: 90px; padding: 10px 12px; border: 1px solid var(--c-border);
	border-radius: var(--radius); font-family: inherit; font-size: 14px; line-height: 1.5;
	transition: border-color .12s ease, box-shadow .12s ease;
}
.memo-form__note:hover { border-color: #b7c3d6; }
.memo-form__note:focus { outline: none; border-color: #4d7df0; box-shadow: 0 0 0 3px rgba(77,125,240,.15); }

.memo-form__foot { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--c-border); color: var(--c-muted); font-size: 12px; line-height: 1.6; }
.memo-form__input {
	padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px; min-width: 220px;
	transition: border-color .12s ease, box-shadow .12s ease;
}
.memo-form__input:hover { border-color: #b7c3d6; }
.memo-form__input:focus { outline: none; border-color: #4d7df0; box-shadow: 0 0 0 3px rgba(77,125,240,.15); }
.memo-form__inline { display: flex; flex-wrap: wrap; gap: 8px; }

/* Action bar pro editor interního formuláře (100.1a/b): dropdown stavu + tlačítka akcí. */
.form-actionbar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	padding: 10px 12px; margin: 12px 0 4px;
	background: #f4f7fb; border: 1px solid var(--c-border); border-radius: var(--radius);
}
.form-actionbar__state { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.form-actionbar__state label { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.form-actionbar__state select {
	padding: 5px 8px; border: 1px solid var(--c-border); border-radius: var(--radius);
	background: #fff; font-family: inherit; font-size: 13px; cursor: pointer;
}
.form-actionbar__action, .form-actionbar__upload { display: inline-flex; margin: 0; }
.form-actionbar__upload .btn { position: relative; overflow: hidden; }

/* Dynamické badge barvy podle workflow.color (viz WorkflowService). */
.badge--state-gray   { background: #e6e7ec; color: #4a4c56; }
.badge--state-blue   { background: #e0ebff; color: #1a4bcc; }
.badge--state-green  { background: #d8f0e0; color: #1e7c37; }
.badge--state-red    { background: #fdd6d1; color: #b3251b; }
.badge--state-orange { background: #ffe2c4; color: #a25200; }

/* Historie komunikace — rozbalovací sekce v editoru formuláře. */
.form-history {
	margin-top: 18px; padding: 12px 14px;
	border: 1px solid var(--c-border); border-radius: var(--radius); background: #fafbfc;
}
.form-history summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--c-muted); }
.form-history summary:hover { color: #1a2a44; }
.form-history h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.form-history__table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.form-history__table th, .form-history__table td { padding: 6px 10px; border-bottom: 1px solid #eef2f7; text-align: left; }
.form-history__table th { background: #f4f7fb; font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--c-muted); }
.form-history__table tbody tr:last-child td { border-bottom: none; }
.form-history__link { max-width: 320px; }
.form-history__link a {
	display: inline-block; max-width: calc(100% - 32px); overflow: hidden;
	text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
	font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
}
.form-history__link .btn { margin-left: 4px; padding: 2px 6px; }

/* Public dotazník předchozího auditora (samostatný layout, mimo hlavní aplikaci). */
body.public-survey { background: #f2f4f8; margin: 0; font-family: inherit; }
.public-survey__frame { max-width: 780px; margin: 0 auto; padding: 24px 20px 40px; }
.public-survey__brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.public-survey__brand strong { font-size: 18px; color: #1a2a44; }
.public-survey__subbrand { font-size: 12px; color: var(--c-muted); }
.public-survey__card {
	background: #fff; padding: 28px 32px; border-radius: 8px;
	box-shadow: 0 2px 12px rgba(15,23,42,.06); border: 1px solid var(--c-border);
}
.public-survey__card h1 { margin: 0 0 12px; font-size: 22px; }
.public-survey__meta { color: var(--c-muted); font-size: 14px; margin-bottom: 20px; }
.public-survey__field { margin-bottom: 16px; }
.public-survey__field label { display: block; margin-bottom: 6px; font-size: 14px; line-height: 1.4; }
.public-survey__field textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
.public-survey__field textarea:focus { outline: none; border-color: #4d7df0; box-shadow: 0 0 0 3px rgba(77,125,240,.15); }
.public-survey__field input {
	width: 100%; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px; line-height: 1.5;
}
.public-survey__field input:focus { outline: none; border-color: #4d7df0; box-shadow: 0 0 0 3px rgba(77,125,240,.15); }
.public-survey__actions { margin-top: 20px; text-align: right; }
.public-survey__card--gate { text-align: center; }
.public-survey__foot { margin-top: 20px; font-size: 12px; color: var(--c-muted); text-align: center; }

/* Readonly (náhled) — schovat cursor:pointer, disable hover pulsy. */
.memo-form :where(input[disabled], input[readonly]) ~ * { cursor: default; }
.memo-form .memo-form__radio:has(input[disabled]),
.memo-form .memo-form__ans:has(input[disabled]) { cursor: default; }

/* Bare layout — pro obsah načítaný v iframe modálních dialogů (editor spisu). */
body.bare { background: #fff; margin: 0; }
.bare__content { padding: 16px 20px; }
body.bare--wide .bare__content { padding: 12px 16px; }

/* Users administrace — filter row a grid. */
.users-filter { padding: 12px 16px; }
.users-filter__row {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
}
.users-filter__field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.users-filter__field span { color: var(--c-muted); font-weight: 500; }
.users-filter__field input, .users-filter__field select {
	padding: 6px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px; min-width: 180px;
}
.users-filter__actions { display: flex; gap: 8px; margin-left: auto; }

/* Chybové hlášky formulářů — souhrn nad polem, aby uživatel nepřehlédl důvod
   selhání submitu. Používá se v `<ul class="errors">` v Latte šablonách. */
.errors {
	margin: 0 0 16px; padding: 12px 16px 12px 40px;
	background: #fdecea; border-left: 4px solid #e14b3f; border-radius: 4px;
	color: #b3251b; font-size: 14px; line-height: 1.5;
	list-style: none; position: relative;
}
.errors::before {
	content: "⚠"; position: absolute; left: 14px; top: 10px;
	font-size: 18px; line-height: 1;
}
.errors li { margin: 2px 0; }
.errors li + li { border-top: 1px solid rgba(225, 75, 63, .25); padding-top: 6px; margin-top: 6px; }

.users-table tbody tr { border-bottom: 1px solid #eef2f7; }
.users-table__row--deactivated { opacity: .55; }
.users-table__row--deactivated:hover { opacity: 1; }
.inline-form { display: inline; margin-left: 4px; }
/* Editor v iframe modálu: editor-head je fixní hlavička napříč šířkou dialogu. */
body.bare .internal-editor__wrap { max-width: none; }
body.bare .editor-head {
	position: sticky; top: 0; z-index: 5;
	background: #fff; padding: 12px 24px;
	margin: -16px -20px 16px; border-bottom: 1px solid var(--c-border);
	box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
body.bare .editor-head__close { margin-left: 8px; }
body.bare .internal-editor__wrap > *:not(.editor-head) { max-width: 900px; margin-left: auto; margin-right: auto; }
/* Ve versions modalu potřebuje tabulka verzí plnou šířku dialogu, ať se
   badge stavu, historie posouzení a akce nelámou. */
body.bare .internal-editor__wrap > .versions-table { max-width: none; }
/* Wide bare (201.5a survey) — všechny přímé potomky wrapu využijí plnou
   šířku dialogu; jinak by je předchozí pravidlo omezilo na 900px. Survey
   tabulka má 5 sloupců (# / otázka / A/N / Komentář ÚJ / Komentář odborníka)
   a potřebuje víc místa. */
body.bare--wide .internal-editor__wrap > *:not(.editor-head) { max-width: none; }

/* Versions modal — přehled verzí klientského dokumentu + schvalování. */
.versions-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.versions-table thead th {
	background: #f4f7fb; text-align: left; font-weight: 600; font-size: 11px;
	text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted);
	padding: 8px 10px; border-bottom: 1px solid var(--c-border);
}
.versions-table td { padding: 10px; vertical-align: top; border-bottom: 1px solid #eef2f7; }
.versions-table tbody tr:last-child td { border-bottom: none; }
.versions-table__ver { font-weight: 600; white-space: nowrap; }
.versions-table__ver .badge { margin-left: 6px; font-size: 10px; }
.versions-table__row--approved { background: #f7fdf9; }
.versions-table__row--returned { background: #fdf7f6; }
.versions-table__reviews { list-style: none; padding: 0; margin: 0; }
.versions-table__reviews li { margin-bottom: 6px; font-size: 12px; }
.versions-table__reviews li:last-child { margin-bottom: 0; }
.versions-table__comment { color: var(--c-muted); font-style: italic; margin-top: 2px; }
.versions-table__actions { white-space: nowrap; display: flex; gap: 6px; flex-direction: column; align-items: stretch; min-width: 110px; }
.versions-table__actions .versions-form { margin: 0; }
.versions-table__actions .btn { width: 100%; white-space: nowrap; }
.btn--success { background: #34a853; color: #fff; border-color: #2d9146; }
.btn--success:hover { background: #2d9146; }
.btn--success[disabled] { opacity: .5; cursor: not-allowed; }
.btn--danger { background: #e14b3f; color: #fff; border-color: #c73f34; }
.btn--danger:hover { background: #c73f34; }
.btn--danger[disabled] { opacity: .5; cursor: not-allowed; }

/* SendCaseNotification modal — výběr šablony + preview. */
.send-case-form__select { width: 100%; max-width: 520px; padding: 6px 8px; }
.send-case-form__preview {
	margin-top: 16px; padding: 14px 18px;
	background: #fafbfc; border: 1px solid var(--c-border); border-radius: var(--radius);
	max-height: 400px; overflow-y: auto;
}
.send-case-form__preview-subject { margin-bottom: 8px; font-size: 13px; }
.send-case-form__preview-body { font-size: 13px; line-height: 1.5; }
.send-case-form__preview-body p { margin: 0 0 8px; }

/* Klient detail — komentář auditora u odevzdání. */
.submission__review {
	margin-top: 8px; padding: 8px 12px; border-radius: 6px;
	font-size: 13px; line-height: 1.45;
}
.submission__review--approved { background: #e6f4ea; color: #1e7c37; border-left: 3px solid #34a853; }
.submission__review--returned { background: #fdecea; color: #b3251b; border-left: 3px solid #e14b3f; }
.submission__comment { margin-top: 4px; font-style: italic; }

/* ===== Modální dialog „Upravit zakázku" ===== */
.edialog { padding: 0; border: 0; border-radius: var(--radius); width: min(95vw, 520px); box-shadow: 0 10px 40px rgba(15,23,42,.3); }
.edialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.edialog__form { display: flex; flex-direction: column; }
.edialog__header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 12px 16px; border-bottom: 1px solid var(--c-border); background: #f8fafc;
}
.edialog__title { font-weight: 600; font-size: 14px; }
.edialog__body { padding: 14px 16px; display: grid; gap: 10px; }
.edialog__row { display: flex; flex-direction: column; gap: 4px; }
.edialog__row label { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.edialog__row input, .edialog__row select, .edialog__row textarea {
	padding: 6px 8px; border: 1px solid var(--c-border); border-radius: 4px;
	font: inherit; font-size: 13px;
}
.edialog__error { padding: 0 16px; color: var(--c-danger); font-size: 12px; min-height: 16px; }
.edialog__footer {
	display: flex; gap: 8px; justify-content: flex-end;
	padding: 10px 16px 14px; border-top: 1px solid var(--c-border);
}
/* Klik na badge kategorie v gridu zakázek otevírá edit modal */
.egrid__cell[data-field="category"] .egrid-badge { cursor: pointer; }
.egrid__cell[data-field="category"] .egrid-badge:hover { filter: brightness(0.94); }

/* ---- Průvodce: layout s pravým panelem externích zdrojů ---- */
/* :has() ruší 1200px strop .layout — stránka průvodce jede přes celou šířku okna */
main.layout:has(.uw-layout) { max-width: none; }
.uw-layout { display: flex; align-items: flex-start; gap: 20px; }
.uw-layout__main { flex: 1 1 0; min-width: 0; }
.uw-layout__main.uw-wrap { margin: 0; max-width: none; }
.uw-layout__side {
	flex: 0 1 28%; min-width: 340px;
	position: sticky; top: 12px;
	max-height: calc(100vh - 24px); overflow: auto;
}
@media (max-width: 1500px) {
	.uw-layout { flex-wrap: wrap; }
	.uw-layout__side { position: static; max-height: none; min-width: 0; flex: 1 1 100%; }
}

.uw-ext { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.uw-ext__header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.uw-ext__title { font-weight: 600; color: #1a2a44; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.uw-ext__sub { color: #6b7280; font-size: 12px; }
.uw-ext__buttons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.uw-ext__source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.uw-ext__ctl { display: inline-flex; align-items: center; gap: 4px; color: #6b7280; font-size: 12px; }
.uw-ext__select { font-size: 12px; padding: 2px 4px; border: 1px solid #d1d5db; border-radius: 5px; background: #fff; color: #1f2937; }
.uw-ext__empty, .uw-ext__loading { color: #6b7280; font-size: 13px; margin: 6px 0; }
.uw-ext__error { color: #b91c1c; font-size: 13px; margin: 6px 0; }
.uw-ext__note { color: #6b7280; font-size: 12px; margin: 4px 0 6px; }

.uw-ext__block { margin-bottom: 10px; border: 1px solid #eef0f3; border-radius: 6px; padding: 4px 8px; }
.uw-ext__block summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #1f2937; padding: 4px 0; }
.uw-ext__block summary:hover { color: #1a2a44; }

.uw-ext-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 8px; }
.uw-ext-table th {
	background: #f3f4f6; color: #374151; text-align: left;
	padding: 4px 6px; border: 1px solid #e5e7eb;
	position: sticky; top: 0;
}
.uw-ext-table td { padding: 3px 6px; border: 1px solid #eef0f3; vertical-align: top; color: #1f2937; }
.uw-ext-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.uw-ext-table tbody tr:nth-child(even) td { background: #fafbfd; }
.uw-ext-table a { color: #1e3a70; }

/* Srovnávací tabulka meziročního vývoje výkazů */
.uw-cmp__bar {
	display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
	flex-wrap: wrap; margin: 2px 0 10px; font-size: 12px;
}
.uw-cmp__filter { color: #1f2937; cursor: pointer; user-select: none; }
.uw-cmp__legend { color: #6b7280; font-size: 11px; }
.uw-cmp__table td.uw-cmp__name { max-width: 260px; overflow-wrap: break-word; }
.uw-cmp__code { color: #9ca3af; font-size: 11px; }
.uw-cmp__su { color: #6b7280; font-size: 11px; font-variant-numeric: tabular-nums; }
.uw-cmp__warn { color: var(--c-warning); }
.uw-cmp__row--agg td { font-weight: 600; }
.uw-cmp__row--mid td { background: #fff8e1 !important; }
.uw-cmp__row--high td { background: #fdeaea !important; }
.uw-cmp__row--high td.uw-cmp__pct { color: var(--c-danger); font-weight: 600; }
.uw-cmp__row--risk td:first-child { box-shadow: inset 3px 0 0 var(--c-warning); }

/* ===== Hromadné nahrání podkladů klientem (bulk-upload.js) ===== */
dialog.bulk {
	border: 0; border-radius: var(--radius);
	box-shadow: 0 12px 40px rgba(15, 23, 42, .25);
	padding: 22px 24px; width: 820px; max-width: calc(100vw - 32px);
	max-height: calc(100vh - 64px);
}
dialog.bulk::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.bulk__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.bulk__title { font-size: 16px; font-weight: 600; margin: 0 0 2px; }
.bulk__phase[hidden] { display: none; }
.bulk__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.bulk__table { width: 100%; margin-top: 10px; }
.bulk__table td { vertical-align: middle; }

.bulk-row__flag { width: 28px; text-align: center; font-size: 15px; }
.bulk-row__file { width: 45%; word-break: break-word; }
.bulk-row__select { width: 100%; padding: 5px 8px; border: 1px solid var(--c-border); border-radius: var(--radius); font: inherit; }
/* Nejisté přiřazení — klient si má řádku všimnout a zkontrolovat ji. */
.bulk-row--check td { background: #fff8e1; }
.bulk-row--check td:first-child { box-shadow: inset 3px 0 0 var(--c-warning); }
.bulk-row--done td { background: #f4fbf7; }
.bulk-row--error td { background: #fdeaea; }
.bulk-row--error .bulk-row__file .muted { color: var(--c-danger); }

/* Detail šablony spisu — editace metadat i verze na jedné stránce. */
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tpl-head__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }

.tpl-form__group + .tpl-form__group { margin-top: 18px; padding-top: 16px; border-top: 1px solid #eef2f7; }
.tpl-form__legend {
	margin: 0 0 12px; font-size: 11px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--c-muted);
}
.tpl-form__cols { display: grid; gap: 0 16px; }
.tpl-form__cols--3 { grid-template-columns: 1fr 1fr 1fr; }
.tpl-form__cols--1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 760px) { .tpl-form__cols { grid-template-columns: 1fr; } }

/* Badge „online formulář" je tlačítko — typografii bere z .egrid-badge,
   jen font-family musí přebít UA styl tlačítka. */
.tpl-preview-btn { font-family: inherit; border: 0; cursor: pointer; background: #ede9fe; color: #5b21b6; }
.tpl-preview-btn:hover { filter: brightness(.94); }

/* ============================================================================
   303.1 ROZBOR INVENTURNÍCH ZŮSTATKŮ — .inv-* třídy
   Tabulka účtů z obratové předvahy po účtových třídách. Záložky, skrývání
   nulových řádků a zvýraznění proti materialitě řídí inventory-analysis.js.
   ============================================================================ */

.inv__empty { padding: 16px 18px; border: 1px dashed var(--c-border); border-radius: var(--radius); background: #fbfcfe; font-size: 14px; line-height: 1.55; }
.inv__empty p { margin: 0; }

.inv__mat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 24px; }
.inv__mat-grid label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; font-size: 14px; }
.inv__mat-grid label > span { font-weight: 600; }
.inv__mat-grid label > small { grid-column: 1 / -1; order: 3; color: var(--c-muted); font-size: 12px; }
.inv__mat-input {
	width: 150px; padding: 7px 10px; border: 1px solid var(--c-border); border-radius: var(--radius);
	font-family: inherit; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums;
}
.inv__mat-input:focus { outline: none; border-color: #4d7df0; box-shadow: 0 0 0 3px rgba(77,125,240,.15); }

/* Lišta zůstává nahoře — auditor scrolluje stovkami účtů a musí se umět
   přepnout do jiné třídy, aniž by jel zpátky. */
.inv__toolbar {
	position: sticky; top: 0; z-index: 3;
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
	padding: 10px 0; margin-bottom: 12px; background: #fff; border-bottom: 1px solid var(--c-border);
}
.inv__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.inv__tab {
	position: relative;
	display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
	padding: 6px 30px 6px 12px; border: 1px solid var(--c-border); border-radius: var(--radius);
	background: #fff; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
	color: #1a2a44; text-align: left; transition: background .12s ease, border-color .12s ease;
}
.inv__tab:hover { background: #f4f7fc; }
.inv__tab.is-active { background: #1a2a44; border-color: #1a2a44; color: #fff; }
.inv__tab small { font-weight: 400; font-size: 11px; opacity: .75; }
/* Počet zobrazených řádků ve třídě — JS ho přepočítává podle filtru nulových. */
.inv__tab-count { position: absolute; top: 5px; right: 8px; font-size: 10px; font-weight: 700; opacity: .6; }

.inv__filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.inv__filter em { color: var(--c-muted); font-style: normal; }

.inv__panel { display: none; }
.inv__panel.is-active { display: block; }

.inv__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv__table th, .inv__table td { padding: 5px 8px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.inv__table thead th {
	position: sticky; top: 52px; z-index: 2;
	background: #f4f7fc; text-align: left; font-weight: 600; color: #1a2a44; white-space: nowrap;
}
.inv__table tfoot td { border-top: 2px solid var(--c-border); border-bottom: 0; font-weight: 700; background: #fbfcfe; }
.inv__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv__num--closing { font-weight: 600; }
.inv__col-code { white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv__col-name { min-width: 220px; }
.inv__col-input { width: 15%; min-width: 130px; }
.inv__col-input input {
	width: 100%; padding: 4px 7px; border: 1px solid transparent; border-radius: 4px;
	background: #f7f9fc; font-family: inherit; font-size: 13px;
}
.inv__col-input input:hover { border-color: var(--c-border); }
.inv__col-input input:focus { outline: none; background: #fff; border-color: #4d7df0; box-shadow: 0 0 0 2px rgba(77,125,240,.15); }

/* Zvýraznění proti hladinám: nad prováděcí materialitou se účet testuje,
   nad zaznamenávací se aspoň sleduje. */
.inv__row--significant { background: #fff5f5; }
.inv__row--significant .inv__col-code { box-shadow: inset 3px 0 0 #d64545; }
.inv__row--recordable { background: #fffaf0; }
.inv__row--recordable .inv__col-code { box-shadow: inset 3px 0 0 #d69e2e; }
.inv__row:hover { background: #eef3fb; }

/* ---- 303.3 Záznam o fyzické účasti na inventuře zásob ------------------- */
.invrec__qa td { padding: 6px 10px; vertical-align: middle; }
.invrec__qa tbody tr:hover { background: transparent; }
.invrec__col-note { width: 32%; min-width: 180px; }
.invrec__col-note input, .invrec__sample input {
	width: 100%; padding: 4px 7px; border: 1px solid transparent; border-radius: 4px;
	background: #f7f9fc; font-family: inherit; font-size: 13px;
}
.invrec__col-note input:hover, .invrec__sample input:hover { border-color: var(--c-border); }
.invrec__col-note input:focus, .invrec__sample input:focus {
	outline: none; background: #fff; border-color: #4d7df0; box-shadow: 0 0 0 2px rgba(77,125,240,.15);
}

.invrec__rating { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.invrec__rating-label { font-size: 13px; color: var(--c-muted); }
.invrec__rating-opt { min-width: 96px; }

/* Rozcestník lokalit — jeden blok je delší než obrazovka. */
.invrec__bar {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	margin: 10px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border);
}
.invrec__chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.invrec__chip {
	max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	padding: 3px 10px; border: 1px solid var(--c-border); border-radius: 999px;
	background: #f7f9fc; color: var(--c-text); font: inherit; font-size: 12px; cursor: pointer;
}
.invrec__chip:hover { background: #eef3fd; border-color: #93a7db; }

/* Lokalita je <details>, aby šel dlouhý formulář s n pobočkami sbalit bez JS. */
.invrec__lok { border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 12px; background: #fff; }
.invrec__lok[open] { box-shadow: 0 1px 3px rgba(20,35,60,.06); }
.invrec__lok-head {
	display: flex; align-items: center; gap: 10px; padding: 10px 14px;
	cursor: pointer; list-style: none; background: #f4f7fc; border-radius: 7px;
}
.invrec__lok[open] .invrec__lok-head { border-bottom: 1px solid var(--c-border); border-radius: 7px 7px 0 0; }
.invrec__lok-head::-webkit-details-marker { display: none; }
.invrec__lok-head::before { content: '▸'; color: var(--c-muted); font-size: 12px; }
.invrec__lok[open] .invrec__lok-head::before { content: '▾'; }
.invrec__lok-num { font-weight: 600; font-size: 13px; color: #1a2a44; white-space: nowrap; }
.invrec__lok-title { flex: 1; font-size: 13px; color: var(--c-muted); }
.invrec__lok-remove {
	border: 0; background: none; cursor: pointer; color: #d64545; font-size: 14px;
	padding: 2px 6px; border-radius: 4px; opacity: .6;
}
.invrec__lok-remove:hover { opacity: 1; background: #fef2f2; }
.invrec__lok-body { padding: 14px; }

.invrec__sub-title { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: #1a2a44; }
.invrec__sample td { padding: 4px 6px; }
.invrec__sample tbody tr:hover { background: transparent; }
.invrec__col-narrow { width: 92px; }
.invrec__col-actions { width: 32px; text-align: center; }
.invrec__row-remove {
	border: 0; background: none; cursor: pointer; color: #d64545; font-size: 13px;
	padding: 2px 5px; border-radius: 4px; opacity: .55;
}
.invrec__row-remove:hover { opacity: 1; background: #fef2f2; }
.invrec__toolbar { margin: 8px 0 4px; text-align: right; }

.invrec__declaration {
	margin: 0 0 12px; padding: 12px 14px; border-left: 3px solid var(--c-border);
	background: #f8fafc; font-size: 13px; line-height: 1.6; color: #3d4a5c;
}
.invrec__confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; }

/* === 303.4 Test kompletnosti inventurní dokumentace === */
.invdoc__table { table-layout: auto; }
.invdoc__col-expect {
	width: 48px; text-align: center; color: var(--c-muted);
	font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
}
.invdoc__col-ans { width: 128px; }

/* === Kontrolní seznamy s bezpříznakovou odpovědí (303.4, 305.1) ===
   Odpověď se liší od té, kterou vzor uvádí jako bezpříznakovou → zjištění.
   Podbarvení řídí `:has()`, aby naskočilo hned při kliknutí, ne až po uložení.
   Řádek se tu nebarví podle odpovědi jako v 100.2 — tyhle seznamy jsou psané
   jako výčet závad („Chybějící dokumenty"), takže „ano" je špatná zpráva
   a zelené pozadí by matlo.

   `X` (netýká se) je odchylka taky: u otázky typu „byl vydán vnitřní předpis"
   není co nevztáhnout, a i kdyby ano, patří k tomu vysvětlení v komentáři.

   Pro `--expect-x` naopak pravidlo záměrně chybí — očekávání je tam podmíněné
   předchozí otázkou („Bylo toto zjištění zaúčtováno?" se ptá jen když se něco
   zjistilo), takže „ano" je správná odpověď a podbarvit ji by bylo matoucí. */
.memo-form__q--expect-ano:has(.memo-form__ans--no input:checked),
.memo-form__q--expect-ano:has(.memo-form__ans--nk input:checked),
.memo-form__q--expect-ne:has(.memo-form__ans--yes input:checked),
.memo-form__q--expect-ne:has(.memo-form__ans--nk input:checked) {
	background: #fff8ec; box-shadow: inset 3px 0 0 #f2b90b;
}
.memo-form__q--expect-ano:has(.memo-form__ans--no input:checked):hover,
.memo-form__q--expect-ano:has(.memo-form__ans--nk input:checked):hover,
.memo-form__q--expect-ne:has(.memo-form__ans--yes input:checked):hover,
.memo-form__q--expect-ne:has(.memo-form__ans--nk input:checked):hover {
	background: #fdf0d8;
}
