body { min-height: 100vh; }
.operator-navbar { position: relative; z-index: 1040; padding: .35rem 0 1rem; box-shadow: 0 .15rem .5rem rgba(0,0,0,.14); }
.page-context-strip { position: relative; z-index: 1030; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0 1.25rem; }
.company-tabs { display: flex; align-items: flex-start; gap: .35rem; min-width: 0; }
.company-tab { display: inline-flex; align-items: center; justify-content: center; gap: .32rem; min-height: 2.35rem; padding: .48rem 1rem .55rem; border: 1px solid rgba(33,37,41,.12); border-top: 0; border-radius: 0 0 .55rem .55rem; background: #fff; box-shadow: 0 .18rem .45rem rgba(0,0,0,.11); font-weight: 650; line-height: 1.15; text-decoration: none; white-space: nowrap; transition: box-shadow .15s ease, transform .15s ease; }
.company-tab:hover { transform: translateY(1px); box-shadow: 0 .1rem .3rem rgba(0,0,0,.13); }
.company-tab:focus-visible { outline: 3px solid rgba(13,110,253,.35); outline-offset: 2px; }
.company-tab-primary { border-bottom: 2px solid #ff8c1a; font-size: .88rem; }
.company-tab-primary:hover { color: inherit; }
.company-tab-pd { color: #2f4e6f; }
.company-tab-pd-owner { color: #ff8c1a; }
.company-tab-partner { min-height: 2rem; padding: .38rem .78rem .44rem; border-bottom: 2px solid rgba(34,197,94,.65); color: #52606a; font-size: .73rem; font-weight: 600; opacity: .82; }
.company-tab-partner:hover { color: #34434c; opacity: 1; }
.company-tab-partner-owner { color: #66737c; font-weight: 500; }
.operator-facility-context { position: absolute; right: 1.25rem; bottom: .12rem; display: inline-flex; align-items: center; gap: .3rem; max-width: 24rem; overflow: hidden; color: #aeb8c1; font-size: .63rem; line-height: 1; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.operator-facility-context:hover { color: #fff; }
.building-switcher { margin-top: 1.1rem; padding: 0 1.25rem; border-bottom: 3px solid #2f4e6f; }
.building-switcher-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .45rem; }
.building-tab { position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.55rem; margin-bottom: .45rem; padding: .48rem .85rem; border: 1px solid #d6dce1; border-radius: .55rem; background: #fff; box-shadow: 0 .12rem .3rem rgba(30,42,54,.08); color: #58656f; font-size: .78rem; font-weight: 650; line-height: 1.1; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.building-tab:hover { border-color: #9faab3; color: #2f4e6f; transform: translateY(-1px); }
.building-tab.active { border-color: rgba(25,135,84,.55); background: #f7fcf9; color: #1f4533; box-shadow: 0 .15rem .45rem rgba(25,135,84,.15); }
.building-tab.active::after { position: absolute; right: .55rem; bottom: -.58rem; left: .55rem; height: 3px; border-radius: 999px; background: #ff8c1a; content: ""; }
.building-tab-icon { display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: .38rem; background: #edf2f6; color: #2f4e6f; }
.building-tab.active .building-tab-icon { background: #e5f4ec; color: #198754; }
.building-tab-icon svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.facility-choice-list { display: grid; gap: .65rem; }
.facility-choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: .65rem; padding: .8rem; border: 1px solid #dce1e5; border-radius: .6rem; background: #fff; cursor: pointer; }
.facility-choice:has(input:checked) { border-color: #2f4e6f; background: #f4f7fa; box-shadow: 0 0 0 .16rem rgba(47,78,111,.1); }
.facility-choice-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .45rem; background: rgba(47,78,111,.1); color: #2f4e6f; font-size: 1.1rem; }
.facility-choice strong, .facility-choice small { display: block; }
.facility-choice small { margin-top: .15rem; color: #6c757d; }
.building-management-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.building-management-card { border-top: .22rem solid #2f4e6f; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.building-management-inactive { border-top-color: #adb5bd; opacity: .82; }
.building-management-icon { display: grid; flex: 0 0 auto; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .55rem; background: rgba(47,78,111,.1); color: #2f4e6f; font-size: 1.35rem; }
.building-management-function { margin: .9rem 0 0; color: #43515c; font-size: .84rem; line-height: 1.4; }
.building-management-details { display: grid; gap: .3rem; margin-top: .75rem; color: #6c757d; font-size: .72rem; }
.building-management-details span { overflow-wrap: anywhere; }
.building-management-stats { display: flex; gap: 1rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #e4e8eb; color: #6c757d; font-size: .78rem; }
.building-management-stats strong { color: #34434c; }
.building-management-card .card-body { min-width: 0; }
.building-form .errorlist { margin: .3rem 0 0; padding-left: 1.1rem; color: #dc3545; font-size: .8rem; }
.overview-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.overview-kpi { display: grid; gap: .15rem; padding: .8rem .9rem; border: 1px solid #dfe5e9; border-radius: .55rem; background: #fff; box-shadow: 0 .08rem .25rem rgba(30,42,54,.05); }
.overview-kpi span { color: #6c757d; font-size: .72rem; font-weight: 650; }
.overview-kpi strong { color: #263238; font-size: 1.45rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.overview-kpi-online { border-color: #cde8d8; background: #f5fbf7; }
.overview-kpi-online strong { color: #198754; }
.overview-kpi-warning { border-color: #ffe0a6; background: #fff9ec; }
.overview-kpi-warning strong { color: #997404; }
.overview-kpi-danger { border-color: #f2c6cc; background: #fff6f7; }
.overview-kpi-danger strong { color: #b02a37; }
.section-heading-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.section-heading-row h2 { margin: 0; color: #263238; font-size: 1.08rem; font-weight: 700; }
.device-management-grid, .feed-silo-card-grid, .feed-type-card-grid, .feed-analysis-card-grid, .order-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.device-management-card { border-left-width: .28rem; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.device-management-icon { display: grid; flex: 0 0 auto; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .55rem; background: #eef3f6; color: #2f4e6f; font-size: 1.25rem; font-weight: 800; }
.device-management-reading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .05rem .75rem; margin-top: 1rem; padding: .75rem; border-radius: .5rem; background: #f7faf8; }
.device-management-reading span, .device-management-reading small { color: #6c757d; font-size: .72rem; }
.device-management-reading strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.device-management-reading small { grid-column: 1 / -1; }
.device-management-details { display: grid; gap: .32rem; margin-top: .75rem; color: #5d6972; font-size: .74rem; }
.device-management-details span { overflow-wrap: anywhere; }
.device-management-error { margin-top: .75rem; padding: .55rem .65rem; border: 1px solid #f2c6cc; border-radius: .45rem; background: #fff6f7; color: #b02a37; font-size: .72rem; }
.history-control-panel { display: grid; grid-template-columns: minmax(14rem, 1.35fr) minmax(12rem, 1fr) minmax(7rem, .45fr) auto; gap: .75rem; align-items: end; padding: 1rem; border: 1px solid #dfe5e9; border-radius: .6rem; background: #fff; box-shadow: 0 .08rem .25rem rgba(30,42,54,.05); }
.history-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem; border-left: .28rem solid #2f4e6f; border-radius: .6rem; background: #f7f9fb; }
.history-eyebrow { color: #6c757d; font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.history-hero h2 { margin: .1rem 0; font-size: 1.35rem; }
.history-hero p { margin: 0; color: #6c757d; }
.history-range-badge { padding: .35rem .7rem; border-radius: 999px; background: #e8f5ee; color: #146c43; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.history-chart-card { border: 1px solid #dfe5e9; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.measurement-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .65rem; }
.measurement-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; padding: .75rem; border: 1px solid #dfe5e9; border-radius: .55rem; background: #fff; }
.measurement-card span { display: block; color: #6c757d; font-size: .68rem; }
.measurement-card strong { display: block; color: #263238; font-size: .82rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.filter-card { display: grid; grid-template-columns: minmax(12rem, 18rem) auto; gap: .75rem; align-items: end; padding: .9rem; border: 1px solid #dfe5e9; border-radius: .6rem; background: #fff; box-shadow: 0 .08rem .25rem rgba(30,42,54,.05); }
.veterinary-card-grid, .alert-card-grid, .report-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.veterinary-visit-card { border-top: .25rem solid #2f4e6f; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.veterinary-visit-in_progress { border-top-color: #198754; }
.veterinary-visit-completed { border-top-color: #6c757d; }
.veterinary-visit-cancelled { border-top-color: #dc3545; }
.visit-scope-panel { display: grid; gap: .1rem; margin-top: 1rem; padding: .7rem .75rem; border-radius: .5rem; background: #f7f9fb; }
.visit-scope-panel span, .visit-meta-grid span { color: #6c757d; font-size: .72rem; }
.visit-scope-panel strong { color: #263238; font-size: 1rem; }
.visit-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin-top: .8rem; }
.visit-meta-grid span { display: grid; gap: .1rem; }
.visit-meta-grid strong { color: #263238; font-size: .78rem; overflow-wrap: anywhere; }
.alert-card { border-left: .28rem solid #adb5bd; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); overflow: hidden; }
.alert-card-active { border-left-color: #dc3545; }
.alert-card-pending { border-left-color: #ffc107; }
.alert-card-acknowledged { border-left-color: #0d6efd; }
.alert-card-resolved { border-left-color: #198754; }
.alert-card-summary { display: grid; gap: .8rem; cursor: pointer; list-style: none; }
.alert-card-summary::-webkit-details-marker { display: none; }
.alert-card-summary::after { justify-self: end; color: #6c757d; font-size: .78rem; content: "Szczegóły ▾"; }
.alert-card:not([open]) .alert-card-summary::after { content: "Szczegóły ▸"; }
.alert-card-body { padding: 0 1rem 1rem; }
.alert-card-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .75rem; }
.alert-card-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .55rem; background: #eef3f6; color: #2f4e6f; font-size: .9rem; font-weight: 800; line-height: 1; }
.alert-card-icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alert-card-active .alert-card-icon { background: #fff2f3; color: #b02a37; }
.alert-card-pending .alert-card-icon { background: #fff8e1; color: #997404; }
.alert-card-acknowledged .alert-card-icon { background: #edf4ff; color: #0a58ca; }
.alert-card-resolved .alert-card-icon { background: #edf8f1; color: #146c43; }
.alert-card-kicker { color: #6c757d; font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.alert-card-title { margin: .1rem 0 .15rem; color: #263238; font-size: .95rem; font-weight: 750; line-height: 1.25; }
.alert-card-meta { color: #6c757d; font-size: .76rem; }
.alert-card-status { white-space: nowrap; }
.alert-card-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.alert-card-metric { display: grid; gap: .12rem; padding: .55rem .65rem; border-radius: .5rem; background: #f8fafb; }
.alert-card-metric span { color: #6c757d; font-size: .68rem; font-weight: 700; }
.alert-card-metric strong { color: #263238; font-size: .98rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.alert-threshold-meter { position: relative; height: .45rem; border-radius: 999px; background: #e8edf1; overflow: hidden; }
.alert-threshold-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #8eb8ff 0%, #0d6efd 100%); }
.alert-card-active .alert-threshold-fill { background: linear-gradient(90deg, #ffb2bb 0%, #dc3545 100%); }
.alert-card-pending .alert-threshold-fill { background: linear-gradient(90deg, #ffe08a 0%, #ffc107 100%); }
.alert-card-resolved .alert-threshold-fill { background: linear-gradient(90deg, #9ad8b0 0%, #198754 100%); }
.alert-threshold-marker { position: absolute; top: -.16rem; bottom: -.16rem; width: .2rem; border-radius: 999px; background: #263238; box-shadow: 0 0 0 .08rem rgba(255,255,255,.9); }
.alert-message { margin: 0; color: #384650; font-size: .82rem; line-height: 1.4; }
.alert-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .85rem; }
.alert-value-panel { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-top: .85rem; padding: .65rem .75rem; border-radius: .5rem; background: #f8fafb; }
.alert-value-panel span { color: #6c757d; font-size: .72rem; font-weight: 700; }
.alert-value-panel strong { color: #263238; font-size: .92rem; font-variant-numeric: tabular-nums; text-align: right; }
.alert-action-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; margin-top: .85rem; }
.alert-detail-grid .alert-value-panel { margin-top: 0; }
.alert-kanban { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.alert-kanban-column { min-width: 0; padding: .7rem; border: 1px solid #dfe5e9; border-radius: .6rem; background: #f8fafb; }
.alert-kanban-column-open { border-top: .25rem solid #dc3545; }
.alert-kanban-column-resolved { border-top: .25rem solid #198754; }
.alert-kanban-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; cursor: pointer; list-style: none; }
.alert-kanban-header::-webkit-details-marker { display: none; }
.alert-kanban-header::before { color: #6c757d; font-size: .75rem; content: "▾"; }
.alert-kanban-column:not([open]) .alert-kanban-header::before { content: "▸"; }
.alert-kanban-header h2 { margin: 0; color: #263238; font-size: .92rem; font-weight: 750; }
.alert-kanban-header span { display: inline-flex; align-items: center; justify-content: center; min-width: 1.65rem; height: 1.45rem; padding: 0 .45rem; border-radius: 999px; background: #fff; color: #263238; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.alert-kanban-list { display: grid; gap: .65rem; max-height: calc(100vh - 17rem); margin-top: .65rem; padding-right: .15rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.alert-kanban-empty { padding: 1rem .75rem; border: 1px dashed #ccd4da; border-radius: .5rem; color: #6c757d; font-size: .8rem; text-align: center; }
.alert-kanban-more { width: 100%; }
.report-create-panel { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; max-width: 78rem; }
.report-create-panel .form-select { width: auto; min-width: 8rem; }
.report-create-panel .form-control { width: auto; min-width: 8rem; }
.report-card { border-top: .25rem solid #adb5bd; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.report-card-ready { border-top-color: #198754; }
.report-card-running { border-top-color: #0d6efd; }
.report-card-failed { border-top-color: #dc3545; }
.report-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-top: 1rem; }
.report-meta-grid span { display: grid; gap: .1rem; padding: .5rem .6rem; border-radius: .45rem; background: #f8fafb; color: #6c757d; font-size: .68rem; }
.report-meta-grid strong { color: #263238; font-size: .82rem; overflow-wrap: anywhere; }
.report-error { margin-top: .8rem; padding: .55rem .65rem; border: 1px solid #f2c6cc; border-radius: .45rem; background: #fff6f7; color: #b02a37; font-size: .72rem; }
.report-delete-button { display: inline-flex; align-items: center; justify-content: center; width: 1.65rem; height: 1.65rem; padding: 0; border-radius: .4rem; font-size: 1.15rem; font-weight: 700; line-height: 1; }
.operator-navbar-inner { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 1rem; }
.operator-navigation, .operator-toolbar, .operator-system-status, .operator-account { display: flex; align-items: center; }
.operator-navigation { min-width: 0; gap: .65rem; }
.operator-nav-links { flex-direction: row; min-width: 0; gap: .05rem; }
.operator-nav-links .nav-link { padding: .45rem .58rem; white-space: nowrap; }
/* Rozwijane grupy menu ("Dane", "Ustawienia") na natywnym <details>.
   Bootstrapowy dropdown wymagałby jego JS, którego ten projekt nie ładuje
   wcale — <details> daje to samo bez zależności i działa też bez JS. */
.operator-nav-group { position: relative; }
.operator-nav-group > summary { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; list-style: none; }
.operator-nav-group > summary::-webkit-details-marker { display: none; }
.operator-nav-caret { font-size: .6rem; transition: transform .12s ease; }
.operator-nav-group[open] > summary .operator-nav-caret { transform: rotate(180deg); }
.operator-nav-group[open] > summary { color: #fff; }
.operator-nav-menu {
  position: absolute; z-index: 1050; top: calc(100% + .3rem); left: 0;
  min-width: 12rem; padding: .3rem; border: 1px solid rgba(255,255,255,.16);
  border-radius: .5rem; background: #263238; box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.35);
}
.operator-nav-item {
  display: block; padding: .42rem .6rem; border-radius: .35rem;
  color: #d7dce0; font-size: .82rem; text-decoration: none; white-space: nowrap;
}
.operator-nav-item:hover, .operator-nav-item:focus-visible { background: rgba(255,255,255,.09); color: #fff; }
.operator-nav-item.active { background: rgba(255,140,26,.16); color: #ffb066; }
/* Na wąskim ekranie pasek nawigacji przewija się poziomo, więc menu wypuszczone
   absolutnie zostałoby przycięte przez overflow — wtedy rozwija się w miejscu. */
@media (max-width: 991.98px) {
  .operator-nav-menu { position: static; min-width: 0; margin-top: .25rem; box-shadow: none; }
  .operator-nav-group[open] { flex: 1 0 100%; }
}
.operator-toolbar { flex: 0 0 auto; gap: .7rem; }
.operator-system-status { gap: .3rem; }
.operator-status-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .24rem .42rem; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #d7dce0; font-size: .68rem; line-height: 1; text-decoration: none; white-space: nowrap; }
.operator-status-chip:hover { color: #fff; border-color: rgba(255,255,255,.38); }
.operator-status-chip strong { color: #fff; font-size: .75rem; }
.operator-status-online > span:first-child, .operator-status-online strong { color: #4dd69a; }
.operator-status-alert > span:first-child { color: #ffc107; }
.operator-status-alert.has-alerts { border-color: rgba(255,193,7,.7); background: rgba(255,193,7,.12); }
.operator-status-alert.has-alerts strong { color: #ffc107; }
.operator-status-notification > span:first-child { color: #8ed2ff; }
.operator-status-notification.has-alerts { border-color: rgba(13,202,240,.75); background: rgba(13,202,240,.13); }
.operator-status-notification.has-alerts strong { color: #8ed2ff; }
.operator-push-button { background: transparent; cursor: pointer; }
.operator-push-button-enabled { border-color: rgba(25,135,84,.85); background: rgba(25,135,84,.18); color: #dff6e9; }
.operator-local-badge { padding: .25rem .48rem; border-radius: .35rem; background: #198754; color: #fff; font-size: .67rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.operator-update-time { color: #adb5bd; font-size: .65rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.operator-account { gap: .45rem; padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.18); }
.operator-user { display: inline-flex; align-items: center; gap: .3rem; max-width: 10rem; overflow: hidden; color: #e9ecef; font-size: .72rem; white-space: nowrap; }
.operator-user span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) {
  .operator-navbar { position: sticky; top: 0; }
}
@media (max-width: 1199.98px) {
  .operator-status-label, .operator-update-time { display: none; }
  .operator-toolbar { gap: .4rem; }
  .operator-account { padding-left: .4rem; }
}
@media (max-width: 991.98px) {
  .operator-navbar-inner { flex-wrap: wrap; }
  .operator-navigation { width: 100%; overflow-x: auto; }
  .operator-nav-links { overflow-x: auto; }
  .operator-toolbar { width: 100%; justify-content: space-between; }
  .alert-kanban { grid-template-columns: 1fr; }
  .alert-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .operator-local-badge { display: none; }
  .operator-user span:last-child { max-width: 6rem; }
  .page-context-strip { display: block; padding: 0 .5rem; }
  .company-tabs { flex-wrap: wrap; gap: 0 .35rem; }
  .company-tab-primary { flex: 0 1 auto; max-width: 100%; padding-right: .7rem; padding-left: .7rem; font-size: clamp(.72rem, 3.45vw, .86rem); }
  .company-tab-partner { margin-top: 0; font-size: .66rem; }
  .operator-navbar { padding-bottom: 1.15rem; }
  .operator-facility-context { right: .5rem; max-width: calc(100% - 1rem); }
  .building-switcher { margin-top: .75rem; padding: 0 .5rem; }
  .building-switcher-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .building-tab { flex: 0 0 auto; }
  .building-management-grid { grid-template-columns: 1fr; gap: .75rem; }
  .building-management-icon { width: 2.15rem; height: 2.15rem; border-radius: .45rem; font-size: 1.1rem; }
  .building-management-stats { justify-content: space-between; gap: .5rem; }
  .alert-card-heading { grid-template-columns: auto minmax(0, 1fr); }
  .alert-card-status { grid-column: 2; justify-self: start; }
  .alert-card-metrics { grid-template-columns: 1fr; }
}
.feed-recipe-cell { min-width: 18rem; max-width: 34rem; white-space: normal; }
.feed-analysis-table th, .feed-analysis-table td { white-space: nowrap; }
.feed-management-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .65rem; }
.feed-management-forms details { align-self: start; border: 1px solid #dee2e6; border-radius: .5rem; background: #f8f9fa; }
.feed-management-forms summary { padding: .65rem .75rem; cursor: pointer; font-weight: 600; }
.feed-data-form { padding: .75rem; border-top: 1px solid #dee2e6; background: white; }
.feed-data-form p { margin-bottom: .65rem; }
.feed-data-form label { display: block; margin-bottom: .2rem; font-size: .78rem; font-weight: 600; }
.feed-data-form input, .feed-data-form select, .feed-data-form textarea { display: block; width: 100%; padding: .375rem .75rem; border: 1px solid #ced4da; border-radius: .375rem; }
.feed-data-form textarea { min-height: 6rem; }
.feed-data-form .errorlist { margin-bottom: .25rem; padding-left: 1rem; color: #dc3545; font-size: .75rem; }
.feed-management-silo { border-top: .25rem solid #198754; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.feed-management-silo-critical { border-top-color: #dc3545; }
.feed-management-silo-unknown { border-top-color: #adb5bd; }
.feed-management-stock { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-top: 1rem; }
.feed-management-stock span { color: #6c757d; font-size: .72rem; font-weight: 650; }
.feed-management-stock strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.feed-management-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin-top: .75rem; color: #5d6972; font-size: .72rem; }
.feed-management-alert { margin-top: .75rem; padding: .5rem .65rem; border: 1px solid #f2c6cc; border-radius: .45rem; background: #fff6f7; color: #b02a37; font-size: .72rem; font-weight: 700; }
.feed-delivery-needs_review { border-top-color: #ffc107; }
.feed-delivery-auto_matched, .feed-delivery-confirmed { border-top-color: #198754; }
.feed-delivery-ignored { opacity: .72; }
.feed-type-card, .feed-analysis-card, .order-card { box-shadow: 0 .1rem .32rem rgba(30,42,54,.06); }
.feed-recipe-preview { margin-top: .75rem; color: #384650; font-size: .82rem; line-height: 1.4; }
.feed-contact-row { display: grid; gap: .25rem; margin-top: .8rem; padding-top: .65rem; border-top: 1px solid #e4e8eb; color: #5d6972; font-size: .75rem; }
.feed-analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.feed-analysis-grid span { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .55rem; border-radius: .4rem; background: #f8fafb; color: #6c757d; font-size: .72rem; }
.feed-analysis-grid strong { color: #263238; font-variant-numeric: tabular-nums; }
.timeline-list { display: grid; gap: .65rem; }
.timeline-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .65rem; padding: .75rem; border: 1px solid #dfe5e9; border-radius: .55rem; background: #fff; }
.timeline-dot { width: .72rem; height: .72rem; margin-top: .3rem; border-radius: 50%; background: #198754; box-shadow: 0 0 0 .22rem #e5f3eb; }
.timeline-card-critical .timeline-dot { background: #dc3545; box-shadow: 0 0 0 .22rem #f8d7da; }
.timeline-details { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .45rem; color: #495057; font-size: .75rem; }
.order-card-gridline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin-top: .8rem; }
.order-card-gridline span { display: grid; gap: .1rem; color: #6c757d; font-size: .68rem; }
.order-card-gridline strong { color: #263238; font-size: .78rem; }
@media (max-width: 575.98px) {
  .mobile-card-table { border-collapse: separate; border-spacing: 0 .65rem; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td { display: block; width: 100%; }
  .mobile-card-table tr { overflow: hidden; border: 1px solid #dfe5e9; border-radius: .55rem; background: #fff; box-shadow: 0 .08rem .25rem rgba(30,42,54,.06); }
  .mobile-card-table td { display: grid; grid-template-columns: minmax(6.8rem, .8fr) minmax(0, 1.2fr); gap: .65rem; align-items: start; padding: .52rem .75rem; border-bottom: 1px solid #edf0f2; text-align: right; overflow-wrap: anywhere; white-space: normal; }
  .mobile-card-table td:last-child { border-bottom: 0; }
  .mobile-card-table td::before { content: attr(data-label); color: #6c757d; font-size: .68rem; font-weight: 700; line-height: 1.25; text-align: left; }
  .mobile-card-table td[colspan] { display: block; text-align: center; }
  .mobile-card-table td[colspan]::before { content: none; }
  .feed-recipe-cell { min-width: 0; max-width: none; }
  .feed-analysis-table th,
  .feed-analysis-table td { white-space: normal; }
  .history-control-panel { grid-template-columns: 1fr; }
  .history-hero { flex-direction: column; }
  .measurement-card { grid-template-columns: 1fr; }
  .device-management-grid, .feed-silo-card-grid, .feed-type-card-grid, .feed-analysis-card-grid, .order-card-grid { grid-template-columns: 1fr; }
  .order-card-gridline { grid-template-columns: 1fr; }
  .filter-card, .alert-action-form, .report-meta-grid, .visit-meta-grid { grid-template-columns: 1fr; }
  .alert-kanban { grid-template-columns: 1fr; }
  .alert-kanban-list { max-height: calc(100dvh - 12rem); }
  .report-create-panel { justify-content: stretch; }
  .report-create-panel .form-select, .report-create-panel .form-control, .report-create-panel .btn { width: 100%; }
}
.dashboard-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.building-dashboard-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dashboard-status-area { display: grid; justify-items: end; gap: .35rem; }
.dashboard-status-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; }
.dashboard-status-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .5rem; border: 1px solid #dee2e6; border-radius: 999px; background: #fff; color: #495057; font-size: .76rem; line-height: 1; }
.dashboard-status-chip strong { color: #212529; font-size: .82rem; }
.dashboard-status-icon { color: #6c757d; font-size: .7rem; }
.status-chip-online .dashboard-status-icon, .status-chip-online strong { color: #198754; }
.status-chip-alert .dashboard-status-icon, .status-chip-alert strong { color: #dc3545; }
.status-dot { display:inline-block; width:.65rem; height:.65rem; border-radius:50%; margin-right:.4rem; background:#adb5bd; }
.status-online { background:#198754; }
.status-offline, .status-error { background:#dc3545; }
.status-unknown { background:#ffc107; }
.status-disabled { background:#6c757d; }
.table > :not(caption) > * > * { padding:.75rem; }
.dashboard-section { padding: 1rem; border: 1px solid #dee2e6; border-radius: .75rem; background: rgba(255,255,255,.55); }
.device-card { border: 0; border-left: .3rem solid #adb5bd; box-shadow: 0 .125rem .5rem rgba(0,0,0,.07); }
.status-border-online { border-left-color: #198754; }
.status-border-offline, .status-border-error { border-left-color: #dc3545; }
.status-border-unknown { border-left-color: #ffc107; }
.status-border-disabled { border-left-color: #6c757d; }
.device-status { flex: 0 0 auto; font-size: .8rem; font-weight: 600; }
.status-text-online { color: #198754; }
.status-text-offline, .status-text-error { color: #dc3545; }
.status-text-unknown { color: #997404; }
.status-text-disabled { color: #6c757d; }
.device-metric { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; gap: .75rem; }
.metric-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .65rem; background: #eef5f1; color: #198754; font-size: 1.1rem; font-weight: 700; }
.metric-value { font-size: 1.35rem; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-unit { font-size: .8rem; font-weight: 600; color: #6c757d; }
.min-width-0 { min-width: 0; }
.ventilation-card { max-width: 74rem; }
.climate-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(12rem, .9fr); gap: 1rem; align-items: stretch; min-width: 0; }
.climate-layout > div { min-width: 0; }
.ventilation-readings { display: grid; grid-template-columns: repeat(3, minmax(7.75rem, 1fr)); gap: .65rem; height: 100%; min-width: 0; }
.ventilation-reading { display: grid; grid-template-columns: 2.5rem minmax(5rem, 1fr); align-items: center; gap: .55rem; min-width: 0; padding: .7rem; border-radius: .65rem; background: #f8f9fa; }
.ventilation-reading > div:last-child { min-width: 0; }
.metric-value-lg { font-size: 1.55rem; }
.ventilation-controls { display: grid; gap: .75rem; min-width: 0; padding: .25rem 0; }
.control-icon { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; color: #198754; font-weight: 700; }
.ventilation-progress { height: .65rem; background: #e9ecef; }
.climate-target { margin-top: .25rem; color: #0d6efd; font-size: .68rem; }
.climate-limits { margin-top: .08rem; color: #9a6700; font-size: .62rem; }
.climate-alarm-indicator { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; margin-right: .35rem; border-radius: 50%; background: #dc3545; color: white; font-size: .85rem; animation: alarm-pulse 1.5s infinite; }
@keyframes alarm-pulse { 50% { box-shadow: 0 0 0 .3rem rgba(220,53,69,.15); } }
.control-ventilation { background: #198754; }
.control-heating { background: #dc3545; }
.control-cooling { background: #0dcaf0; }
.climate-history-panel { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #e4e7e9; }
.climate-history-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .65rem; }
.climate-history-heading > div:first-child { display: flex; align-items: baseline; gap: .5rem; }
.climate-history-heading strong { font-size: .78rem; }
.climate-history-heading span { color: #6c757d; font-size: .65rem; }
.climate-chart-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.climate-chart-tab { padding: .2rem .48rem; border: 1px solid #d8dee2; border-radius: 999px; background: #fff; color: #59636b; font-size: .62rem; line-height: 1.2; }
.climate-chart-tab:hover { border-color: #198754; color: #146c43; }
.climate-chart-tab.active { border-color: #198754; background: #e8f5ee; color: #146c43; font-weight: 700; }
.climate-chart-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.climate-chart-block { min-width: 0; padding: .45rem .5rem .25rem; border: 1px solid #e5e9ec; border-radius: .55rem; background: #fbfcfc; }
.climate-chart-title { display: flex; align-items: center; gap: .35rem; margin-bottom: .2rem; color: #495057; font-size: .68rem; font-weight: 700; }
.climate-chart-canvas { position: relative; height: 10.5rem; }
@media (max-width: 767.98px) {
  .ventilation-readings { grid-template-columns: 1fr; }
  .dashboard-topbar { align-items: flex-start; flex-direction: column; }
  .dashboard-status-area { justify-items: start; }
  .dashboard-status-chips { justify-content: flex-start; }
  .climate-history-heading { align-items: flex-start; flex-direction: column; }
  .climate-chart-tabs { justify-content: flex-start; }
}
@media (max-width: 1099.98px) {
  .climate-layout { grid-template-columns: 1fr; }
  .climate-chart-stack { grid-template-columns: 1fr; }
  .climate-chart-canvas { height: 12rem; }
}
.barn-building { min-width: 0; }
.climate-card { border-left-width: .3rem; box-shadow: 0 .125rem .5rem rgba(0,0,0,.06); }
.building-overview { border: 1px solid #dfe3e6; }
.section-plan { border: 1px solid #dfe3e6; }
.section-cycle-label { margin-top: .1rem; color: #198754; font-size: .68rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.cycle-edit-button { font-size: .78rem; line-height: 1; opacity: .7; text-decoration: none; }
.cycle-edit-button:hover { opacity: 1; }
.pen-grid { display: grid; grid-template-columns: repeat(var(--pen-columns), minmax(4.5rem, 1fr)); grid-auto-rows: minmax(5rem, auto); gap: .5rem; overflow-x: auto; padding: .25rem; }
.pen-tile { display: flex; flex-direction: column; min-width: 4.5rem; padding: .55rem .65rem; border: 1px solid #b8d8c8; border-radius: .55rem; background: #eff8f3; color: #15251d; transition: transform .12s ease, box-shadow .12s ease; }
.pen-tile:hover { color: #15251d; transform: translateY(-1px); box-shadow: 0 .25rem .75rem rgba(25,135,84,.14); }
.pen-tile-isolation { border-color: #e7b865; background: #fff4dd; }
.pen-code { color: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; }
.pen-code:hover { color: #0d6efd; }
.pen-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .5rem; }
.pen-header-actions { display: flex; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.pen-name { display: block; color: #495057; font-size: .78rem; line-height: 1.2; }
.pen-main-row, .pen-weight-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem .75rem; margin-top: .3rem; }
.pen-count { font-weight: 700; }
.pen-delta, .pen-cycle { color: #6c757d; font-size: .7rem; line-height: 1.25; }
.pen-cycle { margin-top: .15rem; }
.pen-weight-row { margin-top: .2rem; }
.pen-weight { color: #6c757d; font-size: .72rem; }
.pen-manual-weight { color: #495057; font-weight: 600; }
.pen-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin-top: .45rem; }
.pen-kpi { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon label" "icon value"; align-items: center; column-gap: .4rem; padding: .38rem .45rem; border: 1px solid rgba(25,135,84,.13); border-radius: .45rem; background: rgba(255,255,255,.68); }
.pen-tile-isolation .pen-kpi { border-color: rgba(183,121,0,.18); }
.pen-kpi-icon { grid-area: icon; display: grid; place-items: center; min-width: 1.65rem; height: 1.65rem; border-radius: .4rem; background: #e4f3eb; font-size: .95rem; font-weight: 800; }
.pen-tile-isolation .pen-kpi-icon { background: #ffe4ad; }
.pen-kpi-deaths { border-color: rgba(220,53,69,.25); background: #fff5f5; color: #b02a37; }
.pen-kpi-deaths .pen-kpi-icon { background: #f8d7da; color: #b02a37; }
.pen-kpi-label { grid-area: label; overflow: hidden; color: #6c757d; font-size: .62rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.pen-kpi-value { grid-area: value; font-size: .86rem; line-height: 1.15; white-space: nowrap; }
.pen-mass-meta, .pen-weight-sources { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .65rem; margin-top: .28rem; }
.pen-mass-estimated { color: #9a6700; font-size: .65rem; font-weight: 600; }
.pen-mass-missing { color: #6c757d; font-size: .65rem; font-style: italic; }
.pen-weight-sources { color: #6c757d; font-size: .66rem; }
.isolation-badge { align-self: start; padding: .1rem .35rem; border-radius: .4rem; background: #f0ad32; color: #332203; font-size: .65rem; font-weight: 700; }
.pen-action-button { min-width: 1.75rem; padding: .08rem .32rem; line-height: 1.35; font-weight: 700; }
.pen-empty-state { display: grid; place-items: center; flex: 1; min-height: 5.5rem; padding: .65rem 0 .25rem; text-align: center; }
.pen-empty-label { margin-bottom: .45rem; color: #6c757d; font-size: .8rem; }
.isolation-empty-note { max-width: 18rem; color: #9a6700; font-size: .7rem; line-height: 1.35; }
.pen-empty-note { max-width: 18rem; color: #6c757d; font-size: .7rem; line-height: 1.35; }
.section-cycle-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.section-cycle-actions .btn:disabled { opacity: .45; }
.pen-action-modal { position: fixed; z-index: 1080; inset: 0; display: grid; place-items: center; padding: 1rem; background: rgba(15,23,42,.55); }
.pen-action-dialog { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 0; border: 0; border-radius: .75rem; background: white; box-shadow: 0 1rem 3rem rgba(0,0,0,.25); }
.pen-action-dialog form { padding: 1.25rem; }
.pen-action-followup { padding: 1.25rem; }
/* Suma z gorszego źródła — tylda i kolor mają powiedzieć „to szacunek”, zanim
   ktoś przepisze liczbę do rozliczenia. */
.report-summary-approx { color: #997404; }
/* „Masa całkowita” pokazuje się tylko przy zakończeniu obsady. Gdy jest ukryta,
   zaokrąglenie lewej krawędzi grupy musi przejąć następny przycisk — Bootstrap
   liczy je po pozycji w DOM, nie po widoczności. */
#pen-stocking-mode-total-label.d-none + .btn-check + .btn { border-top-left-radius: var(--bs-border-radius, .375rem); border-bottom-left-radius: var(--bs-border-radius, .375rem); }
.stocking-summary { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .8rem; border-radius: .5rem; background: #f1f8f4; }
.stocking-list { display: grid; gap: .4rem; max-height: 15rem; overflow-y: auto; }
.stocking-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .4rem .5rem; border: 1px solid #dee2e6; border-radius: .45rem; background: #fff; }
.stocking-number { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #e9ecef; color: #495057; font-size: .75rem; font-weight: 700; }
.empty-plan { padding: 2rem 1rem; border: 1px dashed #c8ced3; border-radius: .6rem; color: #6c757d; text-align: center; background: #f8f9fa; }
.section-devices, .infrastructure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
.section-device { padding: .75rem; border: 1px solid #e4e7e9; border-left: .25rem solid #adb5bd; border-radius: .5rem; background: white; }
.section-device.status-border-online { border-left-color: #198754; }
.section-device.status-border-offline, .section-device.status-border-error { border-left-color: #dc3545; }
.device-consumption { display: grid; gap: .25rem; margin-top: .65rem; padding-top: .55rem; border-top: 1px solid #e4e7e9; }
.feed-silo-panel { margin-top: .65rem; padding: .55rem; border: 1px solid #dfe5e1; border-radius: .45rem; background: #f8faf9; }
.feed-stock-warning { border-color: #f0ad32; background: #fff8e8; }
.feed-stock-critical { border-color: #dc3545; background: #fff0f1; }
.feed-silo-heading, .feed-level-labels, .feed-contact-actions { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.feed-silo-heading { font-size: .7rem; font-weight: 700; }
.feed-order-warning { color: #b02a37; }
.feed-order-critical { color: #dc3545; }
.feed-order-state { color: #0d6efd; font-weight: 700; }
.feed-order-state-sent { color: #0d6efd; }
.feed-order-state-confirmed { color: #146c43; }
.feed-order-state-delivered { color: #198754; }
.feed-order-delivery { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .5rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #dfe5e1; color: #495057; font-size: .64rem; }
.feed-order-delivery strong { color: #146c43; }
.feed-layer-list { display: flex; flex-direction: column; gap: .2rem; margin-top: .4rem; padding: .35rem .5rem; border-radius: .35rem; background: #eef2f0; }
.feed-layer-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .64rem; color: #495057; }
.feed-layer-row strong { color: #212529; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-level-scale { position: relative; height: .55rem; margin-top: .45rem; overflow: hidden; border-radius: 999px; background: #e9ecef; }
.feed-level-fill { height: 100%; background: #198754; }
.feed-stock-warning .feed-level-fill { background: #f0ad32; }
.feed-stock-critical .feed-level-fill { background: #dc3545; }
.feed-reorder-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc3545; }
.feed-level-labels { margin-top: .25rem; color: #6c757d; font-size: .58rem; }
.feed-contact-actions { justify-content: flex-end; margin-top: .5rem; }
.feed-contact-actions .feed-order-button,
.feed-contact-actions .feed-order-details-button { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; font-size: 1rem; }
.feed-order-stock, .feed-order-summary { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .75rem; border-radius: .5rem; background: #f3f7f5; }
.feed-order-stock span, .feed-order-summary span { color: #6c757d; }
.feed-order-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.feed-order-channel { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem; border: 1px solid #ced4da; border-radius: .5rem; cursor: pointer; }
.feed-order-channel:has(input:checked) { border-color: #198754; background: #e8f5ee; color: #146c43; font-weight: 700; }
.feed-order-channel:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.feed-days-remaining { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .5rem; margin-top: .35rem; color: #495057; font-size: .62rem; }
.feed-days-remaining span { color: #6c757d; }
.feed-days-remaining .feed-forecast-source { flex-basis: 100%; color: #087990; font-weight: 600; }
.device-consumption > div { display: flex; justify-content: space-between; align-items: baseline; gap: .65rem; font-size: .7rem; }
.device-consumption span { color: #6c757d; }
.device-consumption strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hourly-peaks { display: grid; gap: .28rem; margin-top: .55rem; padding-top: .5rem; border-top: 1px solid #e4e7e9; }
.hourly-peaks-heading { display: flex; justify-content: space-between; align-items: center; color: #52606a; font-size: .68rem; font-weight: 700; }
.hourly-peaks-heading > span > span { color: #198754; }
.hourly-peaks-heading small { color: #8b959d; font-size: .58rem; font-weight: 500; }
.hourly-peak-row { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr) auto; align-items: center; gap: .4rem; color: #495057; font-size: .68rem; }
.hourly-peak-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hourly-peak-marker { width: .48rem; height: .48rem; margin-left: .25rem; border-radius: 50%; background: #198754; box-shadow: 0 0 0 .18rem #e5f3eb; }
.hourly-chart { margin-top: .55rem; padding-top: .5rem; border-top: 1px solid #e4e7e9; }
.hourly-chart-clickable[role="button"] { cursor: pointer; border-radius: .25rem; transition: background-color .12s; }
.hourly-chart-clickable[role="button"]:hover { background: #f6f8f9; }
.hourly-chart-clickable[role="button"]:focus-visible { outline: 2px solid #198754; outline-offset: 2px; }
/* Przycisk historii w nagłówku kafelka — jedyna kontrolka dostępna
   z klawiatury dla urządzeń bez paska godzinowego (wentylacja, wodomierz
   przed uzdatniaczem). */
.device-history-button { margin-right: .3rem; padding: 0 .15rem; border: 0; background: none; font-size: .72rem; line-height: 1; opacity: .55; cursor: pointer; transition: opacity .12s; }
.device-history-button:hover, .device-history-button:focus-visible { opacity: 1; }
.climate-history-links { display: inline-flex; flex-wrap: wrap; gap: .1rem; margin-left: .35rem; }
.climate-history-links .device-history-button { font-size: .62rem; white-space: nowrap; }
.hourly-chart-heading { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; color: #6c757d; font-size: .63rem; }
.hourly-chart-heading strong { color: #495057; font-weight: 600; }
.hourly-chart-bars { display: grid; grid-template-columns: repeat(24, minmax(2px, 1fr)); align-items: end; gap: 2px; height: 4.6rem; padding: .25rem .2rem 0; border-bottom: 1px solid #cfd6db; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), #edf0f2 25%); }
.hourly-chart-bar { min-height: 0; border-radius: 2px 2px 0 0; background: #75b798; transition: filter .15s ease; }
.hourly-chart-bar:hover { filter: brightness(.88); }
.hourly-chart-bar-medium { background: #20a96b; }
.hourly-chart-bar-high { background: #087f5b; }
.hourly-chart-axis { display: flex; justify-content: space-between; margin-top: .15rem; color: #8b959d; font-size: .52rem; font-variant-numeric: tabular-nums; }
/* Kafelek stoi w wąskiej kolumnie bocznej, więc układ bilansu musi reagować na
   szerokość KAFELKA, nie okna — stąd container queries (@media niżej zostaje
   jako fallback dla starszych przeglądarek). */
.water-balance { container-type: inline-size; margin-top: .7rem; padding: .6rem; border: 1px solid #b9ddec; border-radius: .55rem; background: linear-gradient(135deg, #f4fbfe, #eef8fc); }
.water-balance-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .65rem; }
.water-balance-title { color: #087990; font-size: .72rem; font-weight: 700; }
.water-balance-subtitle, .water-balance-period { color: #6c757d; font-size: .58rem; }
.water-balance-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem; }
.water-balance-tab { padding: .16rem .38rem; border: 1px solid #c8dce5; border-radius: 999px; background: #fff; color: #58717c; font-size: .55rem; line-height: 1.2; }
.water-balance-tab:hover { border-color: #0d6efd; color: #0d6efd; }
.water-balance-tab.active { border-color: #087990; background: #087990; color: #fff; font-weight: 700; }
.water-balance-panel { margin-top: .55rem; }
.water-balance-period { margin-bottom: .4rem; text-align: right; }
.water-flow-diagram { display: grid; grid-template-columns: minmax(0, .85fr) 1.35rem 4.25rem minmax(0, 1.35fr); align-items: center; gap: .4rem; }
.water-flow-diagram > * { min-width: 0; }
.water-flow-node { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon label" "icon value"; align-items: center; gap: .08rem .35rem; padding: .45rem; border-radius: .45rem; background: #dff3fb; color: #075985; }
.water-flow-node .water-flow-icon { grid-area: icon; font-size: 1.2rem; }
.water-flow-node > span:not(.water-flow-icon) { grid-area: label; font-size: .58rem; }
.water-flow-node strong { grid-area: value; font-size: .8rem; white-space: nowrap; }
.water-flow-direction { display: grid; place-items: center; color: #249ee9; font-size: 1.35rem; font-weight: 800; line-height: 1; }
.water-flow-treatment { display: grid; place-items: center; align-content: center; gap: .12rem; min-height: 3.2rem; padding: .35rem .3rem; border: 1px solid #cbd5db; border-radius: .5rem; background: #fff; color: #52606a; box-shadow: 0 .08rem .2rem rgba(34,74,94,.08); }
.water-flow-treatment .water-treatment-icon { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: .4rem; background: #e7f4f8; color: #408ba5; font-size: 1rem; }
.water-flow-treatment > span:last-child { font-size: .48rem; font-weight: 600; }
.water-flow-branches { display: grid; gap: .45rem; }
.water-flow-branch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .45rem; min-width: 0; }
.water-flow-branch-line { width: 100%; height: .38rem; overflow: hidden; border-radius: 999px; background: #dce4e8; }
.water-flow-branch-line span { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.water-flow-output .water-flow-branch-line span { background: #198754; }
.water-flow-waste .water-flow-branch-line span { background: #5ba9c7; }
.water-flow-branch > div:last-child { display: grid; grid-template-columns: 1fr auto; gap: 0 .35rem; font-size: .56rem; }
.water-flow-branch strong { font-size: .7rem; white-space: nowrap; }
.water-flow-branch small { grid-column: 1 / -1; color: #6c757d; font-size: .5rem; }
.water-flow-output { color: #146c43; }
.water-flow-waste { color: #087990; }
.water-balance-equation { display: flex; justify-content: center; align-items: baseline; gap: .35rem; margin-top: .55rem; padding-top: .4rem; border-top: 1px solid rgba(8,121,144,.15); color: #6c757d; font-size: .62rem; font-variant-numeric: tabular-nums; }
.water-balance-equation strong { color: #263238; }
.water-balance-unavailable { display: flex; align-items: center; gap: .55rem; min-height: 4.2rem; padding: .7rem; border: 1px dashed #b9cbd3; border-radius: .45rem; background: rgba(255,255,255,.65); color: #6c757d; font-size: .62rem; }
.water-balance-unavailable > span { font-size: 1.2rem; }
.water-balance-unavailable strong { display: block; margin-bottom: .12rem; color: #495057; font-size: .72rem; }
.water-balance-panel-invalid .water-balance-unavailable { border-color: #f0ad32; background: #fff8e8; color: #8a6700; }
.water-balance-panel-invalid .water-balance-unavailable strong { color: #9a6700; }
.water-balance-footer { display: flex; justify-content: space-between; gap: .5rem; margin-top: .55rem; padding-top: .45rem; border-top: 1px solid #cfe3eb; color: #6c757d; font-size: .6rem; }
.water-balance-footer strong { color: #263238; white-space: nowrap; }
/* Główny przełącznik układu — wg szerokości kafelka. */
@container (max-width: 34rem) {
  .water-balance-heading { flex-direction: column; }
  .water-balance-tabs { justify-content: flex-start; }
  .water-flow-diagram { grid-template-columns: minmax(0, 1fr) 1.2rem 4rem; }
  .water-flow-branches { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .water-flow-branch { grid-template-columns: minmax(0, 1fr); }
}
/* Fallback dla przeglądarek bez @container. */
@media (max-width: 575.98px) {
  .water-balance-heading { flex-direction: column; }
  .water-balance-tabs { justify-content: flex-start; }
  .water-flow-diagram { grid-template-columns: minmax(0, 1fr) 1.2rem 4rem; }
  .water-flow-branches { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .water-flow-branch { grid-template-columns: minmax(0, 1fr); }
}
.section-summary-outer { overflow: hidden; border: 1px solid #dce7e1; border-radius: .6rem; background: linear-gradient(135deg, #f8fbf9, #f1f7f4); }
.section-summary { border: none; background: none; }
.section-summary-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem .65rem; border-bottom: 1px solid #dce7e1; color: #44534b; font-size: .76rem; }
.section-summary-header span { color: #6c757d; font-size: .65rem; }
.collapse-toggle { padding: 0 .25rem; line-height: 1; text-decoration: none; transition: transform .15s ease; }
.collapse-toggle.collapsed { transform: rotate(-90deg); }
.pen-grid-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .1rem .1rem .4rem; font-size: .8rem; color: #44534b; }
.building-chart-presets { display: flex; gap: .3rem; }
.building-chart-preset-button { border: 1px solid #dce7e1; background: #fff; color: #44534b; }
.building-chart-preset-button.active { background: #198754; border-color: #198754; color: #fff; }
.building-chart-mode { display: flex; gap: .3rem; }
.building-chart-mode-button { border: 1px solid #dce7e1; background: #fff; color: #44534b; }
.building-chart-mode-button.active { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.building-chart-bucket { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; }
.building-chart-bucket-select { width: auto; min-width: 5rem; }
.section-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; padding: .55rem; }
.section-summary-kpi { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon label" "icon value" "note note"; align-items: center; column-gap: .45rem; min-width: 0; padding: .45rem .5rem; border: 1px solid rgba(25,135,84,.1); border-radius: .5rem; background: rgba(255,255,255,.82); }
.section-summary-icon { grid-area: icon; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: .45rem; background: #e5f3eb; color: #146c43; font-weight: 800; }
.section-summary-label { grid-area: label; overflow: hidden; color: #6c757d; font-size: .64rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.section-summary-kpi strong { grid-area: value; font-size: .9rem; line-height: 1.2; white-space: nowrap; }
/* Kafelek z historią jest przyciskiem — resetujemy wygląd <button>, żeby
   siatka podsumowania wyglądała identycznie jak przed zmianą, i dokładamy
   tylko sygnały klikalności (kursor, hover, focus, ikonka wykresu w rogu). */
.section-summary-kpi-chartable { position: relative; appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s, background-color .12s; }
.section-summary-kpi-chartable:hover { border-color: rgba(25,135,84,.45); background: #fff; box-shadow: 0 .15rem .5rem rgba(25,135,84,.12); }
.section-summary-kpi-chartable:focus-visible { outline: 2px solid #198754; outline-offset: 2px; }
.section-summary-chart-hint { position: absolute; top: .3rem; right: .35rem; font-size: .58rem; line-height: 1; opacity: 0; transition: opacity .12s; }
.section-summary-kpi-chartable:hover .section-summary-chart-hint,
.section-summary-kpi-chartable:focus-visible .section-summary-chart-hint { opacity: .75; }
.metric-history-dialog { display: flex; flex-direction: column; gap: .7rem; width: min(56rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.1rem 1.25rem 1.25rem; border-radius: .75rem; background: #fff; box-shadow: 0 1rem 3rem rgba(0,0,0,.25); }
.metric-history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.metric-history-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.metric-history-cycle { white-space: nowrap; }
/* Trzy kontrolki (presety, podziałka, opis cyklu) mieszczą się w rzędzie na
   biurku; na telefonie `flex-wrap` łamie je, a `space-between` rozjechałby
   wtedy pojedynczy element na całą szerokość. */
@media (max-width: 36rem) {
  .metric-history-toolbar { justify-content: flex-start; }
  .metric-history-toolbar .building-chart-presets { width: 100%; }
  .metric-history-cycle { white-space: normal; }
}
/* Selektor złożony, bo `.report-chart-frame` jest w tym pliku NIŻEJ i przy
   równej swoistości wygrałby wysokością 230px. */
.report-chart-frame.metric-history-frame { height: min(52vh, 22rem); margin-bottom: 0; }
.metric-history-note { line-height: 1.35; }
.section-summary-deaths { border-color: rgba(220,53,69,.22); background: #fff5f5; }
.section-summary-deaths .section-summary-icon { background: #f8d7da; color: #b02a37; }
.section-summary-deaths strong { color: #b02a37; }
.section-summary-note { grid-area: note; margin-top: .25rem; color: #8a6700; font-size: .6rem; line-height: 1.15; }
.section-stock-breakdown { grid-area: note; display: flex; flex-wrap: wrap; gap: .2rem .55rem; margin-top: .3rem; font-size: .62rem; }
.stock-healthy { color: #198754; }
.stock-isolation { color: #b77900; }
.section-cycle-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; padding: .65rem .75rem; border: 1px solid #b8d8c8; border-radius: .55rem; background: #f3faf6; }
.section-cycle-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; background: #dff1e7; color: #198754; font-size: 1.1rem; font-weight: 800; }
.section-cycle-title { font-size: .78rem; font-weight: 700; }
.section-cycle-dates { margin-top: .15rem; color: #6c757d; font-size: .68rem; }
.section-cycle-deaths { color: #dc3545; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.infrastructure-item { padding: .75rem; border: 1px solid #e4e7e9; border-radius: .5rem; background: #f8f9fa; }
@media (max-width: 991.98px) {
  .pen-grid { grid-template-columns: repeat(var(--pen-columns), minmax(4rem, 1fr)); }
  .section-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pen-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .section-cycle-panel { grid-template-columns: auto minmax(0, 1fr); }
  .section-cycle-deaths { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .building-dashboard-header { align-items: flex-start; flex-direction: column; }
}

.veterinary-page { display: grid; gap: 1.1rem; color: #22313d; }
.veterinary-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 0 .35rem; border-bottom: 3px solid #2f4e6f; }
.veterinary-eyebrow { color: #ff8c1a; font-size: .72rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.veterinary-hero h1 { margin: .1rem 0 .25rem; color: #1f2d38; font-size: clamp(1.55rem, 2.6vw, 2.25rem); font-weight: 700; line-height: 1.12; }
.veterinary-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; color: #6c757d; font-size: .88rem; font-weight: 600; }
.veterinary-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.veterinary-meta span:not(:first-child)::before { width: .35rem; height: .35rem; border-radius: 50%; background: #ff8c1a; content: ""; }
.veterinary-scope-line { display: flex; flex-wrap: wrap; gap: .35rem .55rem; margin-top: .45rem; color: #52606a; font-size: .76rem; font-weight: 650; }
.veterinary-scope-line span { padding: .18rem .48rem; border: 1px solid #dce3e8; border-radius: 999px; background: #fff; }
.veterinary-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.veterinary-finish-button { display: inline-flex; align-items: center; gap: .4rem; font-weight: 750; }
.veterinary-summary { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(18rem, .7fr); gap: 1rem; align-items: stretch; }
.veterinary-workspace { display: grid; grid-template-columns: minmax(20rem, .9fr) minmax(24rem, 1.25fr); gap: 1rem; align-items: start; }
.veterinary-panel { overflow: hidden; border: 1px solid #dfe5e9; border-radius: .55rem; background: #fff; box-shadow: 0 .12rem .42rem rgba(30,42,54,.07); }
.veterinary-panel > .veterinary-section-heading, .veterinary-panel > form, .veterinary-panel > .row, .veterinary-panel > .veterinary-recommendation-grid, .veterinary-panel > .veterinary-add-panel, .veterinary-panel > .veterinary-assessment-current { margin-right: 1rem; margin-left: 1rem; }
.veterinary-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 0 .8rem; border-bottom: 1px solid #edf0f2; }
.veterinary-section-heading h2 { margin: 0; color: #263946; font-size: 1.02rem; font-weight: 760; }
.veterinary-section-heading span { display: block; margin-top: .15rem; color: #7a858d; font-size: .72rem; }
.veterinary-summary-main { padding-bottom: 1rem; border-top: .22rem solid #2f4e6f; }
.veterinary-scope-panel { border-top: .22rem solid #ff8c1a; }
.veterinary-scope-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; padding-bottom: 1rem; }
.veterinary-scope-form .mb-3 { margin-bottom: 0 !important; }
.veterinary-scope-form label { color: #46535d; font-size: .72rem; font-weight: 750; }
.veterinary-summary-main > .veterinary-section-heading { margin-right: 1rem; margin-left: 1rem; }
.veterinary-period-tabs { display: inline-flex; gap: .18rem; padding: .18rem; border: 1px solid #d8dee2; border-radius: .5rem; background: #f8fafb; }
.veterinary-period-tabs a { min-width: 3.35rem; padding: .28rem .55rem; border-radius: .35rem; color: #59636b; font-size: .72rem; font-weight: 700; text-align: center; text-decoration: none; }
.veterinary-period-tabs a.active { background: #2f4e6f; color: #fff; box-shadow: inset 0 -.12rem 0 #ff8c1a; }
.veterinary-summary-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; padding: 1rem; }
.veterinary-summary-column { display: grid; gap: .85rem; min-width: 0; }
.veterinary-column-title { margin: 0; color: #2f4e6f; font-size: .8rem; font-weight: 850; text-transform: uppercase; }
.veterinary-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.veterinary-kpi { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon label" "icon value" "note note"; align-items: center; column-gap: .55rem; min-height: 5.2rem; padding: .72rem; border: 1px solid rgba(47,78,111,.12); border-radius: .55rem; background: linear-gradient(135deg, #fbfcfd, #f4f7fa); }
.veterinary-kpi-icon { grid-area: icon; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: .48rem; background: rgba(47,78,111,.1); color: #2f4e6f; font-weight: 850; }
.veterinary-kpi > span:not(.veterinary-kpi-icon) { grid-area: label; overflow: hidden; color: #7a858d; font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.veterinary-kpi strong { grid-area: value; min-width: 0; overflow: hidden; color: #1f2d38; font-size: clamp(1.05rem, 1.6vw, 1.55rem); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.veterinary-kpi small { grid-area: note; margin-top: .35rem; color: #77828a; font-size: .64rem; line-height: 1.2; }
.veterinary-kpi-warning { border-color: rgba(255,140,26,.28); background: linear-gradient(135deg, #fffaf4, #fff3e5); }
.veterinary-kpi-warning .veterinary-kpi-icon { background: #ffe4c4; color: #9a5200; }
.veterinary-kpi-danger { border-color: rgba(220,53,69,.22); background: linear-gradient(135deg, #fff8f8, #fff0f1); }
.veterinary-kpi-danger .veterinary-kpi-icon, .veterinary-kpi-danger strong { color: #b02a37; }
.veterinary-kpi-danger .veterinary-kpi-icon { background: #f8d7da; }
.veterinary-timeline-strip { padding: .75rem .85rem; border: 1px solid #ffd9ad; border-radius: .55rem; background: #fff9f1; }
.veterinary-timeline-strip div { display: flex; justify-content: space-between; gap: 1rem; color: #6b3f07; font-size: .8rem; }
.veterinary-timeline-strip span { color: #ff8c1a; font-weight: 850; }
.veterinary-timeline-strip p { margin: .35rem 0 0; color: #7c6244; font-size: .72rem; }
.veterinary-cycle-list { display: grid; gap: .45rem; padding: .75rem .85rem; border: 1px solid #dce7e1; border-radius: .55rem; background: #f8fbf9; }
.veterinary-cycle-list > strong { color: #146c43; font-size: .78rem; }
.veterinary-cycle-list div { display: grid; gap: .08rem; padding-top: .4rem; border-top: 1px solid #e3ece6; }
.veterinary-cycle-list span { color: #263946; font-size: .78rem; font-weight: 800; }
.veterinary-cycle-list small { color: #6c757d; font-size: .66rem; }
.veterinary-section-breakdown { display: grid; gap: .55rem; padding: .75rem .85rem; border: 1px solid #dce7e1; border-radius: .55rem; background: #f8fbf9; }
.veterinary-section-breakdown > strong { color: #146c43; font-size: .78rem; }
.veterinary-section-breakdown article { display: grid; gap: .5rem; padding: .7rem; border: 1px solid #dfe8e2; border-radius: .5rem; background: #fff; }
.veterinary-section-breakdown-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.veterinary-section-breakdown-head span { display: block; color: #263946; font-size: .84rem; font-weight: 850; }
.veterinary-section-breakdown-head small { display: block; margin-top: .08rem; color: #6c757d; font-size: .64rem; }
.veterinary-section-breakdown-head strong { flex: 0 0 auto; padding: .16rem .45rem; border-radius: 999px; background: #e5f3eb; color: #146c43; font-size: .64rem; }
.veterinary-section-mini-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.veterinary-section-mini-kpis span { min-width: 0; padding: .35rem .42rem; border-radius: .38rem; background: #f5f8fa; color: #7a858d; font-size: .58rem; font-weight: 750; }
.veterinary-section-mini-kpis strong { display: block; margin-top: .08rem; color: #1f2d38; font-size: .86rem; font-variant-numeric: tabular-nums; }
.veterinary-section-metrics { display: grid; gap: .22rem; padding-top: .35rem; border-top: 1px solid #edf0f2; }
.veterinary-section-metrics span { color: #52606a; font-size: .64rem; }
.veterinary-section-metrics strong { color: #087990; font-variant-numeric: tabular-nums; }
.veterinary-section-metrics small { color: #8a959c; }
.veterinary-climate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.veterinary-climate-card { padding: .65rem .75rem; border: 1px solid #dbe8ee; border-radius: .5rem; background: linear-gradient(135deg, #f5fbfd, #eef8fc); }
.veterinary-climate-card span { display: block; color: #087990; font-size: .68rem; font-weight: 800; }
.veterinary-climate-card strong { display: block; margin-top: .18rem; color: #1f2d38; font-size: 1rem; font-variant-numeric: tabular-nums; }
.veterinary-climate-card small { color: #6c757d; font-size: .62rem; }
.veterinary-metric-table { overflow: hidden; border: 1px solid #e5e9ec; border-radius: .55rem; }
.veterinary-metric-table table { width: 100%; margin: 0; border-collapse: collapse; font-size: .68rem; }
.veterinary-metric-table th { padding: .42rem .5rem; background: #f3f6f8; color: #52606a; font-weight: 800; }
.veterinary-metric-table td { padding: .4rem .5rem; border-top: 1px solid #edf0f2; color: #43515c; font-variant-numeric: tabular-nums; }
.veterinary-metric-table small { color: #89939a; }
.veterinary-presence { padding-bottom: 1rem; border-top: .22rem solid #198754; }
.veterinary-presence-stamp { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; margin: 1rem; padding: .9rem; border: 1px solid #cfe9dc; border-radius: .55rem; background: #f2faf5; }
.veterinary-presence-stamp > span { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #198754; color: white; font-size: 1.2rem; font-weight: 850; }
.veterinary-presence-stamp strong, .veterinary-presence-stamp small { display: block; }
.veterinary-presence-stamp small { margin-top: .15rem; color: #6c757d; }
.veterinary-assessment { border-top: .22rem solid #2f4e6f; }
.veterinary-recommendations { border-top: .22rem solid #ff8c1a; }
.veterinary-assessment-current { margin-top: 1rem; padding: .8rem; border: 1px solid #e2e8ed; border-radius: .55rem; background: #f8fafb; }
.veterinary-assessment-current span { display: inline-flex; margin-bottom: .45rem; padding: .18rem .5rem; border-radius: 999px; background: #2f4e6f; color: #fff; font-size: .68rem; font-weight: 800; }
.veterinary-assessment-current p { margin: 0; color: #43515c; font-size: .82rem; }
.veterinary-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .85rem; padding: 1rem 0; }
.veterinary-form-grid .mb-3, .veterinary-form-grid .form-check { margin-bottom: 0 !important; }
.veterinary-form-grid label { color: #46535d; font-size: .75rem; font-weight: 750; }
.veterinary-form-grid textarea { min-height: 4.4rem; }
.veterinary-form-grid .mb-3:nth-last-child(2), .veterinary-form-grid .mb-3:has(textarea[rows="4"]), .veterinary-form-grid button { grid-column: 1 / -1; }
.veterinary-icon-button { display: grid; place-items: center; flex: 0 0 auto; width: 2.15rem; height: 2.15rem; border: 1px solid #ffc587; border-radius: .5rem; background: #ff8c1a; color: #fff; font-size: 1.35rem; font-weight: 800; line-height: 1; text-decoration: none; box-shadow: 0 .15rem .4rem rgba(255,140,26,.25); }
.veterinary-icon-button:hover { color: #fff; filter: brightness(.96); }
.veterinary-recommendation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; padding: 1rem 0; }
.veterinary-recommendation-card { padding: .85rem; border: 1px solid #e4e8ec; border-left: .28rem solid #ff8c1a; border-radius: .55rem; background: #fff; box-shadow: 0 .1rem .28rem rgba(30,42,54,.05); }
.veterinary-recommendation-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.veterinary-recommendation-type { color: #2f4e6f; font-size: .68rem; font-weight: 800; }
.veterinary-status-pill { padding: .12rem .42rem; border-radius: 999px; background: #eef3f7; color: #52606a; font-size: .6rem; font-weight: 750; }
.veterinary-recommendation-card h3 { margin: 0 0 .4rem; color: #1f2d38; font-size: .95rem; }
.veterinary-recommendation-card p { margin: 0; color: #52606a; font-size: .78rem; line-height: 1.35; }
.veterinary-recommendation-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; margin-top: .75rem; }
.veterinary-recommendation-facts span { min-width: 0; padding: .45rem; border-radius: .42rem; background: #f8fafb; color: #43515c; font-size: .68rem; overflow-wrap: anywhere; }
.veterinary-recommendation-facts strong { display: block; margin-bottom: .12rem; color: #7a858d; font-size: .58rem; text-transform: uppercase; letter-spacing: 0; }
.veterinary-empty-state { padding: 1rem; border: 1px dashed #c8d0d6; border-radius: .55rem; background: #f8fafb; color: #7a858d; text-align: center; }
.veterinary-add-panel { margin-bottom: 1rem; border: 1px solid #ffd6aa; border-radius: .55rem; background: #fffaf4; }
.veterinary-add-panel summary { display: flex; align-items: center; gap: .45rem; padding: .7rem .85rem; color: #6b3f07; cursor: pointer; font-weight: 800; }
.veterinary-add-panel summary span { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: .35rem; background: #ff8c1a; color: #fff; }
.veterinary-add-panel form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .85rem; padding: .85rem; border-top: 1px solid #ffe1bd; background: #fff; }
.veterinary-add-panel textarea, .veterinary-add-panel .mb-3:nth-child(3), .veterinary-add-panel button { grid-column: 1 / -1; }
.veterinary-add-panel label { color: #46535d; font-size: .75rem; font-weight: 750; }
.veterinary-followup { padding-bottom: 1rem; border-top: .22rem solid #198754; }
.veterinary-task-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid #edf0f2; }
.veterinary-task-row strong, .veterinary-task-row small { display: block; }
.veterinary-task-row small { margin-top: .12rem; color: #7a858d; }
.notification-center-list { display: grid; gap: .75rem; }
.notification-center-card { border: 1px solid #e1e7ec; border-left-width: .3rem; box-shadow: 0 .08rem .25rem rgba(30,42,54,.04); }
.notification-center-card.notification-severity-info { border-left-color: #0dcaf0; }
.notification-center-card.notification-severity-warning { border-left-color: #ffbf00; }
.notification-center-card.notification-severity-critical { border-left-color: #dc3545; }
.notification-center-card.notification-status-new { background: linear-gradient(90deg, rgba(13,202,240,.06), #fff 34%); }
.notification-icon { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 999px; background: #eef6f8; font-size: .9rem; }
.notification-center-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
@media (max-width: 1199.98px) {
  .veterinary-summary, .veterinary-workspace { grid-template-columns: 1fr; }
  .veterinary-scope-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .veterinary-hero { flex-direction: column; }
  .veterinary-hero-actions { justify-content: flex-start; }
  .veterinary-summary-columns, .veterinary-kpi-grid, .veterinary-form-grid, .veterinary-add-panel form, .veterinary-scope-form, .veterinary-climate-grid { grid-template-columns: 1fr; }
  .veterinary-panel > .veterinary-section-heading, .veterinary-panel > form, .veterinary-panel > .row, .veterinary-panel > .veterinary-recommendation-grid, .veterinary-panel > .veterinary-add-panel, .veterinary-panel > .veterinary-assessment-current { margin-right: .75rem; margin-left: .75rem; }
  .veterinary-section-mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .operator-navbar, .page-context-strip, .report-controls, .report-actions { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}

.report-controls.history-control-panel { padding: .55rem .7rem; gap: .5rem .65rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.report-controls .form-label { font-size: .68rem; margin-bottom: .1rem; color: #6c757d; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.report-controls .form-select { font-size: .78rem; padding: .3rem .55rem; min-height: auto; }

.report-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-size: .84rem; color: #343a40; font-weight: 500; }
.report-summary-sep { color: #ced4da; font-weight: 400; }

.report-timeline { margin: 0 0 .85rem; }
.report-timeline-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.report-timeline-selected-labels { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: #343a40; }
.report-timeline-chip { font-size: .68rem; font-weight: 700; color: #146c43; background: rgba(25,135,84,.12); padding: .1rem .55rem; border-radius: 999px; white-space: nowrap; }
.report-timeline-ruler { position: relative; height: 14px; margin: 0 9px 3px; }
.report-timeline-ruler-week { position: absolute; bottom: 0; width: 1px; height: 4px; background: #dde0e6; }
.report-timeline-ruler-month { position: absolute; top: 0; font-size: .6rem; font-weight: 700; color: #9aa0ab; white-space: nowrap; transform: translateX(2px); }
.report-timeline-track { position: relative; height: 6px; background: #edeef2; border-radius: 999px; margin: 0 9px; }
.report-timeline-selection { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; min-width: 28px; background: #198754; border-radius: 999px; cursor: grab; touch-action: none; }
.report-timeline-selection:active { cursor: grabbing; }
.report-timeline-handle { position: absolute; top: 50%; width: 18px; height: 18px; margin-left: -9px; margin-top: -9px; background: #fff; border: 2px solid #198754; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: ew-resize; touch-action: none; display: flex; align-items: center; justify-content: center; }
.report-timeline-handle:focus-visible { outline: 2px solid #146c43; outline-offset: 2px; }
.report-timeline-handle-dot { width: 5px; height: 5px; border-radius: 50%; background: #198754; }
@media print {
  .report-timeline { display: none !important; }
}

.report-chart-frame { position: relative; width: 100%; height: 230px; margin-bottom: .6rem; }
/* Pusta kanwa wypełnia ramkę zanim Chart.js ją zwymiaruje — znika błysk
   domyślnego 300×150 px przy pierwszym rysowaniu/przebudowie. Po inicjalizacji
   Chart.js nadpisuje to własnymi inline width/height (bez !important, żeby nie
   kolidować z jego responsywnym skalowaniem). */
.report-chart-frame > canvas { width: 100%; height: 100%; }
.report-chart-resize-handle { position: absolute; left: 0; right: 0; bottom: -12px; height: 14px; cursor: ns-resize; display: flex; align-items: center; justify-content: center; touch-action: none; }
.report-chart-resize-handle::before { content: ""; width: 32px; height: 4px; border-radius: 999px; background: #dee2e6; transition: background .15s ease; }
.report-chart-resize-handle:hover::before, .report-chart-resize-handle:active::before { background: #adb5bd; }
@media print {
  .report-chart-resize-handle { display: none !important; }
}
@media (max-width: 576px) {
  .report-chart-frame { height: 320px; }
}

/* Wskazanie silnika masy. W trybie cieniowym stoi obok dotychczasowej wartości
   i dlatego ma własną kreskę oddzielającą; gdy silnik jest źródłem podstawowym,
   wiersz niesie już tylko przedział i świeżość, więc kreska znika. */
.pen-engine {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem;
  margin-top: .3rem; padding-top: .3rem;
  border-top: 1px dashed #d5d8d2;
  font-size: .66rem; color: #5a635c;
}
.pen-engine-label { text-transform: uppercase; letter-spacing: .06em; color: #8a928b; }
.pen-engine strong { font-size: .8rem; color: #2f5d45; }
.pen-engine-band { color: #8a928b; }
.pen-engine-age { color: #8a928b; margin-left: auto; }
.pen-engine-conf { padding: .05rem .3rem; border-radius: .25rem; font-weight: 600; }
.pen-engine-conf--measured { background: #eaf0eb; color: #2f5d45; }
.pen-engine-conf--balanced { background: #eef1f4; color: #40556b; }
.pen-engine-conf--estimated { background: #f8f0e1; color: #96590e; }
.pen-engine-conf--stale { background: #f8eae6; color: #8e3527; }
.pen-engine--primary { border-top: 0; padding-top: 0; margin-top: .15rem; }

/* Harmonogram obsad */
.schedule-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr)); }
.schedule-gate {
  padding: .25rem .7rem; border-radius: .3rem;
  background: #eaf0eb; color: #2f5d45; font-size: .9rem;
}
.schedule-date { font-size: 1.15rem; font-weight: 600; color: #2f5d45; line-height: 1.2; }
.schedule-blocker {
  border-left: 3px solid #8e3527; background: #f8eae6;
  padding: .6rem .8rem; margin-bottom: 1rem; color: #6d2a1f;
}
.schedule-subhead {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #6c757d; margin: 0 0 .4rem;
}
.schedule-priorities { list-style: none; padding: 0; margin: 0 0 1rem; }
.schedule-priorities li { padding: .4rem 0; border-bottom: 1px solid #e9ecef; }
.schedule-priorities li:last-child { border-bottom: none; }
.schedule-detail summary { cursor: pointer; font-size: .85rem; color: #2f5d45; }
.schedule-table { font-size: .84rem; }
.schedule-table td, .schedule-table th { vertical-align: middle; }
.schedule-row-binding { background: #fdf3f1; font-weight: 600; }

/* Ekrany autoryzacji (logowanie, wybór gospodarstwa) */
.auth-body { min-height: 100vh; margin: 0; background: #f7f9fb; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.auth-brand {
  position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden;
  padding: 3rem clamp(2rem, 5vw, 4.5rem);
  background: linear-gradient(155deg, #35597f 0%, #22384f 55%, #16283a 100%); color: #fff;
}
.auth-brand-pattern { position: absolute; right: 1.5rem; bottom: 1.5rem; z-index: -1; width: min(62%, 27rem); color: rgba(255,255,255,.13); pointer-events: none; }
.auth-brand-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.auth-shell-photo .auth-brand::before {
  position: absolute; inset: 0; z-index: -1; content: "";
  background: linear-gradient(150deg, rgba(22,40,58,.95) 0%, rgba(22,40,58,.8) 45%, rgba(16,28,40,.93) 100%);
}
.auth-brand-inner { position: relative; max-width: 32rem; }
.auth-wordmark { margin: 0; font-size: clamp(2.4rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.auth-wordmark-accent { color: #ff8c1a; }
.auth-tagline { margin: 1rem 0 0; max-width: 26rem; color: rgba(255,255,255,.9); font-size: clamp(1.02rem, 1.6vw, 1.28rem); font-weight: 500; line-height: 1.35; }
.auth-features { display: grid; gap: .75rem; max-width: 28rem; margin: 2.2rem 0 0; padding: 0; list-style: none; }
.auth-features li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .7rem; color: rgba(255,255,255,.88); font-size: .95rem; }
.auth-features svg {
  width: 1.75rem; height: 1.75rem; padding: .32rem; border-radius: .45rem; background: rgba(255,255,255,.13);
  fill: none; stroke: #ff8c1a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.auth-brand-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2.4rem 0 0; color: rgba(255,255,255,.62); font-size: .8rem; }
.auth-local-badge { padding: .25rem .65rem; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 650; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 1.6rem; padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem); }
.auth-card {
  width: 100%; max-width: 25rem; margin: 0 auto; padding: 2.25rem;
  border: 1px solid #e2e8ed; border-top: .28rem solid #ff8c1a; border-radius: .9rem;
  background: #fff; box-shadow: 0 1.2rem 2.4rem rgba(30,42,54,.09);
}
.auth-wordmark-compact { display: none; margin-bottom: 1.35rem; color: #2f4e6f; font-size: 2rem; }
.auth-heading { margin: 0; color: #22384f; font-size: 1.6rem; font-weight: 750; }
.auth-lead { margin: .45rem 0 0; color: #6c757d; font-size: .9rem; }
.auth-alert { margin: 1.1rem 0 0; font-size: .85rem; }
.auth-form { display: grid; gap: 1.15rem; margin-top: 1.7rem; }
.auth-label { display: block; margin-bottom: .35rem; color: #43515c; font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.auth-input { min-height: 3rem; border-color: #cdd6dd; border-radius: .55rem; font-size: 1rem; }
.auth-input:focus { border-color: #ff8c1a; box-shadow: 0 0 0 .2rem rgba(255,140,26,.22); }
.auth-field.has-error .auth-input { border-color: #dc3545; }
.auth-field-error { margin: .35rem 0 0; color: #b02a37; font-size: .78rem; }
.auth-form-error {
  display: grid; gap: .2rem; padding: .7rem .85rem;
  border: 1px solid #f2c6cc; border-left: .25rem solid #dc3545; border-radius: .5rem;
  background: #fff6f7; color: #b02a37; font-size: .85rem;
}
.auth-password { position: relative; }
.auth-password .auth-input { padding-right: 3.2rem; }
.auth-password-toggle { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 3.1rem; height: 100%; padding: 0; border: 0; border-radius: .5rem; background: none; color: #6c757d; cursor: pointer; }
.auth-password-toggle:hover { color: #2f4e6f; }
.auth-password-toggle:focus-visible { outline: 3px solid rgba(255,140,26,.4); outline-offset: -3px; }
.auth-password-toggle svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-password-toggle .auth-icon-hide { display: none; }
.auth-password-toggle.is-shown .auth-icon-show { display: none; }
.auth-password-toggle.is-shown .auth-icon-hide { display: block; }
.auth-capslock { display: flex; align-items: center; gap: .35rem; margin: .4rem 0 0; color: #8a6100; font-size: .76rem; font-weight: 600; }
.auth-capslock::before { content: "⇪"; }
.auth-submit {
  --bs-btn-bg: #2f4e6f; --bs-btn-border-color: #2f4e6f;
  --bs-btn-hover-bg: #26405c; --bs-btn-hover-border-color: #26405c;
  --bs-btn-active-bg: #1e3349; --bs-btn-active-border-color: #1e3349;
  --bs-btn-disabled-bg: #6d8199; --bs-btn-disabled-border-color: #6d8199; --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-shadow-rgb: 255, 140, 26;
  min-height: 3.1rem; margin-top: .35rem; border-radius: .55rem; font-size: 1rem; font-weight: 700;
}
.auth-submit-spinner { display: none; margin-left: .5rem; }
.auth-submit.is-busy .auth-submit-spinner { display: inline-block; }
.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem 1.1rem; width: 100%; max-width: 25rem; margin: 0 auto; color: #7a868f; font-size: .74rem; text-align: center; }
.auth-footer a { color: inherit; text-decoration: none; }
.auth-footer a:hover { color: #2f4e6f; }
.auth-footer-brand { display: inline-flex; align-items: center; gap: .4rem; }
.auth-footer-brand strong { color: #2f4e6f; font-weight: 700; }
.auth-footer-brand img { border-radius: .25rem; }
.auth-footer-version { color: #9aa5ad; }
.auth-form .facility-choice { min-height: 3.4rem; }

@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { align-items: flex-end; min-height: 14rem; padding: 2rem 1.75rem; }
  .auth-brand-pattern { right: 1rem; bottom: 1rem; width: min(45%, 15rem); }
  .auth-tagline { font-size: 1rem; }
  .auth-features, .auth-brand-note { display: none; }
  .auth-panel { padding: 2rem 1.25rem 2.5rem; }
}

@media (max-width: 575.98px) {
  .auth-brand { display: none; }
  .auth-wordmark-compact { display: block; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; }
  .auth-card { padding: 1.6rem 1.35rem; border-radius: .75rem; }
}

/* Podgląd zdjęcia z sesji Scale24 na pełnym ekranie. Ten sam wzorzec co
   .pen-action-modal — własny overlay, bo Bootstrap JS nie jest tu ładowany. */
.scale24-photo-thumb { display: block; cursor: zoom-in; }
.scale24-photo-modal { position: fixed; z-index: 1080; inset: 0; display: grid; grid-template-rows: auto 1fr auto; gap: .75rem; padding: 1rem; background: rgba(15,23,42,.85); }
.scale24-photo-modal img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.scale24-photo-modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #f8f9fa; }
.scale24-photo-modal-bar a { color: #f8f9fa; }
