.first-content { min-height: 70vh; }

.filter-menu { max-height: 50vh; overflow-y: auto; min-width: 14rem; }

/* zoradenie po kliku na hlavicku; bez sipiek (aria-sort ostava pre citacky) */
.table-tasks th[data-sort], .table-tasks th.sortable { cursor: pointer; user-select: none; }

.table-tasks td.thumb { width: 56px; }
.table-tasks td.thumb img { max-height: 40px; max-width: 56px; object-fit: contain; }

@media print {
	nav, footer, .btn, form { display: none !important; }
	body { padding-top: 0; }
}

/* ---- detail zakazky ---- */
.main-image { max-height: 140px; width: auto; }
#qr-code { line-height: 0; padding: 4px; background: #fff; border: 1px solid var(--bs-border-color); border-radius: .375rem; }
#qr-code img, #qr-code canvas { max-width: 110px; height: auto; }
@media (min-width: 768px) { #qr-code img, #qr-code canvas { max-width: 150px; } }

.material-item.is-done { border-left: 8px solid var(--bs-success); }
.material-item.is-open { border-left: 8px solid var(--bs-danger); }
/* jemny farebny nádych hlavičky dielca zľava (zelená = hotové, červená = otvorené) */
.material-item.is-done .accordion-button:not(.collapsed) { background-image: linear-gradient(90deg, rgba(25, 135, 84, .14), transparent 55%); }
.material-item.is-open .accordion-button:not(.collapsed) { background-image: linear-gradient(90deg, rgba(220, 53, 69, .13), transparent 55%); }
.material-item.is-done .accordion-button.collapsed { background-image: linear-gradient(90deg, rgba(25, 135, 84, .09), transparent 45%); }
.material-item.is-open .accordion-button.collapsed { background-image: linear-gradient(90deg, rgba(220, 53, 69, .08), transparent 45%); }
.material-item .accordion-button { padding-top: .75rem; padding-bottom: .75rem; }

.task-info dt { font-weight: 600; }
.activity .btn-lg { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .4rem 1rem; font-size: 1.05rem; }
.activity .btn-start, .activity .btn-end, .activity select.activity-state { box-sizing: border-box; height: 2.9rem; min-height: 0; padding-top: 0; padding-bottom: 0; line-height: 1.2; }
.material-item .accordion-body { padding-bottom: .35rem; }
/* riadok aktivity: dost vzduchu nad aj pod ovladacimi prvkami, aby sa nedotykali vodorovnych ciar */
.material-item .activity.row { --bs-gutter-y: 0; padding-top: .8rem !important; padding-bottom: .8rem !important; }
@media (max-width: 575.98px) { .material-item .activity.row > * + * { margin-top: .5rem; } }
.activity select.activity-state { min-width: 11rem; }

/* ---- rozcestnik administracie ---- */
.admin-tile { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); color: var(--bs-body-color); text-decoration: none; font-weight: 600; min-height: 4.5rem; }
.admin-tile .bi { font-size: 1.75rem; color: var(--bs-primary); }
/* otaznik "kto ma pristup" v pravom hornom rohu dlazdice (mimo odkazu, aby sa dal tuknut bez otvorenia stranky) */
.admin-tile-wrap { position: relative; }
.admin-tile-wrap .tile-help { position: absolute; top: .45rem; right: 1.1rem; padding: .15rem .3rem; border: 0; background: transparent; color: #6b7d94; line-height: 1; border-radius: 50%; }
.admin-tile-wrap .tile-help .bi { font-size: 1.1rem; }
.admin-tile-wrap .tile-help:hover, .admin-tile-wrap .tile-help:focus-visible { color: var(--bs-primary); background: #fff; }
.admin-tile:hover { background: var(--bs-tertiary-bg); border-color: var(--bs-primary); }

/* ---- nahlad obrazka pri nabehnuti na riadok zoznamu ---- */
#image-bubble { position: fixed; z-index: 1080; display: none; padding: 6px; background: #fff; border: 1px solid #9fb4cf; border-radius: .6rem; box-shadow: 0 10px 30px rgba(12, 26, 51, .35); pointer-events: none; }
#image-bubble img { display: block; max-width: 340px; max-height: 260px; border-radius: .35rem; }
.table-tasks td.thumb { width: 44px; color: var(--bs-secondary-color); font-size: 1.1rem; }
@media (hover: none) { #image-bubble { display: none !important; } }

/* uvod detailu zakazky: obrazok | text | QR (mobil: obrazok + QR hore, text pod nimi) */
.task-head { display: grid; gap: 1rem 1.25rem; align-items: start; margin-bottom: 1rem;
	grid-template-columns: auto 1fr auto; grid-template-areas: "img text qr"; }
.task-head-img { grid-area: img; }
.task-head-text { grid-area: text; min-width: 0; }
.task-head-qr { grid-area: qr; }
.task-head .main-image { max-height: 170px; max-width: 240px; width: auto; }
.task-head.no-image { grid-template-columns: 1fr auto; grid-template-areas: "text qr"; }
.task-head.no-image .task-head-img { display: none; }
@media screen and (max-width: 767.98px) {
	.task-head { grid-template-columns: 1fr auto; grid-template-areas: "img qr" "text text"; }
	.task-head.no-image { grid-template-areas: "text qr"; }
	.task-head .main-image { max-height: 130px; max-width: 100%; }
	.task-head-qr { justify-self: end; }
}
/* zakladne udaje zakazky: rovnaka vyska riadkov, text o 1px vacsi */
.task-info { font-size: 17px; --bs-gutter-y: 0; }
.task-info > dt, .task-info > dd { display: flex; align-items: center; min-height: 2.2rem; margin: 0; }
.task-info > dd.text-break { align-items: flex-start; padding-top: .4rem; }
.task-info select.form-select-sm { height: 1.9rem; padding-top: 0; padding-bottom: 0; font-size: 1rem; }
@media (max-width: 575.98px) { .task-info > dt { min-height: 0; padding-top: .5rem; } .task-info > dd { min-height: 0; padding-bottom: .25rem; } }
/* administracia: vacsie dlazdice */
.admin-tile { padding: 2rem 1.75rem; min-height: 7.5rem; gap: 1.25rem; font-size: 1.25rem; border-width: 2px; border-radius: .9rem; box-shadow: var(--shadow-card); }
.admin-tile .bi { font-size: 2.6rem; }
.admin-tile:hover { box-shadow: 0 4px 14px rgba(35, 70, 130, .22); }
.activity-inactive > td { color: #6b7d94; background: #eef1f6 !important; }
.activity-inactive .badge { font-size: .75rem; }
.company-list > li { border-bottom: 1px solid #d6e0ee; }
.company-list > li:last-child { border-bottom: 0; }
.company-inactive { color: #6b7d94; }
.company-inactive .badge { font-size: .75rem; }
/* statistiky: suhrnne karty, rozpad podla aktivity, graf po dnoch */
.stat-card { background: #fff; border: 2px solid #b4c4d9; border-radius: .7rem; padding: .8rem 1rem; box-shadow: var(--shadow-card); height: 100%; }
.stat-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #4a607f; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: #0b1a2e; line-height: 1.2; }
.stat-row + .stat-row { margin-top: .75rem; }
.stat-bar { height: .5rem; background: #e1e9f4; border-radius: .25rem; overflow: hidden; margin-top: .2rem; }
.stat-bar > span { display: block; height: 100%; background: #3f66a8; }
.day-chart { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 11rem; padding-left: 2rem; }
.day-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.day-bar-wrap { position: relative; z-index: 1; flex: 1 1 0; min-height: 0; }
/* mierka: vodorovne ciary 5 h a 10 h; spodok = vyska popisu dna */
.day-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 1.25rem; pointer-events: none; }
.day-grid-line { position: absolute; left: 2rem; right: 0; border-top: 1px solid rgba(74, 96, 127, .22); }
.day-grid-line > span { position: absolute; left: -2rem; width: 1.75rem; transform: translateY(-50%); font-size: .65rem; line-height: 1; text-align: right; color: #4a607f; }
.day-bar { position: absolute; left: 0; right: 0; bottom: 0; background: #3f66a8; border-radius: 3px 3px 0 0; min-height: 2px; }
/* popis dna smie presahovat uzky stlpec (susedne su prazdne), inak sa "11" oreze na "1" */
.day-label { height: 1.25rem; font-size: .7rem; line-height: 1.05rem; text-align: center; color: #4a607f; padding-top: .2rem; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
@media print { .stat-card { box-shadow: none; border-color: #000; } .stat-bar, .day-bar, .stat-bar > span { background: #555 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* zvolene obdobie na strankach statistik (user 2026-11-10: zvyraznit) */
.period-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .75rem; margin-left: auto; margin-right: auto; width: fit-content; max-width: 100%; padding: .55rem 1.4rem; background: #e8f0fb; border: 2px solid #b4c4d9; border-radius: 999px; color: #0b1a2e; }
.period-heading > .bi { font-size: 1.35rem; color: var(--bs-primary); }
.period-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #4a607f; }
.period-dates { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 575.98px) { .period-heading { border-radius: .9rem; padding: .5rem 1rem; } .period-dates { font-size: 1.25rem; } }
@media print { .period-heading { background: none; border: 1px solid #000; border-radius: 0; padding: 4px 12px; } .period-heading > .bi { display: none; } .period-dates { font-size: 15pt; } }
/* administracia: kategorie dlazdic */
.admin-section + .admin-section { margin-top: 2rem; }
.admin-section-title { font-size: 1.15rem; font-weight: 700; color: #1d3a63; margin: 0 0 .75rem; padding-bottom: .4rem; border-bottom: 2px solid #b4c4d9; display: flex; align-items: center; gap: .5rem; }

/* statistiky zakaziek (kontroling) */
.stat-sub { font-size: .75rem; color: #4a607f; margin-top: .15rem; }
.table.table-controlling > :not(caption) > * > * { padding: .35rem .3rem; font-size: .8rem; }
.table.table-controlling thead th { font-size: .68rem; letter-spacing: 0; white-space: nowrap; }
/* siroka tabulka: ostava tabulkou na kazdej sirke (na mobile sa NEPREKLADA na karty), posuva sa vodorovne;
   evid. cislo ostava pri posune pripnute, vodorovny posuvnik je aj NAD tabulkou;
   dlhe texty (nazov, firma) sa skracuju s trojbodkou (cely text v tooltipe) */
.table-responsive.tasks-scroll { overflow-x: auto; overflow-y: hidden; }
/* zrkadlovy vodorovny posuvnik NAD tabulkou (tabulka je dlha, spodny by bol az na konci); synchronizuje ho js v taskStats.latte */
.tasks-scroll-top { overflow-x: auto; overflow-y: hidden; height: 16px; margin-bottom: .25rem; }
.tasks-scroll-top > div { height: 1px; }
.table-controlling td.cell-clip { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-controlling > tbody > tr > td, .table-controlling > tfoot > tr > td { white-space: nowrap; }
.table-controlling > tbody > tr > td:first-child, .table-controlling > thead > tr > th:first-child { position: sticky; left: 0; }
.table-controlling > tbody > tr > td:first-child { z-index: 1; background-color: #fff; }
.table-controlling > thead > tr > th:first-child { z-index: 2; }
/* kontroling: problemove riadky, legenda, oznacenie zoradeneho stlpca (bez sipok) */
.table-controlling > tbody > tr.row-late > td { background-color: #fbd9d9; }
.table-controlling > tbody > tr.row-over > td { background-color: #fdebc8; }
.table-controlling > tbody > tr.row-late > td:first-child { box-shadow: inset 4px 0 0 #d64545; }
.table-controlling > tbody > tr.row-over:not(.row-late) > td:first-child { box-shadow: inset 4px 0 0 #e8920c; }
.legend-swatch.legend-late { background: #fbd9d9; border-color: #d64545; }
.legend-swatch.legend-over { background: #fdebc8; border-color: #e8920c; }
.table-controlling thead th[data-sort]:hover { background: #bfd3ee; }
.table-controlling thead th[aria-sort] { background: #a9c3e8; box-shadow: inset 0 -3px 0 #3f66a8; }
.table.js-sortable thead th[data-sort] { cursor: pointer; user-select: none; }

/* podozrive aktivity v tabulke prace (zabudnuty Stop): nad 12 h oranzova, nad 24 h / chybny datum cervena;
   --bs-table-bg-state ma v Bootstrap 5.3 prednost pred pruhovanim tabulky */
.table > tbody > tr.job-suspect > * { --bs-table-bg-state: #fdebc8; }
.table > tbody > tr.job-suspect-high > * { --bs-table-bg-state: #fbd9d9; }
.table > tbody > tr.job-suspect > td:first-child { box-shadow: inset 4px 0 0 #e8920c, inset 0 0 0 9999px var(--bs-table-bg-state); }
.table > tbody > tr.job-suspect-high > td:first-child { box-shadow: inset 4px 0 0 #d64545, inset 0 0 0 9999px var(--bs-table-bg-state); }
.table > tbody > tr.job-suspect .bi-exclamation-triangle-fill { color: #b86e00; }
.table > tbody > tr.job-suspect-high .bi-exclamation-triangle-fill { color: #c0392b; }
.legend-swatch.legend-job-suspect { background: #fdebc8; border-color: #e8920c; }
.legend-swatch.legend-job-high { background: #fbd9d9; border-color: #d64545; }
/* tlac (user 2026-11-10): ziadne podfarbenie, legenda ani upozornenie - podozrive len tucne trvanie */
@media print {
	.table > tbody > tr.job-suspect > *, .table > tbody > tr.job-suspect-high > * { --bs-table-bg-state: initial; }
	.table > tbody > tr.job-suspect > td:first-child, .table > tbody > tr.job-suspect-high > td:first-child { box-shadow: none; }
	.table > tbody > tr.job-suspect > td.job-duration, .table > tbody > tr.job-suspect-high > td.job-duration { font-weight: 700; }
}

/* statistiky zakaziek: doplnkove ukazovatele a grafy (2026-11-10) */
.stat-of { font-size: .95rem; font-weight: 600; color: #4a607f; }
.cost-split { display: flex; gap: 2px; height: .9rem; margin: .45rem 0 .35rem; }
.cost-split > span { flex-basis: 0; min-width: 3px; }
.cost-split > span:first-child { border-radius: 4px 0 0 4px; }
.cost-split > span:last-child { border-radius: 0 4px 4px 0; }
.cost-split > span:only-child { border-radius: 4px; }
.cost-legend, .chart-legend { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .75rem; color: #4a607f; }
.cost-legend i, .chart-legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.chart-legend { margin-bottom: .5rem; }
.cs-material { background: #2a78d6; }
.cs-hardening { background: #eb6834; }
.cs-work { background: #1baf7a; }
.ms-expected { background: #86b6ef; }
.ms-cost { background: #1c5cab; }
/* mesacny graf: dvojica stlpcov v kazdom mesiaci (pouziva mriezku a popisy z .day-chart) */
.month-chart { height: 13rem; padding-left: 2.4rem; gap: 6px; }
.month-chart .day-grid-line { left: 2.4rem; }
.month-chart .day-grid-line > span { left: -2.4rem; width: 2.1rem; }
.month-pair { display: flex; align-items: flex-end; gap: 2px; }
.month-bar { flex: 1 1 0; min-height: 2px; border-radius: 3px 3px 0 0; }
/* top straty: horizontalne pruhy */
.loss-row { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; padding: .3rem 0; color: inherit; text-decoration: none; font-size: .8rem; border-bottom: 1px solid #e6edf6; }
.loss-row:last-child { border-bottom: 0; }
.loss-row:hover { background: #f2f6fc; }
.loss-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.loss-value { font-weight: 700; white-space: nowrap; color: #0b1a2e; }
.loss-bar { grid-column: 1 / -1; height: .45rem; background: #f3e1e1; border-radius: 3px; overflow: hidden; }
.loss-bar > span { display: block; height: 100%; background: #d03b3b; border-radius: 3px; }
@media print {
	.cost-split > span, .cost-legend i, .chart-legend i, .month-bar, .loss-bar > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.loss-row { break-inside: avoid; }
}
