/* Evidence kůrovce – vzhled podle odsouhlaseného návrhu */
/* Písmo IBM Plex (licence OFL) se hostuje lokálně – soubory .woff2 patří do www/fonts (viz README).
   Bez nich se použije systémové písmo. Google Fonts záměrně nepoužíváme (GDPR). */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(../fonts/IBMPlexSans-Regular.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(../fonts/IBMPlexSans-Medium.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(../fonts/IBMPlexSans-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(../fonts/IBMPlexMono-Regular.woff2) format('woff2'); }
:root {
	--ground: #F4F6F2; --surface: #FFFFFF; --ink: #1B2420; --muted: #55605A; --ink2: #3D4842;
	--border: #D9DED8; --border-input: #B9C2BB; --line: #E4E8E2; --head: #EEF2EE;
	--primary: #1F5A43; --primary-ink: #123828; --primary-soft: #DDE8E0;
	--growth: #9A4508; --warn-bg: #FFF4E5; --warn-border: #F0C48E; --warn-ink: #7A3606; --row-warn: #FFF8EC;
	--danger: #8E1F25; --danger-border: #E3B7B7; --info-bg: #E6EEF8; --info: #1F4E89;
	--reader-bg: #F3F0FA; --reader-border: #CFC5E6; --reader: #4B3C78;
	--mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 'IBM Plex Sans', system-ui, sans-serif; }
a { color: var(--primary); } a:hover { color: var(--primary-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); }

.topbar { min-height: 60px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 24px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; text-decoration: none; }
.who { display: flex; gap: 16px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.shell { display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 220px; max-width: 240px; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.badge-count { font-size: 12px; background: var(--primary); color: #fff; padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .nav { max-width: none; flex-direction: row; flex-wrap: wrap; padding: 8px 12px; } .main { padding: 16px; } }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid #C9D0CA; background: #fff; color: var(--ink); border-radius: 6px; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--primary); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-ink); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.btn-danger { border-color: var(--danger-border); color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }

.period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period .btn { width: 44px; padding: 0; font-size: 18px; }
.period h1 { min-width: 190px; text-align: center; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.chip-ok { background: var(--primary-soft); color: var(--primary-ink); }
.chip-warn { background: #FBE6CF; color: var(--warn-ink); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-lock { background: #E9ECE8; color: var(--ink2); }
.chip-danger { background: #F6DADB; color: var(--danger); }
.chip-reader { background: #ECE7F5; color: var(--reader); }
.chip-demo { background: #F2C94C; color: #3A2C00; font-weight: 500; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 600; font-family: var(--mono); }
.tile .unit { font-size: 14px; color: var(--muted); }
.growth { color: var(--growth); } .reduce { color: var(--primary); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { background: var(--head); color: var(--ink2); text-align: left; font-weight: 600; padding: 10px 12px; white-space: nowrap; }
table.data td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.data th.num, table.data td.num { text-align: right; }
table.data tr.row-warn td { background: var(--row-warn); }
table.data tr.row-lock td { background: #F6F7F5; }
table.data tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid #C9D0CA; background: #fff; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; }
.pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }

label { font-size: 13px; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
	min-height: 44px; border: 1px solid var(--border-input); border-radius: 6px; padding: 0 12px; font: inherit; background: #fff; color: var(--ink); width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; }
input[readonly] { background: var(--head); }
input.num { text-align: right; font-family: var(--mono); }
fieldset { margin: 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 18px 20px; }
legend { font-weight: 600; padding: 0 6px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 700px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }
.computed { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; border-radius: 6px; background: var(--head); font-family: var(--mono); font-size: 16px; }
.computed.strong { background: var(--primary); color: #fff; font-weight: 600; font-size: 18px; }
.error, ul.error { color: var(--danger); font-weight: 500; margin: 6px 0 0; padding: 0; list-style: none; }

.flash { border-radius: 8px; padding: 12px 16px; border: 1px solid; }
.flash-success { background: #EEF6F0; border-color: #B9D3C2; }
.flash-info { background: var(--info-bg); border-color: #B7CBE6; }
.flash-error { background: #FBEDEE; border-color: var(--danger-border); color: var(--danger); }
.flash-warning { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.note-reader { display: flex; gap: 12px; align-items: center; background: var(--reader-bg); border: 1px solid var(--reader-border); border-radius: 8px; padding: 12px 16px; font-size: 14px; color: #3A2E5E; }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .grow { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 360px; min-width: 0; }

.chart { display: flex; gap: 2px; align-items: flex-end; height: 220px; border-bottom: 1px solid #9AA59E; background: linear-gradient(#EEF1EC 1px, transparent 1px) 0 0 / 100% 110px; }
.chart .bar { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart .bar span { display: block; width: 70%; background: var(--primary); border-radius: 4px 4px 0 0; }
.chart .bar:hover span { background: var(--primary-ink); }
.chart-x { display: flex; gap: 2px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.chart-x span { flex: 1; text-align: center; }
.progress { width: 120px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; }
.progress span { display: block; height: 100%; background: var(--primary); }

.login-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-hero { flex: 1 1 480px; background: var(--primary); color: #F4F6F2; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-hero p { color: #D5E3DA; font-size: 18px; max-width: 520px; }
.login-hero h1 { font-size: 42px; max-width: 520px; }
.login-form { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-form form, .login-form .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; padding: 36px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
dl.props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
dl.props dt { font-size: 12px; color: var(--muted); } dl.props dd { margin: 0; }

.btn-xs { min-height: 32px; padding: 0 10px; font-size: 13px; }
.flash-standalone { margin: 16px; }
form.inline { display: inline; margin: 0; }
.grow-wide { flex: 1 1 320px; }
.filters .field { min-width: 200px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid-line { stroke: #EEF1EC; stroke-width: 1; }
.chart-svg .axis-line { stroke: #9AA59E; stroke-width: 1; }
.chart-svg .axis-text { fill: var(--muted); font-size: 13px; font-family: var(--mono); }
.chart-svg .bar-rect { fill: var(--primary); }
.chart-svg .bar-g:hover .bar-rect { fill: var(--primary-ink); }
meter { width: 120px; height: 10px; vertical-align: middle; }
.pre { white-space: pre-line; }
table.data th.num { font-family: inherit; }
input:disabled, select:disabled, textarea:disabled { background: var(--head); color: var(--ink); border-color: var(--border); }
.impersonace { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 24px; background: #F2C94C; color: #3A2C00; font-size: 14px; }
.mapa-card .head { align-items: baseline; margin-bottom: 10px; }
.mapa-card h2 { margin: 0; }
.mapa-ram { position: relative; width: 100%; padding-bottom: 80%; background: var(--head); border-radius: 6px; overflow: hidden; }
.mapa-ram iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mapa-prazdna { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; margin: 0; font-size: 14px; }
.mapa-akce { display: inline-flex; align-items: center; gap: 10px; }
.mapa-akce .btn { gap: 6px; }
.mapa-ram:fullscreen { padding-bottom: 0; width: 100vw; height: 100vh; border-radius: 0; background: #fff; }
.mapa-ram.na-celou { position: fixed; inset: 0; z-index: 1000; padding-bottom: 0; border-radius: 0; background: #fff; }
.mapa-zavrit { position: absolute; top: 12px; right: 12px; z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
body.bez-posunu { overflow: hidden; }
[hidden] { display: none !important; }

/* Graf historie skupiny – barvy ověřené validátorem palety (CVD i kontrast) */
:root { --g-pri: #C46A12; --g-asa: #3B73B9; --g-kon: #2E8A5E; }
.graf-card h2 { margin-bottom: 8px; }
.graf-legenda { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink2); }
.graf-legenda li { display: inline-flex; align-items: center; gap: 6px; }
.znacka { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.znacka-pri { background: var(--g-pri); } .znacka-asa { background: var(--g-asa); }
.znacka-kon { width: 14px; height: 2px; background: var(--g-kon); border-radius: 0; box-shadow: 0 0 0 0 transparent; position: relative; }
.graf-historie { width: 100%; height: auto; display: block; overflow: visible; }
.graf-historie .mrizka { stroke: #EEF1EC; stroke-width: 1; }
.graf-historie .osa { stroke: #9AA59E; stroke-width: 1; }
.graf-historie .osa-text { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.graf-historie .osa-aktualni { fill: var(--ink); font-weight: 600; }
.graf-historie .hit { fill: transparent; }
.graf-historie .hit.aktualni { fill: #F1F4EF; }
.graf-historie .graf-mesic:hover .hit { fill: #E8EEE9; }
.graf-historie .sloupec-pri { fill: var(--g-pri); }
.graf-historie .sloupec-asa { fill: var(--g-asa); }
.graf-historie .cara-kon { fill: none; stroke: var(--g-kon); stroke-width: 2; stroke-linejoin: round; }
.graf-historie .bod-kon { fill: var(--g-kon); stroke: #fff; stroke-width: 2; pointer-events: none; }
.graf-historie .hodnota-kon { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--mono); }
