/*
 * technolog.bmrc.cloud — korporátní téma NAD Bootstrapem 5 (převzato ze schvalovani,
 * stejný vizuální jazyk jako reklamace). Barva sekce Výroba (#d97706, pro kontrast AA tmavší #b45309),
 * hustota 14 px, tmavý sbalovací sidebar. Načítá se AŽ po
 * bootstrap.min.css, takže vyhrává. Vlastní komponenty (soubory, náhledy) jsou na konci.
 */

/*
 * Světlý základ; tmavý režim je níž pod :root[data-theme="dark"], stejně jako
 * v Platbách — díky tomu funguje i ruční přepínač, ne jen volba prohlížeče.
 */
:root {
	--primary: #b45309;
	--primary-dark: #92400e;
	--primary-soft: rgba(180, 83, 9, .18);
	--body: #212529;
	--muted: #6c757d;
	--border: #dee2e6;
	--border-soft: #e9ecef;
	--surface: #fff;
	--surface-2: #f8fafc;
	--bg: #f5f6f8;
	--hover: #f8f9fa;
	--danger: #c0392b;
	--success: #2e7d32;
	--radius: 8px;
	--radius-sm: 6px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
	--shadow: 0 .5rem 1rem rgba(16, 24, 40, .09);

	/* Bootstrap tokeny na firemní jantar sekce Výroba */
	--bs-primary: #b45309;
	--bs-primary-rgb: 180, 83, 9;
	--bs-link-color: #b45309;
	--bs-link-color-rgb: 180, 83, 9;
	--bs-link-hover-color: #92400e;
	--bs-border-radius: 8px;
	--bs-border-radius-sm: 6px;
}



html { background: var(--bg); }
body {
	min-height: 100vh;
	background: var(--bg);
	color: var(--body);
	font-size: 14px;                 /* interní appka → hustota dat */
	-webkit-font-smoothing: antialiased;
}

/* ── Bootstrapí modrá → jantar sekce Výroba ──────────────── */
.btn-primary {
	--bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
	--bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark);
	--bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark);
}
.btn-outline-primary {
	--bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary);
	--bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary);
	--bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary);
}
.text-bg-primary { background-color: var(--primary) !important; }
.text-primary { color: var(--primary) !important; }
.form-control:focus, .form-select:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 .2rem var(--primary-soft);
}
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-lg { padding: .6rem 1.15rem; }
/* mikro tlačítka v řádcích tabulky */
.btn-xs { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .4rem; --bs-btn-font-size: .75rem; border-radius: 5px; }

/* ── Karty ───────────────────────────────────────────── */
.card { border-radius: var(--radius); }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-header { border-top-left-radius: var(--radius) !important; border-top-right-radius: var(--radius) !important; }

/* ── Formuláře ───────────────────────────────────────── */
.form-control, .form-select { border-radius: var(--radius-sm); }
.form-label { font-weight: 600; margin-bottom: .3rem; font-size: .85rem; }
.filtercard .form-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.checkrow { display: flex; flex-wrap: wrap; gap: .1rem 1rem; padding-top: .25rem; }
.checkrow .form-check { margin-right: 0; }

/* ── Tabulky (malá hlavička, kapitálky, tlumená) ─────── */
.table > :not(caption) > * > * { padding: .4rem .55rem; }
.table thead th, .table > thead.table-light th {
	font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
	color: var(--muted); font-weight: 600; background: var(--surface);
	border-bottom: 2px solid var(--border); white-space: nowrap;
	position: sticky; top: 0; z-index: 2;
}
.table-hover tbody tr { transition: background .1s ease; }

/* ── Badge / flash ───────────────────────────────────── */
.badge { font-weight: 600; }
.flash-wrap { position: sticky; top: .75rem; z-index: 1030; }
.alert { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }


/* ════════════════════════════════════════════════════════
   Tmavý levý sidebar
   ════════════════════════════════════════════════════════ */
:root {
	--sidebar-w: 224px;
	--sb-bg: #111827; --sb-hover: #1f2937; --sb-fg: #e5e7eb; --sb-muted: #9ca3af; --sb-border: #1f2937;
}
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--sb-bg); color: var(--sb-fg); display: flex; flex-direction: column; z-index: 1040; }
.sidebar__top { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--sb-border); }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px; text-decoration: none; flex: 1; min-width: 0; }
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand span { font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.brandmark { display: block; border-radius: 7px; flex: none; }
.sidebar__toggle { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--sb-muted); cursor: pointer; }
.sidebar__toggle:hover { background: var(--sb-hover); color: var(--sb-fg); }
.sidebar__toggle svg { transition: transform .18s; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1; }
.sidebar__nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 6px; font-weight: 500; color: var(--sb-muted); text-decoration: none; }
.sidebar__nav a:hover { background: var(--sb-hover); color: var(--sb-fg); text-decoration: none; }
.sidebar__nav a.active { background: var(--primary); color: #fff; }
.sidebar__nav .ico { flex: none; }
.sidebar__section { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sb-muted); padding: 14px 14px 4px; font-weight: 700; }
.sidebar__user { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-top: 1px solid var(--sb-border); }
.sidebar__who { line-height: 1.3; min-width: 0; }
.sidebar__who strong { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who a { font-size: 12px; color: var(--sb-muted); }
.sidebar__who a:hover { color: var(--sb-fg); }
.avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.sidebar__user .avatar { width: 34px; height: 34px; font-weight: 600; }
img.avatar { object-fit: cover; }

/* Sbalený sidebar: jen ikony (třída na <html>) */
.sidebar-collapsed { --sidebar-w: 64px; }
.sidebar-collapsed .sidebar__brand span, .sidebar-collapsed .sidebar__nav a span, .sidebar-collapsed .sidebar__who { display: none; }
.sidebar-collapsed .sidebar__top { flex-direction: column; gap: 8px; padding: 12px 0; }
.sidebar-collapsed .sidebar__brand { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar__nav { padding: 12px 8px; }
.sidebar-collapsed .sidebar__nav a { justify-content: center; padding: 9px 0; }
.sidebar-collapsed .sidebar__user { justify-content: center; padding: 14px 0; }
.sidebar-collapsed .sidebar__toggle svg { transform: rotate(180deg); }
.sidebar-collapsed .sidebar__section { display: none; }

/* Obsah vedle sidebaru */
.main { min-height: 100vh; }
body.has-sidebar .main { margin-left: var(--sidebar-w); transition: margin-left .18s; }
.content { max-width: 1800px; margin: 0 auto; padding: 20px 20px 48px; }
.page-head { margin-bottom: 18px; }

/* ── Horní lišta: hledání + přepínač jazyka ──────────── */
.topbar { position: sticky; top: 0; z-index: 1035; background: var(--sb-bg); padding: 10px 18px; display: flex; align-items: center; gap: 16px; }
.topsearch { display: flex; align-items: center; gap: 10px; position: relative; flex: 1; max-width: 720px; }
.topsearch__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9ca3af; display: flex; pointer-events: none; }
.topsearch__input { flex: 1; height: 40px; padding: 0 14px 0 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; color: var(--body); }
.topsearch__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(180, 83, 9, .25); }
.langswitch { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.langswitch__btn { display: inline-flex; align-items: center; padding: 5px; border-radius: 6px; line-height: 0; opacity: .55; transition: opacity .12s, background .12s; }
.langswitch__btn:hover { opacity: 1; background: var(--sb-hover); }
.langswitch__btn.active { opacity: 1; background: var(--sb-hover); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }

@media (max-width: 768px) {
	.sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
	.sidebar__nav { flex-direction: row; flex-wrap: wrap; padding: 0 8px; gap: 2px; flex: 1; }
	.sidebar__section, .sidebar__who { display: none; }
	body.has-sidebar .main { margin-left: 0; }
	.content { padding: 16px 12px 32px; }
	.topbar { flex-wrap: wrap; }
}


/* ════════════════════════════════════════════════════════
   Souhrnné dlaždice
   ════════════════════════════════════════════════════════ */
.statrow { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat--danger strong { color: var(--danger); }
.stat--success strong { color: var(--success); }

.statrow--prio { margin-top: -6px; }
.prio-box { border-left: 4px solid var(--border); }
.prio-box--1 { border-left-color: #c0392b; }
.prio-box--2 { border-left-color: #e07b00; }
.prio-box--3 { border-left-color: var(--primary); }
.prio-box--4 { border-left-color: #8a94a3; }
.prio-box__cnt { display: block; font-size: 11px; color: var(--muted); font-style: normal; }


/* ════════════════════════════════════════════════════════
   Kniha faktur
   ════════════════════════════════════════════════════════ */
table.inv { font-size: 13px; }
table.inv td, table.inv th { vertical-align: middle; }
table.inv td.num, table.inv th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.inv td.nowrap, table.inv th.nowrap { white-space: nowrap; }
table.inv th.firm, table.inv td.firm { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.inv th.ext, table.inv td.ext { max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.inv td.desc { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.inv tbody tr.row-red > * { background: #fdecec; }
table.inv tbody tr.row-red:hover > * { background: #fbe0e0; }
table.inv td.actions a { margin-right: 4px; }
table.inv td.actions a:last-child { margin-right: 0; }

/* řaditelné hlavičky (klientské řazení, viz app.js) */
table.inv thead th.sortable { cursor: pointer; user-select: none; }
table.inv thead th.sortable:hover { color: var(--primary); }
table.inv thead th.sortAsc::after { content: ' \25B2'; font-size: 9px; color: var(--primary); }
table.inv thead th.sortDesc::after { content: ' \25BC'; font-size: 9px; color: var(--primary); }

/* stáří pohledávky */
.age { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.age--0 { background: #e7f7ee; color: #11633f; }
.age--30 { background: #fff4d6; color: #7a5b00; }
.age--60 { background: #ffe8cc; color: #8a4b00; }
.age--90 { background: #ffd9c2; color: #9a3a00; }
.age--180 { background: #fdd0d0; color: #8a1f1f; }
.age--999 { background: #f5a3a3; color: #5a0f0f; }

/* priority placení */
.prio { text-align: center; }
.prio-sel { border: 1px solid var(--border); border-radius: 6px; padding: 1px 4px; font-size: 12px; font-weight: 700; background: #fff; color: var(--muted); cursor: pointer; }
.prio-sel--1 { background: #fdecec; color: #c0392b; border-color: #e0b4b4; }
.prio-sel--2 { background: #fff1e0; color: #a85400; border-color: #e8cba0; }
.prio-sel--3 { background: #e8f1fd; color: #134a8e; border-color: #c5dbf6; }
.prio-sel--4 { background: #eef1f6; color: #5a6470; border-color: #d5dae2; }

.rem-star { color: var(--danger); font-weight: 700; cursor: help; }
.btn-unappr { display: inline-block; margin-left: 4px; color: var(--danger); font-weight: 700; text-decoration: none; border: 1px solid #e0b4b4; border-radius: 5px; padding: 0 5px; font-size: 12px; }
.btn-unappr:hover { background: #fdecec; text-decoration: none; }


/* ════════════════════════════════════════════════════════
   Přehled: graf splatnosti po dnech
   ════════════════════════════════════════════════════════ */
.chart-title { font-size: 16px; font-weight: 700; margin: 4px 0 12px; }
.chart-title--in { color: var(--success); margin-top: 28px; }
.chart-card { padding: 14px 10px; overflow-x: auto; }
.chart { display: block; min-width: 100%; }
.chart-grid { stroke: #eef1f6; stroke-width: 1; }
.chart-axis { stroke: #cfd6e0; stroke-width: 1; }
.chart-ylabel { fill: var(--muted); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.chart-xlabel { fill: var(--muted); font-size: 10.5px; text-anchor: end; }
.chart-xlabel.weekend { fill: #b6bcc6; }
.chart-bar { fill: var(--primary); transition: opacity .1s; cursor: pointer; }
.chart a:hover .chart-bar { opacity: .72; }
.chart-bar--day { fill: var(--primary); }
.chart-bar--day.weekend { fill: #93b4f2; }
.chart-bar--later { fill: #8a94a3; }
.chart-bar--od1 { fill: #e74c3c; }
.chart-bar--od27 { fill: #c0392b; }
.chart-bar--od8 { fill: #922b21; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-swatch.chart-bar--overdue { background: #c0392b; }
.chart-swatch.chart-bar--day { background: var(--primary); }
.chart-swatch.chart-bar--later { background: #8a94a3; }
.chart-legend__note { color: #9aa3ae; }

/* vydané faktury = zelená varianta */
.chart-in .chart-bar--day { fill: var(--success); }
.chart-in .chart-bar--day.weekend { fill: #81c784; }
.chart-in .chart-bar--od1 { fill: #66bb6a; }
.chart-in .chart-bar--od27 { fill: #43a047; }
.chart-in .chart-bar--od8 { fill: var(--success); }
.chart-in .chart-swatch.chart-bar--overdue { background: #43a047; }
.chart-in .chart-swatch.chart-bar--day { background: var(--success); }

/* chybové stránky */
.errorpage { max-width: 560px; margin: 3rem auto; text-align: center; }

/* ── Dvouzáložkový filtr „Omezení / Výpis“ (stejně jako na reklamacích) ── */
.tabs2 { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab2 { padding: 9px 16px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab2:hover { color: var(--bs-body-color); text-decoration: none; }
.tab2.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.pill-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.filter--rows { max-width: 760px; }
.frow { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.frow:last-of-type { border-bottom: 0; }
.frow__label { flex: 0 0 150px; padding-top: 8px; font-size: 13px; font-weight: 600; }
.frow__control { flex: 1; min-width: 0; }
.frow__control--inline { display: flex; align-items: center; gap: 8px; }
.frow__control--inline .form-control { max-width: 200px; }
.frow__sep { color: var(--muted); }
@media (max-width: 575.98px) {
	.frow { flex-direction: column; gap: 4px; }
	.frow__label { flex: none; padding-top: 0; }
}

/* ── Prohlížeč dokumentů na detailu ─────────────────────────────────────
   Pravý sloupec drží PDF z ABRY a přílohy. Na širokém displeji se lepí
   pod hlavičku, aby při rolování levého sloupce zůstal doklad na očích. */

.viewer { position: sticky; top: 12px; display: flex; flex-direction: column; overflow: hidden; }

.viewer__bar {
	display: flex; align-items: center; gap: .5rem;
	border-bottom: 1px solid var(--border);
	background: var(--surface-2);
}

.viewer__tabs { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; scrollbar-width: thin; }

.viewer__tab {
	flex: 0 0 auto;
	border: 1px solid transparent; background: transparent;
	border-radius: .375rem; padding: .3rem .6rem;
	font-size: .8125rem; color: var(--muted); white-space: nowrap; cursor: pointer;
}
.viewer__tab:hover { background: var(--hover); color: var(--body); }
.viewer__tab.active { background: var(--surface); border-color: var(--border); color: var(--body); font-weight: 600; }

.viewer__open { flex: 0 0 auto; }

.viewer__frame { flex: 1 1 auto; background: var(--surface-2); }
.viewer__frame iframe { display: block; width: 100%; height: calc(100vh - 260px); min-height: 480px; border: 0; }

/* Na úzkém displeji nemá smysl lepit ani natahovat na výšku okna. */
@media (max-width: 1199.98px) {
	.viewer { position: static; }
	.viewer__frame iframe { height: 70vh; min-height: 380px; }
}

/* Popisky hlavičky dokladu ve dvou sloupcích. */
.detailgrid { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .35rem .75rem; margin: 0; }
.detailgrid dt { font-weight: 500; color: var(--muted); }
.detailgrid dd { margin: 0; }


/* ── Nabídka příjemek u skladové faktury ────────────────────────────────
   Kandidáti se řadí od nejbližší částky; přesná shoda je zvýrazněná. */
.receipt-cands { display: flex; flex-wrap: wrap; gap: .35rem; }

.receipt-cand {
	display: inline-flex; align-items: baseline; gap: .45rem;
	border: 1px solid var(--border); background: var(--surface);
	border-radius: .375rem; padding: .25rem .55rem;
	font-size: .8125rem; color: var(--body); cursor: pointer; text-align: left;
}
.receipt-cand:hover { background: var(--hover); }
.receipt-cand strong { font-variant-numeric: tabular-nums; }
.receipt-cand span { color: var(--muted); font-size: .95em; }
.receipt-cand--exact { border-color: #198754; }
.receipt-cand--exact strong { color: #198754; }
.receipt-cand.is-picked { background: var(--primary-soft); border-color: var(--primary); }

/* ── Kdo má doklad schválit ─────────────────────────────────────────── */
.steplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.steplist li { display: grid; grid-template-columns: 1.5rem 1fr; gap: .1rem .5rem; align-items: baseline; }
.steplist__lvl { font-weight: 600; color: var(--muted); }
.steplist__who { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .875rem; }
.steplist__why { grid-column: 2; color: var(--muted); font-size: .8125rem; }


/* Dlaždice na přehledu jsou odkazy do agendy, ale nemají vypadat jako text
   s podtržením — proklik naznačuje zvednutý okraj při najetí. */
.stat--link { text-decoration: none; color: inherit; transition: border-color .12s, background .12s; }
.stat--link:hover { border-color: var(--primary); background: var(--hover); }
.stat--link span, .stat--link strong { text-decoration: none; }


/* ── Tmavý režim ─────────────────────────────────────────────────────────
   Volba se drží v localStorage pod klíčem `theme`; layout ji nastaví na
   <html> ještě před vykreslením (data-theme i data-bs-theme), aby stránka
   neproblikla světlou. Bootstrap 5.3 si svoje komponenty přebarví sám,
   tady se řeší jen naše třídy. Levý sidebar je tmavý v obou režimech. */

:root[data-theme="dark"] {
	--body: #e6eaf0;
	--muted: #9aa4b2;
	--border: #2c343f;
	--border-soft: #222933;
	--surface: #171d25;
	--surface-2: #1b222b;
	--bg: #0f141a;
	--hover: #1b222b;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
	--shadow: 0 .5rem 1rem rgba(0, 0, 0, .5);
}

/* Totéž podle systému, když není zvolený světlý režim (standard appek: dva bloky). */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--body: #e6eaf0;
		--muted: #9aa4b2;
		--border: #2c343f;
		--border-soft: #222933;
		--surface: #171d25;
		--surface-2: #1b222b;
		--bg: #0f141a;
		--hover: #1b222b;
		--shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
		--shadow: 0 .5rem 1rem rgba(0, 0, 0, .5);
	}
}

:root[data-theme="dark"] .topsearch__input { background: var(--surface); color: var(--body); border-color: var(--border); }
:root[data-theme="dark"] .topsearch__input::placeholder { color: var(--muted); }
:root[data-theme="dark"] .topsearch__icon { color: var(--muted); }

/* Přepínač motivu — ukazuje ikonu toho, do čeho přepne. */
.theme-toggle {
	width: 34px; height: 34px; flex: none;
	display: grid; place-items: center;
	border: 1px solid var(--border); border-radius: 8px;
	background: var(--surface); color: var(--muted);
	cursor: pointer; padding: 0;
	transition: color .12s, border-color .12s, background .12s;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* Stav „Nezahájeno" nosí Bootstrapí text-bg-light, který ve světlém režimu
   splyne s bílou kartou — obtah mu vrátí tvar v obou motivech. */
.badge.text-bg-light { border: 1px solid var(--border); }

/* ── Hromadné schválení ──────────────────────────────────────────────────
   Lišta se vysune, teprve když je něco označené — jinak jen zabírá místo. */
.bulkbar {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
	margin-bottom: .75rem; padding: .6rem .85rem;
	border: 1px solid var(--primary); border-radius: var(--radius);
	background: var(--primary-soft);
}
.bulkbar__count { font-size: .875rem; color: var(--body); }
.bulkbar__note { flex: 1 1 18rem; min-width: 12rem; }
.pickcol { width: 2.5rem; text-align: center; }
.pickcol .form-check-input { margin: 0; cursor: pointer; }
.pickcol .form-check-input:disabled { cursor: not-allowed; }


/* Zvoneček a přepínač aplikací bmrc.cloud — převzato z plateb (Boris, 1. 10. 2026) */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.bell:hover { background: var(--hover); color: var(--body); }
.bell__count { position: absolute; top: 1px; right: 0; min-width: 16px; padding: 0 4px;
	border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; line-height: 16px;
	text-align: center; font-weight: 600; }
.appswitch { flex: none; }
.appswitch__btn {
	width: 34px; height: 34px; display: grid; place-items: center;
	border: 1px solid var(--sb-hover); border-radius: 8px;
	background: rgba(255, 255, 255, .06); color: #cbd5e1;
	cursor: pointer; padding: 0;
	transition: color .12s, border-color .12s, background .12s;
}
.appswitch__btn:hover, .appswitch__btn[aria-expanded="true"] { color: #fff; border-color: var(--primary); background: rgba(255, 255, 255, .12); }
.appswitch__menu { min-width: 320px; padding: 8px; border-radius: 10px; box-shadow: var(--shadow); }
.appswitch__portal {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--body);
}
.appswitch__portal:hover { background: var(--hover); text-decoration: none; color: var(--body); }
.appswitch__portal-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.appswitch__portal small { display: block; color: var(--muted); font-size: 11.5px; }
.appswitch__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.appswitch__tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 8px; text-decoration: none; color: var(--body); text-align: center; }
.appswitch__tile:hover { background: var(--hover); text-decoration: none; color: var(--body); }
.appswitch__tile.is-current { background: var(--primary-soft); pointer-events: none; }
.appswitch__ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: 16px; line-height: 1; }
.appswitch__name { font-size: 11.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 768px) {
	.appswitch__menu { min-width: 260px; }
	.appswitch__grid { grid-template-columns: repeat(2, 1fr); }
}
.appswitch__ico--logo { background: transparent; }
.appswitch__ico img { display: block; object-fit: contain; }
.appswitch__label { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 6px 2px; }
.appswitch__freq + .appswitch__all { margin-top: 4px; border-top: 1px solid var(--border-soft); }


/* ── Mobil (≤ 768 px): lišta nahoře, menu sbalené pod tlačítkem ─────────────
   Dřív se menu zalomilo do řádků a zabralo až 370 px první obrazovky (Boris,
   1. 10. 2026). Stejně jako v reklamacích a Fidoo; blok je schválně na konci
   souboru, ať přebije starší mobilní pravidla. html.sidebar-open = rozbaleno. */
@media (max-width: 768px) {
	.sidebar { position: static; width: 100%; height: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
	.sidebar__top, .sidebar-collapsed .sidebar__top { display: flex; flex-direction: row; align-items: center; padding: 8px 12px; gap: 6px; width: 100%; }
	.sidebar-collapsed .sidebar__brand { justify-content: flex-start; padding: 6px; }
	.sidebar-collapsed .sidebar__brand span, .sidebar-collapsed .sidebar__nav a span,
	.sidebar-collapsed .sidebar__nav .pill-count { display: revert; }
	.sidebar-collapsed .sidebar__nav a { justify-content: flex-start; padding: 9px 12px; }
	.sidebar__toggle svg, .sidebar-collapsed .sidebar__toggle svg { transform: rotate(-90deg); }
	.sidebar-open .sidebar__toggle svg { transform: rotate(90deg); }
	.sidebar__nav, .sidebar__user, .sidebar__section, .sidebar__sep { display: none; }
	.sidebar-open .sidebar__nav { display: flex; flex-direction: column; flex-wrap: nowrap; padding: 4px 10px 12px; }
	/* odhlášení a jméno musí být v rozbaleném menu vidět (Boris, 4. 10. 2026) */
	.sidebar-open .sidebar__user { display: flex; border-top: 1px solid var(--sb-border, rgba(255,255,255,.1)); padding: 10px 16px; }
	.sidebar-open .sidebar__who { display: block; }
	.sidebar-open .sidebar__section { display: block; }
	body.has-sidebar .main { margin-left: 0; }
	.topbar { flex-wrap: wrap; row-gap: 8px; }
	.topbar .topsearch { order: 10; flex: 1 1 100%; max-width: none; min-width: 0; }
	.topbar .topsearch__input { min-width: 0; width: 100%; }
}


/* Přepínač režimu auto / světlý / tmavý: v režimu auto malé „A“ (vzor Údržba) */
.theme-toggle { position: relative; }
.theme-toggle__mode { position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-weight: 700; line-height: 1; color: var(--primary-text, var(--primary)); pointer-events: none; }
:root:not([data-theme-mode="auto"]) .theme-toggle__mode { display: none; }


/* ════════════════════════════════════════════════════════
   Nákup — našeptávač, řádky objednávky, proklik řádků
   ════════════════════════════════════════════════════════ */
.ac { position: relative; }
.ac-menu {
	position: absolute; z-index: 1050; left: 0; right: 0; top: calc(100% + 2px);
	min-width: 320px; max-height: 340px; overflow-y: auto;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}
.ac-item {
	display: block; width: 100%; text-align: left; border: 0; background: transparent;
	padding: .4rem .65rem; color: var(--body); border-bottom: 1px solid var(--border-soft);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.is-active { background: var(--primary-soft); }
.ac-item small { display: block; color: var(--muted); font-size: .78rem; }
.ac-note { padding: .35rem .65rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.ac-used { color: #d97706; font-size: .75rem; font-weight: 600; white-space: nowrap; }

.orderrows td { vertical-align: middle; }
.orderrows .itemcell { min-width: 300px; }
.orderrows .storecell { min-width: 170px; }
.orderrows input.num { text-align: right; width: 100px; }
.orderrows .js-unit { width: 70px; }
.rows-wrap { overflow: visible; }
@media (max-width: 992px) { .rows-wrap { overflow-x: auto; } }

table.inv tr.rowlink { cursor: pointer; }
table.inv th .sortlink { color: inherit; text-decoration: none; display: inline; }
.sidebar__nav a .pill-count { margin-left: auto; }
.stepflow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.stepflow li { padding: .5rem .65rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.stepflow li.fw-semibold { border-color: var(--primary); }
.stepflow__lvl { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .15rem; }
.stepflow li.text-success .stepflow__lvl { color: inherit; }
.orderrows .ac-menu { min-width: 560px; }

/* Boris 6. 10.: nabídka aplikací se v nízkém okně musí dát posunout */
.appswitch__menu { max-height: calc(100vh - 64px); overflow-y: auto; }
/* částky se nelámou */
table.inv td.num, table.inv th.num { white-space: nowrap; }
/* kontrast (WCAG AA): tlumený text a odkazy v obou režimech */
:root { --muted: #5c636a; }
.text-secondary { color: var(--muted) !important; }
:root[data-theme="dark"] { --primary-text: #b69bfb; }
:root[data-theme="dark"] .content a:not(.btn),
:root[data-theme="dark"] .tab2.active, :root[data-theme="dark"] .content .text-primary { color: var(--primary-text) !important; }
:root[data-theme="dark"] .tab2.active { border-bottom-color: var(--primary-text); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) { --primary-text: #b69bfb; }
}
.rowtype-toggle { cursor: pointer; font-size: .75rem; padding: .3em .55em; }
.rowtype-toggle:hover, .rowtype-toggle:focus-visible { filter: brightness(1.15); outline: 2px solid var(--primary-soft); }
.rowtype-toggle .bi { font-size: .7em; opacity: .75; margin-left: .15em; }

/* ════════════════════════════════════════════════════════
   Technolog — složky, soubory, náhledy fotek
   ════════════════════════════════════════════════════════ */
/* V tmavém režimu je #b45309 na tmavém podkladu málo kontrastní — odkazy světlejší jantar. */
:root[data-theme="dark"] { --bs-link-color: #fbbf24; --bs-link-color-rgb: 251, 191, 36; --bs-link-hover-color: #fcd34d; }
:root[data-theme="dark"] .text-primary { color: #fbbf24 !important; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) { --bs-link-color: #fbbf24; --bs-link-color-rgb: 251, 191, 36; --bs-link-hover-color: #fcd34d; }
	:root:not([data-theme="light"]) .text-primary { color: #fbbf24 !important; }
}

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .95rem; margin-bottom: .25rem; }
.crumbs a { text-decoration: none; }
.crumbs__sep { color: var(--muted); }

.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.folder {
	display: flex; align-items: center; gap: .6rem;
	padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--surface); color: var(--body); text-decoration: none;
	min-width: 0;
}
.folder:hover { border-color: var(--primary); color: var(--body); }
.folder svg { flex: none; color: #d97706; }
.folder__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder__cnt { margin-left: auto; color: var(--muted); font-size: .8rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.tile-file {
	display: flex; flex-direction: column; min-width: 0;
	border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
	background: var(--surface); color: var(--body); text-decoration: none;
}
.tile-file:hover { border-color: var(--primary); color: var(--body); }
.tile-file__img { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.tile-file__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-file__meta { padding: .4rem .55rem; font-size: .8rem; }
.tile-file__name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-file__sub { color: var(--muted); }

.fthumb { width: 44px; height: 34px; border-radius: 4px; object-fit: cover; display: block; background: var(--surface-2); }
.ficon { width: 44px; height: 34px; border-radius: 4px; display: grid; place-items: center; font-size: .65rem; font-weight: 700; color: #fff; letter-spacing: .03em; }
.ficon--excel { background: #1d6f42; }
.ficon--word { background: #2b579a; }
.ficon--pdf { background: #b91c1c; }
.ficon--photo { background: #7c6f64; }
.ficon--other { background: #64748b; }
.ficon--lg { width: 96px; height: 72px; font-size: 1.1rem; border-radius: 8px; }

/* nahrávání: přetažení souborů na plochu */
.dropzone {
	border: 2px dashed var(--border); border-radius: var(--radius); padding: 1rem;
	text-align: center; color: var(--muted); background: var(--surface-2);
	transition: border-color .12s, background .12s;
}
.dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--body); }
.dropzone__list { margin: .5rem 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--body); text-align: left; }

.preview { background: var(--surface-2); border-radius: var(--radius); display: grid; place-items: center; min-height: 240px; overflow: hidden; }
.preview img { max-width: 100%; max-height: 75vh; display: block; }
.preview iframe { width: 100%; height: 75vh; border: 0; display: block; }

th a.sortlink { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sortlink:hover { color: var(--primary); }
.nowrap { white-space: nowrap; }
.mw-0 { min-width: 0; }

/* Huť: dvojitý pruh vyfoukáno (jantar) × naskladněno (zelená) */
.bars { display: grid; gap: 2px; }
.bars span { display: block; height: 6px; border-radius: 3px; min-width: 1px; }
.bars__a { background: #d97706; }
.bars__b { background: #2e7d32; }

/* Šablony: co barva skla, to šablona */
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; background: var(--c, #b45309); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatch--lg { width: 22px; height: 22px; border-radius: 6px; vertical-align: -4px; }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.tplcard {
	display: flex; flex-direction: column; min-width: 0; padding: .85rem 1rem;
	background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--c, #b45309);
	border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.tplcard__head { display: flex; align-items: center; gap: .6rem; color: var(--body); text-decoration: none; margin-bottom: .5rem; min-width: 0; }
.tplcard__head:hover { color: var(--primary); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.legend-dot--a { background: #d97706; }
.legend-dot--b { background: #2e7d32; }
