:root {
  color-scheme: light;
  --ink: #101722;
  --muted: #697586;
  --navy: #101722;
  --navy-2: #1a2432;
  --blue: #1479f7;
  --blue-dark: #075cc4;
  --blue-soft: #e9f3ff;
  --gp-green: #5a8f2d;
  --gp-green-dark: #467522;
  --login-gray: #606a73;
  --surface: #ffffff;
  --background: #eef2f6;
  --line: #dbe2ea;
  --danger: #c83e45;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* V0.25: wspólny obieg sprzętu i podwykonawców */
.foreman-heading-actions,
.foreman-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.foreman-assignment-picker {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px;
  margin: 12px 0; padding: 12px; border: 1px solid #bcd6f2; border-radius: 12px; background: #f3f8fe;
}
.foreman-assignment-picker[hidden] { display: none !important; }
.foreman-assignment-picker label { display: grid; gap: 5px; color: #30455c; font-weight: 850; }
.foreman-assignment-picker select { width: 100%; min-height: 42px; }
.foreman-assignment-picker > small { grid-column: 1 / -1; color: #5c6f84; }
.danger-text-button { border: 1px solid #f0b7bd; background: #fff5f6; color: #b4232f; font-weight: 900; }
.foreman-equipment-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.foreman-equipment-list article > div { display: grid; gap: 3px; }
.foreman-equipment-list article.is-pending { border-color: #efb21b; background: #fff9e8; }
.foreman-equipment-list article.is-pending small { color: #8a5c00; font-weight: 950; }
.warehouse-equipment-request-list { display: grid; gap: 8px; margin-top: 10px; }
.warehouse-equipment-request-list article {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 12px; border: 1px solid #f0c464; border-left: 5px solid #e8a20a; border-radius: 11px; background: #fff9e8;
}
.warehouse-equipment-request-list article[data-action="return"] { border-color: #9fc6ef; border-left-color: #2382dc; background: #f2f8ff; }
.warehouse-equipment-request-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #f7b817; color: #162231; font-weight: 950; }
.warehouse-equipment-request-list article[data-action="return"] .warehouse-equipment-request-icon { background: #dbeeff; color: #096fcf; }
.warehouse-equipment-request-list article > div { display: grid; gap: 2px; }
.warehouse-equipment-request-list strong { color: #8a5c00; font-size: .72rem; letter-spacing: .06em; }
.heavy-equipment-item.has-equipment-request { border: 2px solid #efb21b; }
.heavy-equipment-request-banner { display: grid; gap: 2px; margin: -2px -2px 10px; padding: 10px 12px; border-radius: 10px; background: #fff1bd; color: #694500; }
.heavy-equipment-request-banner b { font-size: .78rem; letter-spacing: .06em; }
body.theme-dark .foreman-assignment-picker,
body.theme-dark .warehouse-equipment-request-list article,
body.theme-dark .foreman-equipment-list article.is-pending { background: #243043; border-color: #8e732e; color: #eef4fb; }
body.theme-dark .heavy-equipment-request-banner { background: #5d4a18; color: #fff5cf; }
@media (max-width: 760px) {
  .foreman-assignment-picker { grid-template-columns: 1fr; }
  .foreman-heading-actions { width: 100%; justify-content: flex-start; }
  .foreman-heading-actions .small-button { flex: 1 1 auto; }
  .foreman-row-actions { width: 100%; justify-content: stretch; }
  .foreman-row-actions button { flex: 1 1 130px; min-height: 42px; }
  .foreman-equipment-list article { align-items: stretch; flex-direction: column; }
  .foreman-equipment-list article > button { width: 100%; min-height: 42px; }
  .warehouse-equipment-request-list article { grid-template-columns: auto minmax(0, 1fr); }
  .warehouse-equipment-request-list article > button { grid-column: 1 / -1; width: 100%; }
}

/* V0.40: uproszczenie pulpitu Szefa, pelny Magazyn i czytelna ksiazka telefoniczna. */
#eiHomeWarehouseCard[hidden] { display: none !important; }

/* V0.39: szczegolowe koszty eksploatacji i napraw floty. */
.analytics-table-description {
  margin: -2px 0 14px;
  color: #5f6f84;
  font-size: .88rem;
  line-height: 1.55;
  max-width: 1100px;
}
.analytics-detail-table {
  border: 1px solid #c9d7e6;
  box-shadow: 0 12px 28px rgba(31, 49, 74, .07);
}
.analytics-detail-table .analytics-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #ced9e6;
  border-radius: 12px;
  scrollbar-gutter: stable;
}
.analytics-detail-table .analytics-table {
  min-width: 1280px;
  font-size: .84rem;
  border-collapse: separate;
  border-spacing: 0;
}
.analytics-detail-table .analytics-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 13px 14px;
  background: #e8f1fb;
  color: #24364c;
  border-bottom: 2px solid #b7c9dd;
  font-size: .72rem;
  letter-spacing: .035em;
  white-space: nowrap;
}
.analytics-detail-table .analytics-table td {
  padding: 13px 14px;
  line-height: 1.4;
  font-weight: 720;
  border-bottom: 1px solid #dbe4ee;
  white-space: nowrap;
}
.analytics-detail-table .analytics-table tbody tr:nth-child(even) td { background: #f6f9fc; }
.analytics-detail-table .analytics-table tbody tr:hover td { background: #eaf4ff; }
.analytics-detail-table .analytics-table th:first-child,
.analytics-detail-table .analytics-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 #c9d7e6, 7px 0 14px rgba(31, 49, 74, .06);
}
.analytics-detail-table .analytics-table th:first-child { z-index: 6; background: #dceafb; }
.analytics-detail-table .analytics-table tbody tr:nth-child(even) td:first-child { background: #f6f9fc; }
.analytics-detail-table .analytics-table tbody tr:hover td:first-child { background: #eaf4ff; }
.analytics-finance-legend { border-left: 5px solid #1f7ff0; }
.analytics-definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.analytics-definition-grid article {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 4px 10px;
  align-content: start;
  padding: 13px;
  border: 1px solid #d4dfeb;
  border-radius: 12px;
  background: #f8fbff;
}
.analytics-definition-grid article > i { grid-row: 1 / span 2; width: 11px; height: 100%; min-height: 42px; border-radius: 8px; background: #2f80ed; }
.analytics-definition-grid article > i.is-expense { background: #ef9b19; }
.analytics-definition-grid article > i.is-prepayment { background: #8b5cf6; }
.analytics-definition-grid article > i.is-due { background: #137448; }
.analytics-definition-grid article > i.is-farm { background: #0891b2; }
.analytics-definition-grid b { font-size: .86rem; color: #172435; }
.analytics-definition-grid span { color: #5e6d80; font-size: .78rem; line-height: 1.4; }
.analytics-chart-legend,
.boss-team-board-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 18px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #d4dfeb;
  border-radius: 11px;
  background: #fff;
  color: #415269;
  font-size: .78rem;
  font-weight: 780;
}
.analytics-chart-legend span,
.boss-team-board-legend span { display: inline-flex; align-items: center; gap: 7px; }
.analytics-chart-legend i,
.boss-team-board-legend i { width: 12px; height: 12px; border-radius: 4px; background: #2f80ed; flex: 0 0 auto; }
.analytics-chart-legend i.is-overtime { background: #efa21b; }
.analytics-chart-legend i.is-sick { background: #e54b55; }
.analytics-chart-legend i.is-vacation { background: #16a36b; }
.boss-team-board-legend { margin: 0 0 12px; background: #f8fbff; }
.boss-team-board-legend i.is-available { background: #16a36b; }
.boss-team-board-legend i.is-farm { background: #365fd7; }
.boss-team-board-legend i.is-vacation { background: transparent; border: 2px solid #e23e48; }
.boss-team-board-legend i.is-equipment { background: transparent; border: 2px solid #ef8a1a; }
.boss-team-board-legend i.is-company { background: #6b4bc3; }
#adminStatisticsPanel .statistics-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}
#adminStatisticsPanel .statistics-card { min-height: 128px; padding: 17px; }
#adminStatisticsPanel .statistics-card b { font-size: clamp(1.45rem, 2vw, 2.05rem); line-height: 1.08; overflow-wrap: anywhere; }
@media (min-width: 980px) {
  #bossAvailableWorkersPanel .boss-team-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
    gap: 10px !important;
  }
  #bossAvailableWorkersPanel .boss-team-person-card,
  #bossAvailableWorkersPanel .boss-team-equipment-card,
  #bossAvailableWorkersPanel .boss-team-subcontractor-card {
    min-height: 108px !important;
    padding: 12px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  #bossAvailableWorkersPanel .boss-team-group { padding: 13px !important; }
}
@media (max-width: 760px) {
  .analytics-definition-grid { grid-template-columns: 1fr; }
  .analytics-detail-table { margin-inline: -4px; }
  .analytics-detail-table .analytics-table { min-width: 1080px; font-size: .8rem; }
  .analytics-detail-table .analytics-table th,
  .analytics-detail-table .analytics-table td { padding: 11px 12px; }
}
body.dark-theme .analytics-table-description { color: #aebdd0; }
body.dark-theme .analytics-detail-table,
body.dark-theme .analytics-detail-table .analytics-table-wrap,
body.dark-theme .analytics-definition-grid article,
body.dark-theme .analytics-chart-legend,
body.dark-theme .boss-team-board-legend { border-color: #34445a; }
body.dark-theme .analytics-definition-grid article,
body.dark-theme .analytics-chart-legend,
body.dark-theme .boss-team-board-legend { background: #182231; }
body.dark-theme .analytics-definition-grid b { color: #f0f5fb; }
body.dark-theme .analytics-definition-grid span,
body.dark-theme .analytics-chart-legend,
body.dark-theme .boss-team-board-legend { color: #b9c7d8; }

/* V0.37: porównawcze wykresy SaaS dla pracy, absencji i floty. */
.analytics-monthly-work-chart,
.analytics-fleet-comparison {
  overflow: hidden;
}

.analytics-monthly-chart-scroll {
  overflow-x: auto;
  padding: 8px 4px 2px;
  scrollbar-width: thin;
}

.analytics-monthly-chart {
  min-width: max(720px, calc(var(--month-count, 7) * 104px));
  display: grid;
  grid-template-columns: repeat(var(--month-count, 7), minmax(92px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px 8px 4px;
  border-bottom: 1px solid #d8e2ee;
  background: linear-gradient(to top, rgba(25, 118, 243, 0.045) 1px, transparent 1px);
  background-size: 100% 52px;
}

.analytics-month-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 38px 250px 24px 34px;
  align-items: end;
  justify-items: center;
  gap: 6px;
}

.analytics-month-total {
  text-align: center;
  color: #172033;
}

.analytics-month-total b,
.analytics-month-total small {
  display: block;
}

.analytics-month-total b {
  font-size: 17px;
  line-height: 1;
}

.analytics-month-total small,
.analytics-month-absence {
  color: #65748b;
  font-size: 10px;
  line-height: 1.25;
}

.analytics-month-stack {
  position: relative;
  width: min(68px, 78%);
  height: 250px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid #d8e2ee;
  border-radius: 13px 13px 5px 5px;
  background: rgba(235, 241, 248, 0.72);
  box-shadow: 0 8px 22px rgba(20, 38, 63, 0.08);
}

.analytics-month-stack > i {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  font-style: normal;
  transition: filter 160ms ease;
}

.analytics-month-stack > i:hover {
  filter: brightness(1.08);
}

.analytics-month-stack > i span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.segment-normal { background: linear-gradient(180deg, #2f83f7, #1764d5); }
.segment-overtime { background: linear-gradient(180deg, #ffba3d, #e88a00); }
.segment-sick { background: linear-gradient(180deg, #ef5c64, #c92f3a); }
.segment-vacation { background: linear-gradient(180deg, #37bd83, #188c5a); }

.analytics-month-label {
  color: #172033;
  text-transform: capitalize;
  font-size: 12px;
  white-space: nowrap;
}

.analytics-month-absence {
  max-width: 104px;
  text-align: center;
}

.analytics-monthly-legend {
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 14px;
}

.analytics-chart-legend .legend-normal { background: #2376e8; }
.analytics-chart-legend .legend-overtime { background: #f0a21a; }
.analytics-chart-legend .legend-sick { background: #dc3c48; }
.analytics-chart-legend .legend-vacation { background: #239c67; }
.analytics-chart-legend .legend-fuel { background: #3585ef; }
.analytics-chart-legend .legend-operating { background: #e6a11a; }
.analytics-chart-legend .legend-repair { background: #dc3c48; }

.analytics-fleet-chart-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.analytics-fleet-chart-row {
  display: grid;
  grid-template-columns: minmax(145px, 190px) minmax(260px, 1fr) minmax(145px, 190px);
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dce5ef;
  border-left: 4px solid #e3a21c;
  border-radius: 12px;
  background: #fbfcfe;
}

.analytics-fleet-chart-row.is-efficient { border-left-color: #1f9f68; }
.analytics-fleet-chart-row.is-risk { border-left-color: #d63b46; background: #fff9f9; }

.analytics-fleet-chart-name b,
.analytics-fleet-chart-name small,
.analytics-fleet-chart-value b,
.analytics-fleet-chart-value small {
  display: block;
}

.analytics-fleet-chart-name b,
.analytics-fleet-chart-value b {
  color: #172033;
  font-size: 12px;
}

.analytics-fleet-chart-name small,
.analytics-fleet-chart-value small {
  margin-top: 2px;
  color: #65748b;
  font-size: 10px;
}

.analytics-fleet-chart-value {
  text-align: right;
}

.analytics-fleet-chart-track {
  height: 18px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
  box-shadow: inset 0 1px 2px rgba(20, 38, 63, 0.09);
}

.analytics-fleet-chart-track i {
  display: block;
  height: 100%;
  min-width: 0;
}

.analytics-fleet-chart-track .fleet-fuel { background: linear-gradient(90deg, #60a8ff, #2376e8); }
.analytics-fleet-chart-track .fleet-operating { background: linear-gradient(90deg, #f6c75b, #d9910c); }
.analytics-fleet-chart-track .fleet-repair { background: linear-gradient(90deg, #f16c75, #c92f3a); }

@media (max-width: 760px) {
  .analytics-monthly-chart {
    min-width: max(680px, calc(var(--month-count, 7) * 94px));
    gap: 8px;
  }

  .analytics-month-column {
    grid-template-rows: 36px 210px 24px 34px;
  }

  .analytics-month-stack {
    height: 210px;
  }

  .analytics-fleet-chart-row {
    grid-template-columns: minmax(108px, 0.85fr) minmax(145px, 1.3fr);
    gap: 8px;
  }

  .analytics-fleet-chart-value {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
  }
}

/* V9.50: zakresy dat zatwierdzaja sie natychmiast po wybraniu dnia. */
.auto-filter-status {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 10px;
  color: var(--blue-dark);
  background: color-mix(in srgb, var(--blue-soft) 72%, var(--surface));
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

body.theme-dark .auto-filter-status {
  border-color: rgba(98, 167, 255, 0.28);
  color: #a9d0ff;
  background: rgba(20, 121, 247, 0.11);
}

.analytics-auto-loading {
  color: var(--blue);
}

@media (max-width: 900px) {
  .toa-filters .auto-filter-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .toa-filters .auto-filter-status {
    grid-column: 1;
  }

  .analytics-date-fields .auto-filter-status {
    flex: 1 1 100%;
  }
}

/* V9.32 - pelnowymiarowy i czytelny uklad komputerowy dla wszystkich rol. */
@media (min-width: 980px) {
  :root {
    --ops-page-width: 1800px;
  }

  .app-shell.desktop-layout {
    --desktop-sidebar-width: clamp(232px, 13vw, 288px);
    gap: clamp(16px, 1.15vw, 24px);
    padding-right: clamp(18px, 1.45vw, 34px);
  }

  .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout .panel,
  .app-shell.desktop-layout .daily-note,
  .app-shell.desktop-layout .history-section,
  .app-shell.desktop-layout .summary-card,
  .app-shell.desktop-layout .admin-panel,
  .app-shell.desktop-layout .vehicle-panel {
    padding: clamp(18px, 1.35vw, 26px);
    border-radius: 15px;
  }

  .app-shell.desktop-layout .side-menu {
    padding: 16px 12px 18px;
  }

  .app-shell.desktop-layout .side-logo-frame {
    width: 42px;
    height: 42px;
  }

  .app-shell.desktop-layout .side-logo-frame img {
    width: 34px;
    height: 34px;
  }

  .app-shell.desktop-layout .side-brand strong {
    font-size: 0.82rem;
  }

  .app-shell.desktop-layout .side-brand span {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout .side-menu-list {
    gap: 3px;
  }

  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .app-shell.desktop-layout .side-admin-shortcuts button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.74rem;
  }

  .app-shell.desktop-layout :is(input, select, textarea, button) {
    font-size: 0.84rem;
  }

  .app-shell.desktop-layout :is(label, td, p, .form-hint) {
    font-size: 0.82rem;
  }

  .app-shell.desktop-layout th,
  .app-shell.desktop-layout small {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout h2,
  .app-shell.desktop-layout .section-title h2 {
    font-size: 1.18rem;
  }

  .app-shell.desktop-layout .eyebrow {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout .toa-heading h2 {
    font-size: clamp(28px, 2vw, 38px);
  }

  .app-shell.desktop-layout .toa-filters {
    grid-template-columns: minmax(170px, 0.7fr) minmax(170px, 0.7fr) minmax(300px, 1.5fr) auto auto;
    gap: 14px;
  }

  .app-shell.desktop-layout .toa-table {
    min-width: 1120px;
  }

  .app-shell.desktop-layout .toa-table th,
  .app-shell.desktop-layout .toa-table td {
    padding: 15px 13px;
  }

  .app-shell.desktop-layout .toa-document-button {
    min-height: 64px;
  }
}

/* V0.29 — mobilny dziennik zmian tylko dla brygady zalogowanego Brygadzisty */
.foreman-team-changes {
  display: grid;
  gap: 12px;
  margin-bottom: 15px;
  padding: 15px;
  border: 2px solid #d5e1ee;
  border-radius: 17px;
  background: #f7fbff;
}

.foreman-team-changes.has-changes {
  border-color: #e04a4a;
  background: linear-gradient(135deg, #fff5f5 0%, #fffaf0 100%);
  box-shadow: 0 10px 26px rgba(177, 42, 42, .12);
}

.foreman-team-changes.is-clear {
  border-color: #65c995;
  background: #f1fcf6;
}

.foreman-team-changes-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.foreman-team-changes-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: #d83d3d;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 950;
}

.foreman-team-changes.is-clear .foreman-team-changes-icon { background: #15945b; }
.foreman-team-changes-heading h3 { margin: 2px 0 3px; color: #172235; font-size: 1.1rem; }
.foreman-team-changes-heading small { display: block; color: #64758b; line-height: 1.35; }
.foreman-team-changes-count {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: #b82f36;
  color: #fff;
  font-size: .88rem;
}
.foreman-team-changes.is-clear .foreman-team-changes-count { background: #168653; }
.foreman-team-changes-list { display: grid; gap: 8px; }
.foreman-team-changes-list article {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #dbe5ef;
  border-left: 5px solid #347ee8;
  border-radius: 11px;
  background: #fff;
}
.foreman-team-changes-list article.is-join { border-left-color: #15945b; background: #f5fff9; }
.foreman-team-changes-list article.is-leave { border-left-color: #d83d3d; background: #fff7f7; }
.foreman-team-changes-list article.is-plan { border-left-color: #e6a10b; background: #fffbef; }
.foreman-team-changes-list small { color: #126bd1; font-size: .68rem; font-weight: 950; letter-spacing: .07em; }
.foreman-team-changes-list article.is-join small { color: #0b7e49; }
.foreman-team-changes-list article.is-leave small { color: #b92731; }
.foreman-team-changes-list article.is-plan small { color: #946100; }
.foreman-team-changes-list b { color: #152033; font-size: 1rem; }
.foreman-team-changes-list strong { color: #30445e; font-size: .82rem; }
.foreman-team-changes-list span { color: #6b788b; font-size: .74rem; }
.foreman-team-changes-list p { margin: 2px 0 0; color: #59697d; font-size: .76rem; }
.team-event-decision-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.team-event-decision-actions button { min-width: 104px; justify-content: center; }
.team-event-decision-summary { display: grid; gap: 2px; margin-top: 7px; padding: 8px 10px; border-radius: 9px; background: #eef8f2; color: #17663b; }
.team-event-decision-summary.is-rejected { background: #fff0f1; color: #a61e2b; }
.team-event-decision-summary > strong { color: inherit; font-size: .72rem; letter-spacing: .07em; }
.team-event-decision-summary > span { color: inherit; font-size: .72rem; }
.team-event-decision-note { margin: 3px 0 0 !important; color: inherit !important; font-size: .78rem !important; }
.team-event-rejection-dialog { width: min(540px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 26px 80px rgba(15, 23, 42, .3); }
.team-event-rejection-dialog::backdrop { background: rgba(15, 23, 42, .62); backdrop-filter: blur(3px); }
.team-event-rejection-card { display: grid; gap: 14px; padding: 22px; }
.team-event-rejection-card > p { margin: 0; color: #53657b; line-height: 1.45; }
.team-event-rejection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.team-event-rejection-heading h2 { margin: 3px 0 0; }
.team-event-rejection-card label { display: grid; gap: 7px; color: #23344a; font-weight: 850; }
.team-event-rejection-card textarea { width: 100%; min-height: 122px; resize: vertical; padding: 12px; border: 1px solid #b9c9db; border-radius: 11px; font: inherit; }
.team-event-rejection-card label > small { justify-self: end; color: #6b7c91; }
.team-event-rejection-actions { display: flex; justify-content: flex-end; gap: 9px; }
body.theme-dark .team-event-rejection-dialog { background: #172536; color: #edf5ff; }
body.theme-dark .team-event-rejection-card label,
body.theme-dark .team-event-rejection-card > p { color: #d5e2f1; }
body.theme-dark .team-event-rejection-card textarea { background: #101b29; color: #fff; border-color: #405673; }
.foreman-team-changes-empty { margin: 0; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.76); color: #357253; font-weight: 750; }

body.theme-dark .foreman-team-changes { background: #172536; border-color: #40566e; }
body.theme-dark .foreman-team-changes.has-changes { background: linear-gradient(135deg, #3a2024, #342b1f); border-color: #ef6b6b; }
body.theme-dark .foreman-team-changes.is-clear { background: #173528; border-color: #3f9c6a; }
body.theme-dark .foreman-team-changes-heading h3,
body.theme-dark .foreman-team-changes-list b,
body.theme-dark .foreman-team-changes-list strong { color: #f1f6ff; }
body.theme-dark .foreman-team-changes-list article { background: #1b293b; border-color: #3b4f67; }

@media (max-width: 720px) {
  .foreman-team-changes {
    margin: 0 0 12px;
    padding: 13px;
    border-radius: 15px;
  }
  .foreman-team-changes-heading {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
  }
  .foreman-team-changes-icon { width: 36px; height: 36px; border-radius: 10px; }
  .foreman-team-changes-heading h3 { font-size: 1rem; }
  .foreman-team-changes-heading small { font-size: .72rem; }
  .foreman-team-changes-list article { padding: 10px; }
  .team-event-decision-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .team-event-rejection-card { padding: 18px; }
  .team-event-rejection-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

.farm-contractor-overview { grid-column: 1 / -1; }
.farm-contractor-overview-list { display: grid; gap: 8px; margin-bottom: 10px; }
.farm-contractor-overview-list article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 6px 16px;
  padding: 11px 12px;
  border: 1px solid #d7e2ef;
  border-left: 4px solid #7c3aed;
  border-radius: 10px;
  background: #faf8ff;
}
.farm-contractor-overview-list article > div { display: grid; gap: 2px; }
.farm-contractor-overview-list article > div:nth-child(2) { text-align: right; }
.farm-contractor-overview-list article p { grid-column: 1 / -1; margin: 2px 0 0; color: #475569; }
@media (max-width: 720px) {
  .farm-contractor-overview-list article { grid-template-columns: 1fr; }
  .farm-contractor-overview-list article > div:nth-child(2) { text-align: left; }
}

@media (min-width: 1600px) {
  .app-shell.desktop-layout .toa-table th {
    font-size: 0.76rem;
  }

  .app-shell.desktop-layout .toa-table td,
  .app-shell.desktop-layout .toa-document-button {
    font-size: 0.86rem;
  }
}

/* V9.59 - finalne nadpisanie znacznika details po starszych regulach */
.work-order-active-extra .work-order-breaks-field > summary::before,
.work-order-active-extra .work-order-breaks-field[open] > summary::before {
  content: none;
  display: none;
}

.work-order-active-extra .work-order-breaks-field > summary::marker {
  content: "";
  font-size: 0;
}

/* V9.60 - czysta baza projektu TNWIND */
#updateInfoDialog li:nth-child(n + 4) {
  display: none !important;
}

.login-logo img,
.side-logo-frame img,
.guide-brand img {
  object-fit: contain;
}

/* V9.59 - czytelna dostepnosc i widoczne sterowanie przerwami */
#vacationPanel .vacation-content {
  gap: 16px;
}

.vacation-intro,
.vacation-toolbar,
.vacation-calendar-card,
.vacation-team-block {
  border: 1px solid #d4e1ef;
  border-radius: 18px;
  background: #ffffff;
}

.vacation-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
}

.vacation-intro-copy {
  display: grid;
  gap: 5px;
}

.vacation-intro-copy strong {
  color: #10243e;
  font-size: 1.08rem;
}

.vacation-intro-copy span {
  color: #4b617a;
  line-height: 1.45;
}

.vacation-autosave-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #86efac;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.vacation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
}

.vacation-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: #536276;
  font-size: 0.76rem;
  font-weight: 800;
}

.vacation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.vacation-legend i,
.vacation-day-people i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.vacation-legend .legend-own i {
  background: #e11d48;
}

.vacation-legend .legend-team i {
  background: #2563eb;
}

.vacation-legend .legend-saturday i {
  background: #f59e0b;
}

.vacation-legend .legend-holiday i {
  background: #ef4444;
}

.vacation-planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.vacation-calendar-card,
.vacation-team-block {
  min-width: 0;
  padding: 18px;
}

.vacation-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.vacation-card-heading div {
  display: grid;
  gap: 3px;
}

.vacation-card-heading strong {
  color: #132033;
  font-size: 1rem;
}

.vacation-card-heading span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 750;
}

#vacationPanel .vacation-calendar {
  width: min(100%, 680px);
  margin-inline: auto;
}

#vacationPanel .vacation-calendar .calendar-weekdays,
#vacationPanel .vacation-calendar .calendar-grid {
  gap: 7px;
}

#vacationPanel .vacation-calendar .calendar-weekdays span {
  padding-block: 5px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
}

#vacationPanel .vacation-calendar .calendar-day {
  position: relative;
  width: 100%;
  max-width: 54px;
  min-height: 48px;
  aspect-ratio: 1;
  justify-self: center;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: none;
}

#vacationPanel .vacation-calendar .calendar-day.saturday {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

#vacationPanel .vacation-calendar .calendar-day.holiday {
  border-color: #fda4af;
  background: #fff1f2;
  color: #9f1239;
}

#vacationPanel .vacation-day.vacation-selected {
  border-color: #be123c;
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.25);
}

#vacationPanel .vacation-day.vacation-team-highlight {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#vacationPanel .vacation-day.vacation-selected.vacation-team-highlight {
  border-color: #ffffff;
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 0 0 3px #2563eb, 0 8px 18px rgba(190, 18, 60, 0.25);
}

#vacationPanel .vacation-day.vacation-focused {
  outline: 3px solid rgba(14, 165, 233, 0.4);
  outline-offset: 3px;
}

.vacation-day-number {
  position: relative;
  z-index: 1;
}

.vacation-day-signals {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: flex;
  gap: 3px;
}

.vacation-day-signals i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.vacation-day-signals .vacation-day-signal.own {
  background: #1479f7;
}

.vacation-day-signals .vacation-day-signal.team {
  background: #2563eb;
}

.vacation-status-card {
  min-height: 0;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed #b9c9dc;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  text-align: center;
}

.vacation-day-details {
  margin-top: 10px;
}

.vacation-day-people span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.vacation-day-people i {
  display: inline-block;
  background: #2563eb;
}

.vacation-team-picker-label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #52637a;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vacation-team-picker-label select {
  width: 100%;
  min-height: 48px;
  padding-inline: 13px;
  border: 1px solid #b8cbe0;
  border-radius: 12px;
  background: #f8fbff;
  color: #132033;
  font-weight: 850;
}

.vacation-team-cards {
  display: grid;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding-right: 3px;
}

.vacation-person-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #d1ddeb;
  border-radius: 14px;
  background: #f8fafc;
  color: #132033;
  text-align: left;
}

.vacation-person-card:hover,
.vacation-person-card.is-active {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.vacation-person-avatar,
.vacation-selected-person-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 950;
}

.vacation-person-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vacation-person-copy strong,
.vacation-person-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vacation-person-copy small {
  color: #64748b;
}

.vacation-person-count {
  min-width: 38px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.vacation-selected-person-chip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #93c5fd;
  border-radius: 15px;
  background: #eff6ff;
}

.vacation-selected-person-chip strong {
  overflow: hidden;
  color: #173d70;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vacation-selected-person-chip > span:not(.vacation-person-avatar) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.vacation-selected-person-chip small {
  color: #64748b;
}

.vacation-selected-person-chip button {
  width: 36px;
  height: 36px;
  border: 1px solid #fecdd3;
  border-radius: 50%;
  background: #fff1f2;
  color: #be123c;
  font-size: 1rem;
  font-weight: 900;
}

.vacation-team-empty {
  padding: 20px;
  border: 1px dashed #b9c9dc;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.vacation-team-empty strong,
.vacation-team-empty span {
  display: block;
}

.vacation-team-empty span {
  margin-top: 4px;
}

.work-order-breaks-field {
  overflow: hidden;
  gap: 0;
  margin-top: 12px;
  border: 1px solid #f2c65d;
  border-radius: 15px;
  background: #fffbeb;
}

.work-order-breaks-field > summary {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  color: #5b3b00;
}

.work-order-breaks-field > summary::before {
  content: none;
}

.work-order-breaks-field > summary::marker {
  content: "";
  font-size: 0;
}

.work-order-breaks-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 1.2rem;
  letter-spacing: -0.15em;
}

.work-order-breaks-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-order-breaks-copy strong {
  color: #4a3200;
  font-size: 0.9rem;
}

.work-order-breaks-copy small {
  color: #795d22;
  font-size: 0.74rem;
  line-height: 1.35;
}

.work-order-breaks-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e8b949;
  border-radius: 10px;
  background: #ffffff;
  color: #7c5200;
  font-size: 0.7rem;
}

.work-order-breaks-toggle .when-open {
  display: none;
}

.work-order-breaks-toggle i {
  font-size: 1rem;
  font-style: normal;
  transition: transform 160ms ease;
}

.work-order-breaks-field[open] .work-order-breaks-toggle .when-closed {
  display: none;
}

.work-order-breaks-field[open] .work-order-breaks-toggle .when-open {
  display: inline;
}

.work-order-breaks-field[open] .work-order-breaks-toggle i {
  transform: rotate(180deg);
}

.work-order-breaks-field[open] > summary {
  border-bottom: 1px solid #f2c65d;
}

.work-order-breaks-field .work-order-break-row,
.work-order-breaks-field .work-order-break-extra {
  padding: 12px 14px;
  background: #ffffff;
}

.work-order-breaks-field .work-order-break-extra {
  padding-top: 0;
}

body.theme-dark .vacation-intro,
body.theme-dark .vacation-toolbar,
body.theme-dark .vacation-calendar-card,
body.theme-dark .vacation-team-block {
  border-color: #30435b;
  background: #111c2b;
}

body.theme-dark .vacation-intro {
  background: linear-gradient(135deg, #122540 0%, #12313a 100%);
}

body.theme-dark .vacation-intro-copy strong,
body.theme-dark .vacation-card-heading strong,
body.theme-dark .vacation-team-picker-label select {
  color: #f8fbff;
}

body.theme-dark .vacation-intro-copy span,
body.theme-dark .vacation-card-heading span,
body.theme-dark .vacation-legend,
body.theme-dark .vacation-team-picker-label {
  color: #b7c6d9;
}

body.theme-dark .vacation-autosave-badge {
  border-color: #17643a;
  background: #102c20;
  color: #86efac;
}

body.theme-dark #vacationPanel .vacation-calendar .calendar-weekdays span,
body.theme-dark .vacation-status-card,
body.theme-dark .vacation-team-picker-label select,
body.theme-dark .vacation-person-card,
body.theme-dark .vacation-team-empty {
  border-color: #34465d;
  background: #172438;
  color: #dbe7f6;
}

body.theme-dark #vacationPanel .vacation-calendar .calendar-day {
  border-color: #4a5f79;
  background: #172438;
  color: #f8fbff;
}

body.theme-dark #vacationPanel .vacation-calendar .calendar-day.saturday {
  border-color: #d99a18;
  background: #302711;
  color: #fde68a;
}

body.theme-dark #vacationPanel .vacation-calendar .calendar-day.holiday {
  border-color: #be4057;
  background: #341923;
  color: #fecdd3;
}

body.theme-dark #vacationPanel .vacation-day.vacation-selected {
  border-color: #fb7185;
  background: #be123c;
  color: #ffffff;
}

body.theme-dark #vacationPanel .vacation-day.vacation-team-highlight {
  border-color: #60a5fa;
  background: #142f58;
  color: #bfdbfe;
}

body.theme-dark .vacation-person-card:hover,
body.theme-dark .vacation-person-card.is-active,
body.theme-dark .vacation-selected-person-chip {
  border-color: #3b82f6;
  background: #142f58;
}

body.theme-dark .vacation-person-copy small,
body.theme-dark .vacation-status-card,
body.theme-dark .vacation-team-empty {
  color: #aebed2;
}

body.theme-dark .vacation-selected-person-chip strong {
  color: #dbeafe;
}

body.theme-dark .work-order-breaks-field {
  border-color: #8a6417;
  background: #2a2313;
}

body.theme-dark .work-order-breaks-field > summary {
  color: #fde68a;
}

body.theme-dark .work-order-breaks-copy strong {
  color: #fff1bd;
}

body.theme-dark .work-order-breaks-copy small {
  color: #dfc477;
}

body.theme-dark .work-order-breaks-toggle {
  border-color: #8a6417;
  background: #172234;
  color: #fde68a;
}

body.theme-dark .work-order-breaks-field[open] > summary {
  border-color: #8a6417;
}

body.theme-dark .work-order-breaks-field .work-order-break-row,
body.theme-dark .work-order-breaks-field .work-order-break-extra {
  background: #111b29;
}

@media (max-width: 979px) {
  .vacation-planner-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .vacation-team-cards {
    max-height: 330px;
  }
}

@media (max-width: 680px) {
  .vacation-intro {
    display: grid;
    padding: 15px;
  }

  .vacation-autosave-badge {
    width: fit-content;
  }

  .vacation-toolbar {
    display: grid;
    padding: 10px;
  }

  .vacation-month-nav {
    width: 100%;
  }

  .vacation-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    padding: 4px 5px;
  }

  .vacation-calendar-card,
  .vacation-team-block {
    padding: 13px;
  }

  #vacationPanel .vacation-calendar .calendar-weekdays,
  #vacationPanel .vacation-calendar .calendar-grid {
    gap: 4px;
  }

  #vacationPanel .vacation-calendar .calendar-day {
    max-width: 46px;
    min-height: 42px;
    border-radius: 10px;
  }

  .vacation-selected-person-chip {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .vacation-selected-person-avatar {
    width: 36px;
    height: 36px;
  }

  .vacation-selected-person-chip .vacation-person-count {
    display: none;
  }

  .work-order-breaks-field > summary {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .work-order-breaks-icon {
    width: 42px;
    height: 42px;
  }

  .work-order-breaks-toggle b {
    display: none !important;
  }

  .work-order-breaks-toggle {
    padding: 8px;
  }

  .work-order-breaks-field .work-order-break-row,
  .work-order-breaks-field .work-order-break-extra {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 10px;
  }
}

/* V0.21: czytelny, zwijany pulpit CRM dla komputerow. */
@media (min-width: 980px) {
  body.desktop-layout-active {
    --crm-content-width: 1640px;
    font-size: 15px;
  }

  .app-shell.desktop-layout {
    --desktop-sidebar-width: 268px;
    grid-template-rows: 64px auto;
    gap: 18px;
    padding: 0 24px 28px 0;
  }

  .app-shell.desktop-layout > .topbar {
    min-height: 64px;
    padding: 0 24px;
  }

  .app-shell.desktop-layout .hamburger-button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.16);
    background: #1d2b3e;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout .hamburger-button {
    color: #fff;
    background: #1479f7;
    box-shadow: 0 8px 22px rgba(20,121,247,.3);
  }

  .app-shell.desktop-layout .topbar-title h1 { font-size: 1.15rem; }
  .app-shell.desktop-layout .topbar-title .user-button { font-size: .78rem; }

  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] {
    top: 64px;
    height: calc(100vh - 64px);
    padding: 14px 12px 16px;
  }

  .app-shell.desktop-layout .side-menu-list { gap: 8px; padding: 8px 0 14px; }
  .app-shell.desktop-layout .side-nav-group { gap: 3px; }
  .app-shell.desktop-layout .side-nav-group-label,
  .app-shell.desktop-layout .side-admin-nav-group > p { font-size: .68rem !important; letter-spacing: .1em; }
  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button {
    min-height: 42px;
    padding: 9px 11px;
    font-size: .82rem !important;
    line-height: 1.25;
  }

  .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active {
    width: min(100%, var(--crm-content-width)) !important;
    max-width: var(--crm-content-width) !important;
    justify-self: center;
  }

  .app-shell.desktop-layout :is(.panel, .vehicle-panel, .admin-panel, .daily-note, .history-section, .summary-card) {
    padding: 22px;
    border-radius: 16px;
  }

  .app-shell.desktop-layout :is(input, select, textarea, button) {
    font-size: .875rem !important;
    line-height: 1.35;
  }

  .app-shell.desktop-layout :is(p, label, td, .form-hint, .vehicle-item span, .entry-card span) {
    font-size: .875rem !important;
    line-height: 1.45;
  }

  .app-shell.desktop-layout :is(small, .employee-empty-value) {
    font-size: .78rem !important;
    line-height: 1.4;
  }

  .app-shell.desktop-layout :is(th, .eyebrow) {
    font-size: .75rem !important;
    line-height: 1.35;
  }

  .app-shell.desktop-layout :is(h2, .section-title h2) { font-size: 1.35rem; line-height: 1.25; }
  .app-shell.desktop-layout h3 { font-size: 1rem; line-height: 1.3; }

  .app-shell.desktop-layout :is(.inventory-table-wrap, .employees-table-wrap, .toa-table-wrap) {
    max-height: min(64vh, 760px);
    overflow: auto;
    border-radius: 13px;
  }

  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table) th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 13px;
  }

  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table) td { padding: 13px; }
  .app-shell.desktop-layout .employees-table { min-width: 1120px; }
  .app-shell.desktop-layout .employee-qualification-badge { font-size: .72rem; padding: 5px 8px; }

  .app-shell.desktop-layout .operations-alert-metrics { gap: 12px; }
  .app-shell.desktop-layout .operations-alert-metric { min-height: 82px; padding: 15px 17px; }
  .app-shell.desktop-layout .operations-alert-metric b { font-size: 1.65rem; }
  .app-shell.desktop-layout .operations-alert-item {
    min-height: 76px;
    padding: 12px 14px;
    gap: 13px;
  }
  .app-shell.desktop-layout .operations-alert-copy { gap: 4px; }
  .app-shell.desktop-layout .operations-alert-copy > span { font-size: .7rem; }
  .app-shell.desktop-layout .operations-alert-copy strong { font-size: .93rem; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-copy small { font-size: .8rem !important; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-meta { min-width: 150px; }

  .app-shell.desktop-layout .reviews-alert-grid { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
  .app-shell.desktop-layout .review-alert-column { min-height: 330px; padding: 16px; }
  .app-shell.desktop-layout .review-alert-card { padding: 14px; }
  .app-shell.desktop-layout .review-alert-card-copy strong { font-size: .9rem; }
  .app-shell.desktop-layout .review-alert-card-copy span,
  .app-shell.desktop-layout .review-alert-card-status small { font-size: .78rem; }

  .app-shell.desktop-layout .vehicle-form { gap: 12px; }
  .app-shell.desktop-layout .vehicle-item { padding: 16px; border-radius: 13px; }
  .app-shell.desktop-layout .vehicle-list { gap: 12px; }
  .app-shell.desktop-layout .section-title { margin-bottom: 14px; }

  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 10px;
  }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-card {
    min-height: 132px !important;
    padding: 13px !important;
  }
  .app-shell.desktop-layout .boss-technician-role { font-size: .68rem; }

  .app-shell.desktop-layout .employees-toolbar {
    grid-template-columns: minmax(320px, 1fr) 240px auto;
    gap: 12px;
    padding: 13px;
    border: 1px solid #dbe7f3;
    border-radius: 13px;
    background: #f7faff;
  }
}

@media (min-width: 980px) and (max-width: 1350px) {
  body.desktop-layout-active { --crm-content-width: 1180px; }
  .app-shell.desktop-layout .reviews-alert-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .app-shell.desktop-layout .inventory-table { min-width: 900px; table-layout: fixed; }
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(5),
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(8),
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(9),
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(10) { display: none; }
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(1) { width: 19%; }
  .app-shell.desktop-layout .inventory-table :is(th, td):nth-child(2) { width: 21%; }
  .app-shell.desktop-layout .inventory-table :is(th, td):last-child { width: 105px; }
}

/* V9.53 - spersonalizowana instrukcja ról, bezpieczeństwa i obiegu dokumentów */
.guide-role-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 10px 0 12px;
}

.guide-role-summary strong,
.guide-role-summary span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.guide-role-summary strong {
  color: #fff;
  background: linear-gradient(135deg, #146c43, #0e5133);
}

.guide-role-summary span {
  color: #15579f;
  background: #eaf4ff;
}

.guide-content {
  display: grid;
  gap: 18px;
  padding-top: 22px;
}

.guide-chapter {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 26px);
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 18px;
  background: var(--opsui-surface-muted, #f8fafc);
}

.guide-chapter-heading {
  margin-bottom: 17px;
}

.guide-chapter-heading h2 {
  margin: 4px 0 7px;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
}

.guide-chapter-heading > p:last-child {
  max-width: 980px;
  margin: 0;
  color: var(--opsui-muted, #64748b);
  line-height: 1.5;
}

.guide-role-grid,
.guide-safety-role-grid,
.guide-admin-grid,
.guide-hidden-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-role-card,
.guide-safety-role,
.guide-admin-grid article,
.guide-hidden-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 14px;
  background: var(--opsui-surface, #fff);
}

.guide-role-card span {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 8px;
  color: #fff;
  background: #2376d8;
  font-size: 0.76rem;
  font-weight: 950;
}

.guide-role-card p,
.guide-safety-role p,
.guide-admin-grid p,
.guide-hidden-grid p {
  margin: 0;
  color: var(--opsui-muted, #64748b);
  line-height: 1.48;
}

.guide-stop-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border: 2px solid #dc2626;
  border-radius: 15px;
  background: #fff1f2;
}

.guide-stop-rule strong {
  padding: 9px 12px;
  border-radius: 9px;
  color: #fff;
  background: #b91c1c;
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.guide-stop-rule p {
  margin: 0;
  color: #7f1d1d;
  font-weight: 700;
  line-height: 1.48;
}

.guide-safety-role {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
}

.guide-safety-role > b {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: #15263a;
  font-size: 0.8rem;
}

.guide-safety-role h3,
.guide-admin-grid h3,
.guide-hidden-grid h3 {
  margin: 1px 0 6px;
  font-size: 0.96rem;
}

.guide-workflow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-workflow li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 14px;
  background: var(--opsui-surface, #fff);
}

.guide-workflow li > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: #2376d8;
  font-weight: 950;
}

.guide-workflow strong {
  display: block;
  margin: 1px 0 4px;
}

.guide-workflow p {
  margin: 0;
  color: var(--opsui-muted, #64748b);
  line-height: 1.45;
}

.guide-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-status-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 14px;
  background: var(--opsui-surface, #fff);
}

.guide-status-grid article > span {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  border-radius: 50%;
}

.guide-status-grid article.danger > span { background: #dc2626; box-shadow: 0 0 0 5px #fee2e2; }
.guide-status-grid article.warning > span { background: #e3a008; box-shadow: 0 0 0 5px #fef3c7; }
.guide-status-grid article.good > span { background: #16a34a; box-shadow: 0 0 0 5px #dcfce7; }

.guide-status-grid h3 {
  margin: 0 0 7px;
  font-size: 0.94rem;
}

.guide-status-grid p {
  margin: 0;
  color: var(--opsui-muted, #64748b);
  line-height: 1.45;
}

.guide-sms-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 15px;
  align-items: start;
  margin-top: 13px;
  padding: 17px;
  border: 1px solid #93c5fd;
  border-radius: 15px;
  background: #eff8ff;
}

.guide-sms-note > span {
  display: grid;
  min-width: 54px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: #2376d8;
  font-size: 0.78rem;
  font-weight: 950;
}

.guide-sms-note h3,
.guide-sms-note p {
  margin: 0;
}

.guide-sms-note p {
  margin-top: 5px;
  color: #38516c;
  line-height: 1.5;
}

.guide-route-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-route-card {
  min-width: 0;
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 14px;
  background: var(--opsui-surface, #fff);
  overflow: hidden;
}

.guide-route-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 70px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.guide-route-card summary::-webkit-details-marker { display: none; }

.guide-route-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: #2376d8;
  font-size: 0.78rem;
  font-weight: 950;
}

.guide-route-card summary b,
.guide-route-card summary small {
  display: block;
}

.guide-route-card summary small {
  margin-top: 3px;
  color: var(--opsui-muted, #64748b);
}

.guide-expand-label {
  color: #15579f;
  font-size: 0.76rem;
  font-weight: 900;
}

.guide-route-card[open] .guide-expand-label { font-size: 0; }
.guide-route-card[open] .guide-expand-label::after { content: "Zwiń"; font-size: 0.76rem; }

.guide-route-body {
  padding: 0 15px 16px 64px;
  border-top: 1px solid var(--opsui-border, #e2e8f0);
}

.guide-route-body > p {
  margin: 14px 0 10px;
  font-weight: 750;
  line-height: 1.48;
}

.guide-route-body ul {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--opsui-muted, #64748b);
  line-height: 1.45;
}

.guide-route-body button,
.guide-admin-grid button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #9ec7f6;
  border-radius: 10px;
  color: #15579f;
  background: #eef7ff;
  font-weight: 850;
}

.guide-admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-admin-grid article {
  display: flex;
  flex-direction: column;
}

.guide-admin-grid p {
  flex: 1;
  margin-bottom: 13px;
}

.guide-hidden-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.guide-hidden-grid article > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #15579f;
  background: #eaf4ff;
  font-size: 1.15rem;
  font-weight: 950;
}

.guide-final-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 2px solid #16a34a;
  border-radius: 16px;
  color: #14532d;
  background: #f0fdf4;
}

.guide-final-check strong {
  padding: 8px 11px;
  border-radius: 9px;
  color: #fff;
  background: #168a4a;
  white-space: nowrap;
}

.guide-final-check p { margin: 0; font-weight: 750; line-height: 1.48; }

body.theme-dark .guide-role-summary span,
body.theme-dark .guide-hidden-grid article > span {
  color: #dbeafe;
  background: #173653;
}

body.theme-dark .guide-stop-rule {
  border-color: #ef5962;
  background: #3a1821;
}

body.theme-dark .guide-stop-rule p { color: #fecdd3; }

body.theme-dark .guide-safety-role > b { background: #07111f; }

body.theme-dark .guide-sms-note {
  border-color: #315f8f;
  background: #122d48;
}

body.theme-dark .guide-sms-note p { color: #b9d4ec; }

body.theme-dark .guide-route-body button,
body.theme-dark .guide-admin-grid button {
  border-color: #315f8f;
  color: #dbeafe;
  background: #132d48;
}

body.theme-dark .guide-final-check {
  border-color: #2c9b5c;
  color: #bbf7d0;
  background: #153826;
}

.app-shell.desktop-layout .guide-panel {
  max-width: 1480px;
}

.app-shell.desktop-layout .guide-chapter :is(p, li, button, small) {
  font-size: 0.84rem;
}

@media (max-width: 1099px) {
  .guide-admin-grid,
  .guide-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout #toolList { display: block; }
  .app-shell.desktop-layout :is(#vehicleList, #heavyEquipmentList, #toolList, #subcontractorsList, #trainingList, #ppeList) > :is(.inventory-table-wrap, .empty-state) {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 699px) {
  .guide-content {
    gap: 13px;
    padding-top: 16px;
  }

  .guide-role-summary {
    align-items: stretch;
  }

  .guide-role-summary strong,
  .guide-role-summary span {
    justify-content: center;
  }

  .guide-chapter {
    padding: 16px 13px;
    border-radius: 15px;
  }

  .guide-role-grid,
  .guide-safety-role-grid,
  .guide-workflow,
  .guide-route-list,
  .guide-admin-grid,
  .guide-hidden-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-stop-rule,
  .guide-final-check {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .guide-stop-rule strong,
  .guide-final-check strong {
    justify-self: start;
  }

  .guide-route-card summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .guide-expand-label {
    grid-column: 2;
  }

  .guide-route-body {
    padding: 0 13px 15px;
  }

  .guide-sms-note {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-sms-note > span {
    justify-self: start;
  }
}

/* V9.52 - finalne pierwszenstwo stylu archiwum po starszych wariantach Notatnika */
.personal-note-item.note-archived,
body.theme-dark .personal-note-item.note-archived {
  border-color: var(--opsui-border, #94a3b8);
  background: var(--opsui-surface-muted, #eef2f6);
  box-shadow: none;
  opacity: 0.82;
  filter: saturate(0.55);
}

.personal-note-workflow.archived,
body.theme-dark .personal-note-workflow.archived {
  border-color: #94a3b8;
  color: var(--opsui-text, #334155);
  background: var(--opsui-surface-muted, #e2e8f0);
}

/* Instrukcja, podpowiedzi i archiwum Notatnika */
.guidance-toggle-button {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: inherit;
  background: transparent;
}

.guidance-toggle-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.13);
}

.guidance-toggle-button.is-active {
  color: #ecfdf5 !important;
  border-color: rgba(34, 197, 94, 0.48) !important;
  background: linear-gradient(135deg, #168a4a, #126b3b) !important;
  box-shadow: 0 8px 18px rgba(22, 138, 74, 0.22);
}

.guidance-toggle-button.is-active .guidance-toggle-dot {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}

.context-guidance {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: min(100%, var(--ops-page-width, 1480px));
  min-width: 0;
  margin: 0 auto;
  padding: 13px 15px;
  border: 1px solid #93c5fd;
  border-radius: 16px;
  color: #0f2945;
  background: linear-gradient(135deg, #eff8ff, #e8f5ff);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
}

.context-guidance[hidden] {
  display: none !important;
}

.context-guidance-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #2376d8;
  font-size: 1.1rem;
  font-weight: 950;
}

.context-guidance-copy {
  min-width: 0;
}

.context-guidance-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.context-guidance-copy p {
  margin: 0;
  color: #38516c;
  font-size: 0.84rem;
  line-height: 1.4;
}

.context-guidance-action {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #2376d8;
  border-radius: 10px;
  color: #fff;
  background: #2376d8;
  font-weight: 850;
  white-space: nowrap;
}

.context-guidance-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #34506c;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.3rem;
}

body.theme-dark .context-guidance {
  border-color: #315f8f;
  color: #e0f2fe;
  background: linear-gradient(135deg, #122d48, #10263d);
}

body.theme-dark .context-guidance-copy p {
  color: #b9d4ec;
}

body.theme-dark .context-guidance-close {
  border-color: #315f8f;
  color: #dbeafe;
  background: #173653;
}

.guide-panel {
  width: min(100%, var(--ops-page-width, 1480px));
  min-width: 0;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 20px;
  color: var(--opsui-text, #132033);
  background: var(--opsui-surface, #fff);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1);
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--opsui-border, #dbe3ec);
}

.guide-brand {
  display: grid;
  min-height: 126px;
  padding: 22px;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #f8fbff;
}

.guide-brand img {
  display: block;
  width: min(100%, 178px);
  max-height: 94px;
  object-fit: contain;
}

.guide-hero h2 {
  margin: 5px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.guide-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--opsui-muted, #64748b);
  line-height: 1.55;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 24px;
}

.guide-steps article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--opsui-border, #d8e1eb);
  border-radius: 16px;
  background: var(--opsui-surface-muted, #f8fafc);
}

.guide-steps article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #2376d8;
  font-size: 0.84rem;
  font-weight: 950;
}

.guide-steps h3 {
  margin: 2px 0 7px;
  font-size: 1.02rem;
}

.guide-steps p {
  min-height: 78px;
  margin: 0 0 13px;
  color: var(--opsui-muted, #64748b);
  font-size: 0.88rem;
  line-height: 1.48;
}

.guide-steps button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #9ec7f6;
  border-radius: 10px;
  color: #15579f;
  background: #eef7ff;
  font-weight: 850;
}

.guide-tips-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #86efac;
  border-radius: 16px;
  background: #f0fdf4;
}

.guidance-toggle-preview {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ecfdf5;
  background: #168a4a;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.guidance-toggle-preview span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
}

.guide-tips-info h3,
.guide-tips-info p {
  margin: 0;
}

.guide-tips-info p {
  margin-top: 4px;
  color: #37614a;
  line-height: 1.45;
}

body.theme-dark .guide-brand,
body.theme-dark .guide-steps button {
  border-color: #315f8f;
  color: #dbeafe;
  background: #132d48;
}

body.theme-dark .guide-tips-info {
  border-color: #287b4b;
  background: #153826;
}

body.theme-dark .guide-tips-info p {
  color: #bbf7d0;
}

.personal-notes-list {
  display: grid;
  gap: 18px;
}

.personal-note-section {
  display: grid;
  gap: 10px;
}

.personal-note-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--opsui-border, #dbe3ec);
}

.personal-note-section-heading h3 {
  margin: 0;
}

.personal-note-section-heading span {
  display: grid;
  min-width: 34px;
  min-height: 30px;
  padding: 4px 10px;
  place-items: center;
  border-radius: 999px;
  color: #15579f;
  background: #eaf4ff;
  font-weight: 900;
}

.personal-note-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.personal-note-item.note-archived {
  border-color: var(--opsui-border, #cbd5e1);
  opacity: 0.82;
  box-shadow: none;
  filter: saturate(0.55);
}

.personal-note-workflow.archived {
  color: #475569;
  background: #e2e8f0;
}

.note-archive-trigger {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.note-archive-trigger:hover {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  outline-offset: -2px;
}

@media (min-width: 700px) and (max-width: 1099px) {
  .guide-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .context-guidance {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
  }

  .context-guidance-action {
    grid-column: 2 / -1;
    width: 100%;
  }

  .context-guidance-close {
    grid-column: 3;
    grid-row: 1;
  }

  .guide-panel {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .guide-hero {
    grid-template-columns: 1fr;
  }

  .guide-brand {
    min-height: 102px;
  }

  .guide-steps,
  .personal-note-section-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-steps article {
    min-height: 0;
  }

  .guide-steps p {
    min-height: 0;
  }

  .guide-tips-info {
    grid-template-columns: 1fr;
  }

  .guidance-toggle-preview {
    justify-self: start;
  }
}

/* V9.49: ostatni priorytet dla akcji wyboru po starszych stylach modulow. */
body .app-shell button.selection-icon-button,
body.theme-dark .app-shell button.selection-icon-button,
#adminPanel .admin-selected-users .collaborator-chip button.selection-icon-button {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 1px solid var(--selection-border) !important;
  border-radius: 8px !important;
  color: var(--selection-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body .app-shell button.selection-icon-button.user-favorite-toggle.active,
body.theme-dark .app-shell button.selection-icon-button.user-favorite-toggle.active {
  border-color: color-mix(in srgb, var(--selection-accent) 42%, transparent) !important;
  color: var(--selection-accent) !important;
  background: var(--selection-accent-soft) !important;
}

body .app-shell button.selection-icon-button.user-favorite-toggle:hover {
  border-color: color-mix(in srgb, var(--selection-accent) 42%, transparent) !important;
  color: var(--selection-accent) !important;
  background: var(--selection-accent-soft) !important;
}

body .app-shell button.selection-icon-button.user-remove-action:hover,
#adminPanel .admin-selected-users .collaborator-chip button.selection-icon-button.user-remove-action:hover {
  border-color: color-mix(in srgb, var(--selection-danger) 40%, transparent) !important;
  color: var(--selection-danger) !important;
  background: var(--selection-danger-soft) !important;
}

/* V9.49: wspolny, profesjonalny system prezentacji wybranych pozycji. */
:root {
  --selection-panel: #f4f7fb;
  --selection-card: #ffffff;
  --selection-card-hover: #f9fbff;
  --selection-border: #d8e1ec;
  --selection-border-strong: #a9c9ee;
  --selection-text: #142033;
  --selection-muted: #68778b;
  --selection-accent: #1479f7;
  --selection-accent-soft: #eaf3ff;
  --selection-danger: #c7353d;
  --selection-danger-soft: #fff1f2;
  --selection-favorite: #a86f00;
  --selection-favorite-soft: #fff7dc;
}

body.theme-dark {
  --selection-panel: #101a28;
  --selection-card: #172334;
  --selection-card-hover: #1a293d;
  --selection-border: #34465d;
  --selection-border-strong: #4e78aa;
  --selection-text: #f4f8fd;
  --selection-muted: #9badc2;
  --selection-accent: #62a7ff;
  --selection-accent-soft: rgba(35, 134, 255, 0.15);
  --selection-danger: #ff9da3;
  --selection-danger-soft: rgba(239, 68, 68, 0.12);
  --selection-favorite: #ffd264;
  --selection-favorite-soft: rgba(245, 183, 45, 0.12);
}

.selected-collaborators,
.work-order-selected-users {
  min-width: 0;
  gap: 10px;
}

.work-order-selected-users,
body.theme-dark .work-order-selected-users,
body.theme-dark .app-shell.desktop-layout .work-order-selected-users {
  padding: 12px;
  border: 1px solid var(--selection-border);
  border-radius: 12px;
  color: var(--selection-text);
  background: var(--selection-panel);
  box-shadow: none;
}

.selection-summary-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--selection-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.selection-summary-header b {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  padding-inline: 7px;
  border: 1px solid color-mix(in srgb, var(--selection-accent) 32%, transparent);
  border-radius: 8px;
  color: var(--selection-accent);
  background: var(--selection-accent-soft);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.selection-person-grid,
.work-order-selected-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
}

.selection-person-grid--timed {
  grid-template-columns: 1fr;
}

body .collaborator-chip.selection-person-card,
body .work-order-user-chip.selection-person-card,
#adminPanel .admin-selected-users .collaborator-chip.selection-person-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas: "avatar copy actions";
  min-width: 0;
  min-height: 68px;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid var(--selection-border);
  border-radius: 11px;
  color: var(--selection-text);
  background: var(--selection-card);
  box-shadow: 0 5px 14px rgba(20, 38, 63, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body .collaborator-chip.selection-person-card:hover,
body .work-order-user-chip.selection-person-card:hover,
#adminPanel .admin-selected-users .collaborator-chip.selection-person-card:hover {
  border-color: var(--selection-border-strong);
  background: var(--selection-card-hover);
  box-shadow: 0 8px 20px rgba(20, 38, 63, 0.08);
}

.selection-person-avatar {
  display: grid;
  grid-area: avatar;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--selection-accent) 28%, transparent);
  border-radius: 11px;
  color: var(--selection-accent);
  background: var(--selection-accent-soft);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.045em;
}

.selection-person-copy {
  display: grid;
  grid-area: copy;
  min-width: 0;
  gap: 3px;
}

body .selection-person-copy b,
#adminPanel .admin-selected-users .selection-person-copy b {
  overflow: hidden;
  color: var(--selection-text);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.005em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .selection-person-copy small,
#adminPanel .admin-selected-users .selection-person-copy small {
  overflow: hidden;
  color: var(--selection-muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-person-actions {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

body .selection-icon-button,
#adminPanel .admin-selected-users .collaborator-chip .selection-icon-button {
  display: inline-grid;
  position: static;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--selection-border);
  border-radius: 9px;
  color: var(--selection-muted);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

body .selection-icon-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  pointer-events: none;
}

body .selection-icon-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--selection-accent) 30%, transparent);
  outline-offset: 2px;
}

body .selection-icon-button.user-favorite-toggle:hover,
body .selection-icon-button.user-favorite-toggle.active {
  border-color: color-mix(in srgb, var(--selection-favorite) 46%, transparent);
  color: var(--selection-favorite);
  background: var(--selection-favorite-soft);
}

body .selection-icon-button.user-remove-action:hover,
#adminPanel .admin-selected-users .collaborator-chip .selection-icon-button.user-remove-action:hover {
  border-color: color-mix(in srgb, var(--selection-danger) 44%, transparent);
  color: var(--selection-danger);
  background: var(--selection-danger-soft);
}

.selection-state {
  justify-self: end;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--selection-accent) 25%, transparent);
  border-radius: 8px;
  color: var(--selection-accent);
  background: var(--selection-accent-soft);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

body .collaborator-chip.selection-person-card.selection-person-card--timed {
  grid-template-columns: 42px minmax(160px, 1fr) minmax(220px, auto) auto auto;
  grid-template-areas: "avatar copy time duration actions";
}

.selection-time-fields {
  display: grid;
  grid-area: time;
  grid-template-columns: repeat(2, minmax(94px, 1fr));
  gap: 7px;
}

.selection-time-fields label {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: var(--selection-muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body .collaborator-chip.selection-person-card .selection-time-fields select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 28px 6px 9px;
  border-color: var(--selection-border);
  border-radius: 8px;
  color: var(--selection-text);
  background-color: var(--selection-panel);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: left;
}

body .selection-duration {
  grid-area: duration;
  min-width: 64px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--selection-accent);
  background: var(--selection-accent-soft);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

#adminPanel .admin-selected-users,
.boss-selected-users {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
}

#adminPanel .admin-selected-users .selection-all-card,
.boss-selected-users .selection-all-card {
  grid-column: 1 / -1;
}

/* Tak samo wyglada aktywny wybor w analizach i polach wielokrotnych. */
.analytics-client-technician-grid label {
  border-radius: 10px;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.analytics-client-technician-grid label:has(input:checked) {
  border-color: color-mix(in srgb, var(--selection-accent) 48%, transparent);
  background: var(--selection-accent-soft);
  box-shadow: inset 3px 0 0 var(--selection-accent);
}

.analytics-client-technician-grid input[type="checkbox"],
.role-checkbox-grid input[type="checkbox"],
.checkbox-card input[type="checkbox"] {
  accent-color: var(--selection-accent);
}

select[multiple] {
  padding: 6px;
  border-color: var(--selection-border);
  border-radius: 10px;
  background: var(--selection-card);
}

select[multiple] option {
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 7px;
}

select[multiple] option:checked {
  color: var(--selection-text);
  background: linear-gradient(var(--selection-accent-soft), var(--selection-accent-soft));
  font-weight: 850;
}

@media (max-width: 700px) {
  .work-order-selected-users,
  body.theme-dark .work-order-selected-users,
  body.theme-dark .app-shell.desktop-layout .work-order-selected-users {
    padding: 10px;
  }

  .selection-person-grid,
  .work-order-selected-chips,
  #adminPanel .admin-selected-users,
  .boss-selected-users {
    grid-template-columns: minmax(0, 1fr);
  }

  body .collaborator-chip.selection-person-card,
  body .work-order-user-chip.selection-person-card,
  #adminPanel .admin-selected-users .collaborator-chip.selection-person-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "avatar copy actions";
    min-height: 64px;
    padding: 10px;
  }

  .selection-person-avatar {
    width: 40px;
    height: 40px;
  }

  body .collaborator-chip.selection-person-card.selection-person-card--timed {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar copy actions"
      "time time time"
      "duration duration duration";
    align-items: center;
  }

  .selection-time-fields {
    width: 100%;
    margin-top: 2px;
  }

  body .selection-duration {
    justify-self: stretch;
    min-width: 0;
  }

  .selection-state {
    display: none;
  }
}

/* V9.46: wybor osoby jest natychmiastowy; akcje ulubione/usun pozostaja przy wybranej osobie. */
body.theme-dark #newReportPanel .collaborator-chip .user-favorite-toggle,
body.theme-dark .app-shell.desktop-layout .work-order-user-chip .user-favorite-toggle {
  color: #ffd65c;
  border-color: #8c7425;
  background: #3d3518;
}

body.theme-dark #newReportPanel .collaborator-chip .user-remove-action,
body.theme-dark .app-shell.desktop-layout .work-order-user-chip .user-remove-action {
  color: #ffb4b8;
  border-color: #7a343a;
  background: #421f25;
}

/* V9.45 — pulpit operacyjny Leadera i poprawka iPada 8. generacji. */
#leaderOperationsPanel {
  width: min(100%, var(--ops-page-width, 1440px));
  margin-right: auto;
  margin-left: auto;
  padding: clamp(14px, 2vw, 22px);
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: var(--ops-shadow);
}

.leader-operations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--opsui-border);
}

.leader-operations-heading h2,
.leader-operations-heading p {
  margin: 0;
}

.leader-operations-heading h2 {
  margin-top: 3px;
  color: var(--opsui-text);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.leader-operations-heading > div > p:last-child {
  margin-top: 5px;
  color: var(--opsui-muted);
  font-size: 0.76rem;
}

.leader-working-count {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 36px;
  padding: 6px 11px;
  place-items: center;
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 999px;
  color: #dcfce7;
  background: #12633f;
  font-size: 0.86rem;
  font-weight: 950;
}

#leaderOperationsPanel .leader-available-technicians-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

#leaderOperationsPanel .leader-technician-location {
  min-width: 0;
  min-height: 82px;
  padding: 12px 13px;
  gap: 4px 11px;
}

#leaderOperationsPanel .leader-technician-location > i {
  grid-row: 1 / span 3;
  margin-top: 6px;
}

#leaderOperationsPanel .leader-technician-location-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

#leaderOperationsPanel .leader-technician-location strong {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

#leaderOperationsPanel .leader-technician-location b,
#leaderOperationsPanel .leader-technician-location small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#leaderOperationsPanel .leader-technician-location small {
  color: #bbf7d0;
  font-weight: 800;
}

.app-shell.leader-home-layout #activeWorkOrdersPanel > .section-title {
  margin-bottom: 12px;
}

.app-shell.leader-home-layout #userWorkOrdersList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.app-shell.leader-home-layout #userWorkOrdersList .user-work-order {
  min-width: 0;
  height: 100%;
  padding: 13px;
}

.app-shell.leader-home-layout #userWorkOrdersList .user-work-order.work-order-card-expanded {
  grid-column: 1 / -1;
}

.app-shell.leader-home-layout #userWorkOrdersList .user-work-order-info,
.app-shell.leader-home-layout #userWorkOrdersList .user-work-order-info > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.leader-home-layout {
    grid-auto-flow: row;
    grid-auto-rows: auto;
  }

  .app-shell.desktop-layout.leader-home-layout > .topbar,
  .app-shell.desktop-layout.leader-home-layout > section {
    grid-row-end: auto !important;
  }

  .app-shell.desktop-layout.leader-home-layout > :is(
    #activeWorkOrdersPanel,
    #leaderOperationsPanel,
    #dailyNote,
    #deadlineAlerts
  ) {
    grid-column: 2 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.leader-home-layout > :is(
    #activeWorkOrdersPanel,
    #leaderOperationsPanel,
    #dailyNote,
    #deadlineAlerts
  ) {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout.route-mode-active > #leaderAnalyticsPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #leaderAnalyticsPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 700px) and (max-width: 1179px) {
  .app-shell.leader-home-layout #userWorkOrdersList,
  #leaderOperationsPanel .leader-available-technicians-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .app-shell.leader-home-layout #userWorkOrdersList,
  #leaderOperationsPanel .leader-available-technicians-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .leader-operations-heading {
    align-items: flex-start;
  }

  #leaderOperationsPanel .leader-technician-location {
    min-height: 76px;
  }
}

/* iPad 8 (768 CSS px): kontrolki miesiąca mieszczą się w panelu i nic nie
   zasłania prawego przycisku nawigacji. */
@media (min-width: 621px) and (max-width: 900px) {
  #technicianOverviewPanel .technician-overview-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  #technicianOverviewPanel .technician-overview-heading > *,
  #technicianOverviewPanel .technician-overview-period,
  #technicianOverviewPanel .technician-month-navigation {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #technicianOverviewPanel .technician-month-navigation {
    grid-template-columns: 44px minmax(0, 1.35fr) minmax(0, 0.75fr) 44px;
  }

  #technicianOverviewPanel .technician-month-navigation button,
  #technicianOverviewPanel .technician-month-navigation select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body:not(.desktop-layout-active) .topbar {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }
}

/* V9.34 — mocny ranking godzin i rozliczenie zarobków pracowników */
.analytics-section.employee-hours-ranking {
  position: relative;
  overflow: hidden;
  border-color: rgba(34, 156, 255, 0.52);
  background:
    radial-gradient(circle at 92% 0%, rgba(35, 134, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(12, 36, 60, 0.98), rgba(9, 24, 42, 0.94));
  box-shadow: 0 18px 40px rgba(2, 12, 26, 0.28);
}

.employee-hours-ranking > h4,
.employee-earnings-ranking > h4 {
  font-size: 1.16rem;
  letter-spacing: 0.01em;
}

.employee-hours-ranking > h4::after {
  content: "GODZINY · OD NAJWIĘKSZEJ LICZBY";
  display: inline-flex;
  margin-left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #93caff;
  background: rgba(35, 134, 255, 0.13);
  font-size: 0.62rem;
  font-weight: 950;
  vertical-align: middle;
}

.employee-rank-row td {
  padding-top: 13px;
  padding-bottom: 13px;
}

.employee-rank-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 190, 45, 0.16), rgba(255, 190, 45, 0.025) 62%);
}

.employee-rank-row.rank-2 {
  background: linear-gradient(90deg, rgba(169, 190, 214, 0.13), rgba(169, 190, 214, 0.02) 62%);
}

.employee-rank-row.rank-3 {
  background: linear-gradient(90deg, rgba(201, 125, 75, 0.14), rgba(201, 125, 75, 0.02) 62%);
}

.analytics-rank.employee-rank-place {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 0.86rem;
  box-shadow: 0 8px 18px rgba(1, 12, 25, 0.22);
}

.employee-rank-place.rank-1 {
  border-color: rgba(255, 202, 76, 0.72);
  color: #2c2104;
  background: linear-gradient(145deg, #ffe58c, #dca91e);
}

.employee-rank-place.rank-2 {
  border-color: rgba(215, 229, 244, 0.7);
  color: #213044;
  background: linear-gradient(145deg, #eaf2fb, #9fb3ca);
}

.employee-rank-place.rank-3 {
  border-color: rgba(224, 151, 97, 0.72);
  color: #2c160a;
  background: linear-gradient(145deg, #f0b284, #b96d38);
}

.employee-hours-person {
  display: grid;
  grid-template-columns: minmax(160px, 0.55fr) minmax(140px, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  min-width: 360px;
}

.employee-hours-person > b {
  grid-row: 1;
}

.employee-hours-person > small {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.66rem;
}

.employee-hours-share {
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.employee-hours-share > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2386ff, #21c875);
  box-shadow: 0 0 14px rgba(35, 134, 255, 0.4);
}

.employee-hours-person > em {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: #8fb8e4;
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.employee-hours-total {
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 1000;
  white-space: nowrap;
}

.analytics-section.employee-earnings-ranking {
  border-color: rgba(33, 200, 117, 0.38);
  background:
    radial-gradient(circle at 92% 0%, rgba(33, 200, 117, 0.14), transparent 34%),
    rgba(13, 28, 46, 0.9);
}

.employee-earnings-total {
  color: #7fe2ad;
  font-size: 0.98rem;
  font-weight: 1000;
  white-space: nowrap;
}

.employee-missing-rate {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 9px;
  color: #ffd183;
  background: rgba(244, 196, 48, 0.13);
  font-size: 0.72rem;
  font-weight: 900;
}

body.theme-light .analytics-section.employee-hours-ranking {
  border-color: #9fc9f5;
  background:
    radial-gradient(circle at 92% 0%, rgba(35, 134, 255, 0.1), transparent 34%),
    linear-gradient(145deg, #ffffff, #f3f8fd);
}

body.theme-light .employee-hours-share {
  background: #dce8f4;
}

body.theme-light .employee-hours-person > em {
  color: #466984;
}

body.theme-light .employee-hours-total {
  color: #162b42;
}

body.theme-light .analytics-section.employee-earnings-ranking {
  border-color: #9fd9bb;
  background: linear-gradient(145deg, #ffffff, #f1fbf6);
}

body.theme-light .employee-earnings-total {
  color: #08783c;
}

@media (max-width: 760px) {
  .employee-hours-ranking > h4::after {
    display: none;
  }

  .employee-hours-person {
    min-width: 250px;
    grid-template-columns: minmax(130px, 0.8fr) minmax(100px, 1fr);
  }

  .employee-hours-person > em {
    display: none;
  }
}

/* V9.33 - kontrolowany import historycznych certyfikatow. */
.certificate-import-launch {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.certificate-import-launch[hidden] {
  display: none;
}

.certificate-import-launch small {
  color: var(--muted);
  line-height: 1.45;
}

dialog.certificate-import-dialog {
  width: min(94vw, 1480px);
  max-width: 1480px;
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

dialog.certificate-import-dialog::backdrop {
  background: rgba(4, 10, 18, 0.78);
  backdrop-filter: blur(5px);
}

.certificate-import-dialog > form {
  display: grid;
  gap: 16px;
  max-height: 92dvh;
  padding: clamp(18px, 2vw, 28px);
  overflow-y: auto;
}

.certificate-import-head,
.certificate-import-actions,
.certificate-import-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.certificate-import-head {
  position: sticky;
  top: calc(-1 * clamp(18px, 2vw, 28px));
  z-index: 4;
  margin: calc(-1 * clamp(18px, 2vw, 28px)) calc(-1 * clamp(18px, 2vw, 28px)) 0;
  padding: 20px clamp(18px, 2vw, 28px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.certificate-import-head h3,
.certificate-import-section h4,
.certificate-import-head p {
  margin: 0;
}

.certificate-import-head h3 {
  margin: 3px 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.certificate-import-head p:last-child,
.certificate-import-section-title span {
  color: var(--muted);
}

.certificate-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.certificate-import-summary article {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, #2587ff 8%);
}

.certificate-import-summary article span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.certificate-import-summary article b {
  font-size: 1.35rem;
}

.certificate-import-summary article.has-warning {
  border-color: rgba(239, 173, 55, 0.5);
  background: rgba(239, 173, 55, 0.12);
}

.certificate-import-summary article.is-ready {
  border-color: rgba(31, 189, 105, 0.45);
  background: rgba(31, 189, 105, 0.1);
}

.certificate-import-month-choice {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(260px, 0.65fr);
  align-items: center;
  gap: 8px 14px;
  padding: 15px 17px;
  border: 1px solid rgba(37, 135, 255, 0.45);
  border-radius: 14px;
  background: rgba(37, 135, 255, 0.09);
}

.certificate-import-month-choice > span {
  font-weight: 900;
}

.certificate-import-month-choice > small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.certificate-import-notice {
  margin: 0;
  padding: 13px 15px;
  border-left: 4px solid #2587ff;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(37, 135, 255, 0.1);
  line-height: 1.5;
}

.certificate-import-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 97%, #2587ff 3%);
}

.certificate-import-section-title h4 {
  font-size: 1rem;
}

.certificate-import-section-title span {
  font-size: 0.78rem;
  text-align: right;
}

.certificate-import-mappings {
  display: grid;
  gap: 8px;
}

.certificate-import-map-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 30px minmax(260px, 1.35fr) minmax(130px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.certificate-import-map-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.certificate-import-map-row > span small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.certificate-import-map-row > span b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-import-map-row > i {
  color: #2587ff;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.certificate-import-map-status,
.certificate-import-row-status {
  display: inline-flex;
  justify-content: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.certificate-import-map-status.tone-exact,
.certificate-import-map-status.tone-manual,
.certificate-import-preview tr.is-ready .certificate-import-row-status {
  color: #0e7b43;
  background: rgba(31, 189, 105, 0.14);
}

.certificate-import-map-status.tone-suggested {
  color: #a86a09;
  background: rgba(239, 173, 55, 0.16);
}

.certificate-import-map-status.tone-missing,
.certificate-import-preview tr.has-warning .certificate-import-row-status {
  color: #c83e45;
  background: rgba(200, 62, 69, 0.14);
}

.certificate-import-preview-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.certificate-import-preview {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.certificate-import-preview th,
.certificate-import-preview td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.certificate-import-preview th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 90%, #2587ff 10%);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.certificate-import-preview td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.certificate-import-preview tr.has-warning {
  background: rgba(200, 62, 69, 0.045);
}

.certificate-import-actions {
  position: sticky;
  bottom: calc(-1 * clamp(18px, 2vw, 28px));
  z-index: 4;
  margin: 0 calc(-1 * clamp(18px, 2vw, 28px)) calc(-1 * clamp(18px, 2vw, 28px));
  padding: 15px clamp(18px, 2vw, 28px);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.certificate-import-actions .primary-button {
  min-width: min(100%, 390px);
}

body.theme-dark .certificate-import-map-status.tone-exact,
body.theme-dark .certificate-import-map-status.tone-manual,
body.theme-dark .certificate-import-preview tr.is-ready .certificate-import-row-status {
  color: #8ce9b5;
}

body.theme-dark .certificate-import-map-status.tone-suggested {
  color: #ffd58a;
}

body.theme-dark .certificate-import-map-status.tone-missing,
body.theme-dark .certificate-import-preview tr.has-warning .certificate-import-row-status {
  color: #ffafb5;
}

@media (max-width: 820px) {
  dialog.certificate-import-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .certificate-import-dialog > form {
    max-height: 100dvh;
    padding: 14px;
  }

  .certificate-import-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .certificate-import-month-choice {
    grid-template-columns: 1fr;
  }

  .certificate-import-month-choice > small {
    grid-column: auto;
  }

  .certificate-import-map-row {
    grid-template-columns: 1fr;
  }

  .certificate-import-map-row > i {
    display: none;
  }

  .certificate-import-section-title,
  .certificate-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .certificate-import-section-title span {
    text-align: left;
  }

  .certificate-import-actions button {
    width: 100%;
  }
}

@media (max-width: 767px) {
  body.theme-dark .boss-dashboard-panel .boss-history-table tr,
  body.theme-dark .boss-vacation-block .boss-history-table tr {
    background: rgba(15, 27, 42, 0.97) !important;
    color: #f6f9ff !important;
    border-color: rgba(112, 144, 178, 0.52) !important;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table td,
  body.theme-dark .boss-vacation-block .boss-history-table td,
  body.theme-dark .boss-dashboard-panel .boss-history-table td::before,
  body.theme-dark .boss-vacation-block .boss-history-table td::before {
    color: #eaf2ff !important;
  }

  body.theme-dark .boss-dashboard-panel .entry-card,
  body.theme-dark .boss-vacation-block .entry-card,
  body.theme-dark .boss-dashboard-panel .mobile-card,
  body.theme-dark .boss-vacation-block .mobile-card {
    background: rgba(15, 27, 42, 0.97) !important;
    color: #f6f9ff !important;
    border-color: rgba(112, 144, 178, 0.52) !important;
  }

  body.theme-dark .boss-dashboard-panel .entry-card *,
  body.theme-dark .boss-vacation-block .entry-card *,
  body.theme-dark .boss-dashboard-panel .mobile-card *,
  body.theme-dark .boss-vacation-block .mobile-card * {
    color: inherit !important;
  }
}

/* V8.30 - czytelne elementy w ciemnym trybie na komputerze i tablecie */
body.theme-dark #newReportPanel .calculated-time {
  color: #dbeafe;
  border-color: #2b8cff;
  background: #101a28;
  box-shadow: inset 0 0 0 1px #38506d;
}

body.theme-dark #newReportPanel .calculated-time strong {
  color: #ffffff;
}

body.theme-dark .closed-work-order-card,
body.theme-dark .entry-card.closed-work-order-card {
  color: #dbeafe;
  border-color: #334963;
  background: #101a28;
}

body.theme-dark .closed-work-order-card strong,
body.theme-dark .closed-work-order-card b,
body.theme-dark .closed-work-order-card span,
body.theme-dark .closed-work-order-card small {
  color: #dbeafe;
}

body.theme-dark .closed-work-order-card .history-pdf-button,
body.theme-dark .history-pdf-button,
body.theme-dark .work-order-download-button {
  color: #f8fbff;
  border: 1px solid #45617f;
  background: #253855;
}

body.theme-dark .closed-work-order-card .history-pdf-button span,
body.theme-dark .history-pdf-button span {
  color: #ffffff;
  background: #0f7bf6;
}

body.theme-dark .closed-work-order-card .history-pdf-button b,
body.theme-dark .history-pdf-button b {
  color: #ffffff;
}

body.theme-dark .closed-work-order-card .history-pdf-button.danger-action,
body.theme-dark .history-pdf-button.danger-action {
  color: #fee2e2;
  border-color: #ef4444;
  background: #7f1d1d;
}

body.theme-dark .closed-work-order-card .history-pdf-button.danger-action span,
body.theme-dark .history-pdf-button.danger-action span {
  color: #ffffff;
  background: #b91c1c;
}

.vacation-calendar .vacation-day.vacation-team-highlight {
  color: #831843;
  box-shadow: 0 0 0 5px rgba(236, 72, 153, 0.24), 0 0 0 9px rgba(236, 72, 153, 0.12);
  border-color: #ec4899;
  background: #fce7f3;
}

body.theme-dark .vacation-calendar .vacation-day.vacation-team-highlight {
  color: #fdf2f8;
  border-color: #f472b6;
  background: #831843;
  box-shadow: 0 0 0 5px rgba(244, 114, 182, 0.24), 0 0 0 9px rgba(244, 114, 182, 0.11);
}

.boss-vacation-table tr.vacation-team-row-active td {
  color: #831843;
  background: #fce7f3;
}

body.theme-dark .boss-vacation-table tr.vacation-team-row-active td {
  color: #fdf2f8;
  background: #831843;
}

/* V7.3 fluid layout guardrails */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

.app-shell,
.summary-card,
.panel,
.daily-note,
.history-section,
.admin-panel,
.vehicle-panel,
.entry-card,
.vehicle-item,
.admin-user-row,
.admin-work-order {
  max-width: 100%;
  min-width: 0;
}

.vehicle-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.field-row,
.field-row.two-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.entry-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.admin-user-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.vehicle-item strong,
.vehicle-item span,
.entry-card strong,
.entry-card span,
.admin-user-row span {
  overflow-wrap: anywhere;
}

.tool-admin-actions,
.admin-farm-actions,
.admin-user-actions,
.dialog-actions,
.entry-actions,
.vehicle-item-actions {
  flex-wrap: wrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 640px) {
  .field-row,
  .field-row.two-columns,
  .vehicle-form,
  .admin-user-form,
  .admin-user-row,
  .admin-work-order {
    grid-template-columns: 1fr;
  }

  .entry-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .entry-hours,
  .entry-actions {
    grid-column: 2;
    text-align: left;
  }

  .tool-admin-actions,
  .admin-farm-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-admin-actions .secondary-button,
  .tool-admin-actions .import-file-button,
  .admin-farm-actions .secondary-button,
  .admin-farm-actions .import-file-button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .summary-card,
  .panel,
  .history-section,
  .daily-note,
  .admin-panel {
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* V8.93: jednoznaczne daty DD.MM.RRRR niezależnie od ustawień przeglądarki. */
.pl-date-control {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
  align-items: stretch;
}

.pl-date-control .pl-date-native {
  position: absolute !important;
  inset: auto !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pl-date-control .pl-date-display {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.pl-date-picker {
  position: relative;
  width: 44px;
  min-width: 44px;
  min-height: 42px;
  padding: 0 !important;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
}

.pl-date-picker::before {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 16px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
  content: "";
}

.pl-date-picker::after {
  position: absolute;
  top: 16px;
  left: 13px;
  width: 20px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px -7px 0 -0.5px currentColor, 12px -7px 0 -0.5px currentColor;
  content: "";
}

.pl-date-picker:hover,
.pl-date-picker:focus-visible {
  border-color: var(--opsui-primary);
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
}

.pl-date-picker:disabled,
.pl-date-display:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

/* V8.93: blokady bezpieczeństwa polecenia pracy i podpisu konta. */
.signature-required-notice {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  border: 2px solid #dc2626;
  border-radius: var(--opsui-radius);
  color: #7f1d1d;
  background: #fef2f2;
  box-shadow: 0 10px 28px rgba(185, 28, 28, 0.16);
}

.signature-required-notice[hidden] {
  display: none !important;
}

.signature-required-notice strong {
  font-size: 0.86rem;
  letter-spacing: 0.025em;
}

.signature-required-notice span {
  font-size: 0.72rem;
  line-height: 1.45;
}

body.theme-dark .signature-required-notice {
  border-color: #f87171;
  color: #fee2e2;
  background: rgba(127, 29, 29, 0.48);
}

.work-order-incomplete-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  padding: 24px;
  overflow: auto;
  border: 2px solid #dc2626;
  border-radius: 20px;
  color: #450a0a;
  background: #fff7f7;
  box-shadow: 0 28px 80px rgba(69, 10, 10, 0.38);
}

.work-order-incomplete-dialog::backdrop {
  background: rgba(35, 5, 5, 0.72);
  backdrop-filter: blur(4px);
}

.work-order-incomplete-dialog .blocking-error-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #dc2626;
  font-size: 1.8rem;
  font-weight: 950;
}

.work-order-incomplete-dialog h3 {
  margin: 6px 0 10px;
  color: #991b1b;
  font-size: clamp(1.15rem, 3.2vw, 1.55rem);
  line-height: 1.18;
}

.work-order-incomplete-dialog > p:not(.eyebrow) {
  color: #7f1d1d;
  line-height: 1.5;
}

.work-order-incomplete-dialog ul {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  padding: 14px 14px 14px 34px;
  border-radius: 12px;
  background: rgba(254, 226, 226, 0.82);
}

.work-order-incomplete-dialog li {
  font-size: 0.78rem;
  line-height: 1.35;
}

.work-order-incomplete-dialog .danger-button {
  width: 100%;
  min-height: 46px;
}

body.theme-dark .work-order-incomplete-dialog {
  color: #fee2e2;
  background: #2b1015;
}

body.theme-dark .work-order-incomplete-dialog h3,
body.theme-dark .work-order-incomplete-dialog > p:not(.eyebrow) {
  color: #fecaca;
}

body.theme-dark .work-order-incomplete-dialog ul {
  background: rgba(127, 29, 29, 0.5);
}

/* V8.93: zwarty i czytelny pulpit administratora na komputerze. */
@media (min-width: 980px) {
  .app-shell.desktop-layout.admin-home-layout #adminOverviewPanel {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #dailyNote {
    grid-column: 2 / span 6 !important;
    grid-row: 3 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-column: 8 / -1 !important;
    grid-row: 3 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / -1 !important;
    grid-row: 4 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #bossDashboardPanel {
    grid-column: 2 / -1 !important;
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #deadlineAlerts {
    display: none !important;
  }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .app-shell.desktop-layout.admin-home-layout #dailyNote,
  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-column: 2 / -1 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #dailyNote {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #bossDashboardPanel {
    grid-row: 6 !important;
  }
}

/* V8.94: ostatnia warstwa kontrastu po wszystkich starszych regulach. */
body.theme-light #summaryPanel::after {
  display: none;
}

body.theme-light #summaryPanel .summary-glow {
  display: none;
}

body.theme-dark .history-calendar .calendar-day.saturday:disabled,
body.theme-dark .history-calendar .calendar-day.saturday {
  border-color: #eab308 !important;
  color: #fef08a !important;
  background: #3a3112 !important;
}

body.theme-dark .history-calendar .calendar-day:is(.sunday, .holiday):disabled,
body.theme-dark .history-calendar .calendar-day:is(.sunday, .holiday) {
  border-color: #ef4444 !important;
  color: #fecaca !important;
  background: #3a171b !important;
}

body.theme-dark .history-calendar .calendar-day.selected {
  color: var(--opsui-text);
  outline: 3px solid rgba(79, 155, 255, 0.46);
  outline-offset: 3px;
}

/* V8.97: czytelniejszy interfejs tabletowy. */
@media (min-width: 700px) and (max-width: 1199px) {
  html {
    font-size: 18px;
  }

  .app-shell:not(.desktop-layout) {
    width: 100%;
    max-width: none;
    padding-inline: 24px;
  }

  .app-shell:not(.desktop-layout) > .topbar {
    width: 100vw;
    min-height: 88px;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    padding-right: max(24px, env(safe-area-inset-right));
    padding-left: max(24px, env(safe-area-inset-left));
  }

  .app-shell .topbar-title h1 {
    font-size: 1.45rem;
  }

  .app-shell .topbar-title .user-button {
    font-size: 0.86rem;
  }

  .app-shell :is(input, select, textarea, button) {
    min-height: 52px;
    font-size: max(0.88rem, 16px) !important;
  }

  .app-shell :is(label, td, th, .vehicle-row span, .entry-card span, .side-menu-list button) {
    font-size: max(0.84rem, 15px) !important;
    line-height: 1.45;
  }

  .app-shell small {
    font-size: max(0.76rem, 14px) !important;
    line-height: 1.45;
  }

  .app-shell .hamburger-button,
  .app-shell .top-icon-button {
    width: 52px;
    height: 52px;
  }
}

@media (min-width: 980px) and (max-width: 1199px) {
  .app-shell.desktop-layout {
    --desktop-sidebar-width: 220px;
    grid-template-rows: 70px auto;
  }

  .app-shell.desktop-layout > .topbar {
    width: calc(100% + 18px);
    min-height: 70px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] {
    top: 70px;
    height: calc(100vh - 70px);
  }

  .app-shell.desktop-layout .topbar-title h1 {
    font-size: 1.25rem;
  }

  .app-shell.desktop-layout .topbar-title .user-button {
    font-size: 0.78rem;
  }

  .app-shell.desktop-layout .hamburger-button,
  .app-shell.desktop-layout .top-icon-button {
    width: 46px;
    height: 46px;
  }

  .app-shell.desktop-layout .top-logout-icon-button {
    min-height: 44px;
    font-size: 0.8rem;
  }
}

/* V8.95: osobisty pulpit miesieczny Technika. */
.technician-overview-panel {
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.technician-overview-panel[hidden] {
  display: none !important;
}

.technician-overview-heading,
.technician-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.technician-overview-heading h2,
.technician-section-heading h3 {
  margin: 3px 0 5px;
}

.technician-overview-heading > div > p:last-child,
.technician-section-heading > p {
  margin: 0;
  color: var(--opsui-muted, #7690ad);
  line-height: 1.45;
}

.technician-section-heading > p {
  max-width: 390px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.technician-overview-period {
  display: grid;
  min-width: min(100%, 190px);
  gap: 6px;
  color: var(--opsui-muted, #7690ad);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.technician-overview-period input {
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 850;
}

.technician-month-navigation {
  display: grid;
  grid-template-columns: 42px minmax(126px, 1fr) minmax(86px, 0.7fr) 42px;
  gap: 7px;
  align-items: center;
}

.technician-month-navigation button,
.technician-month-navigation select {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #c8d7e8;
  border-radius: 10px;
  color: #102238;
  background: #f8fbff;
  font-size: 0.84rem;
  font-weight: 850;
}

.technician-month-navigation button {
  padding: 0;
  color: #ffffff;
  background: #1677e8;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.technician-overview-selected-month {
  color: #1677e8;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
}

.technician-year-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.technician-year-summary > div {
  position: relative;
  padding: 17px 18px 16px 21px;
  overflow: hidden;
  border: 1px solid #b9d9f8;
  border-radius: 15px;
  background: linear-gradient(135deg, #edf7ff, #f8fbff);
}

.technician-year-summary > div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #1677e8;
  content: "";
}

.technician-year-summary > div:last-child::before { background: #f59e0b; }
.technician-year-summary span,
.technician-year-summary strong,
.technician-year-summary small { display: block; }
.technician-year-summary span {
  color: #526b86;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.technician-year-summary strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}
.technician-year-summary small {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.7rem;
}

.technician-priority-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid #ef4444;
  border-radius: 15px;
  color: #7f1d1d;
  background: #fff1f2;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.11);
  cursor: pointer;
}

.technician-priority-alert:hover,
.technician-priority-alert:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.16);
}

.technician-priority-alert:focus-visible {
  outline: 3px solid rgba(22, 119, 242, 0.34);
  outline-offset: 3px;
}

.technician-priority-alert[hidden] {
  display: none !important;
}

.technician-priority-alert strong,
.technician-priority-alert p {
  display: block;
  margin: 0;
}

.technician-priority-alert p {
  margin-top: 3px;
  color: #991b1b;
  font-size: 0.82rem;
  line-height: 1.4;
}

.technician-priority-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #dc2626;
  font-size: 1.15rem;
  font-weight: 950;
}

.technician-priority-alert.warning {
  border-color: #f59e0b;
  color: #78350f;
  background: #fffbeb;
}

.technician-priority-alert.warning .technician-priority-icon {
  color: #422006;
  background: #fbbf24;
}

.technician-priority-alert.warning p {
  color: #92400e;
}

.technician-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.technician-kpi-grid article {
  position: relative;
  min-height: 122px;
  padding: 16px 15px 14px 18px;
  overflow: hidden;
  border: 1px solid #d6e2ef;
  border-radius: 15px;
  background: #f7faff;
}

.technician-kpi-grid article::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 15px 0 0 15px;
  background: #2f80ed;
  content: "";
}

.technician-kpi-grid .tone-turbines::before { background: #06b6d4; }
.technician-kpi-grid .tone-farms::before { background: #22c55e; }
.technician-kpi-grid .tone-orders::before { background: #8b5cf6; }
.technician-kpi-grid .tone-days-off::before { background: #14b8a6; }
.technician-kpi-grid .tone-login::before { background: #64748b; }
.technician-kpi-grid .tone-app-time::before { background: #0ea5e9; }
.technician-kpi-grid .tone-attention::before { background: #f59e0b; }

.technician-kpi-grid span,
.technician-kpi-grid strong,
.technician-kpi-grid small {
  display: block;
}

.technician-kpi-grid span {
  color: #64748b;
  font-size: 0.71rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.technician-kpi-grid strong {
  margin-top: 8px;
  color: #0f172a;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.technician-kpi-grid small {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.35;
}

.technician-finance-section,
.technician-alert-card {
  padding: 17px;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: #f8fbff;
}

.technician-finance-grid,
.technician-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.technician-finance-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.technician-secret-card {
  min-height: 128px;
  padding: 17px;
  border: 1px solid #cbd9e8;
  border-radius: 15px;
  color: #0f172a;
  background: #fff;
  box-shadow: none;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.technician-secret-card.earnings {
  border-left: 4px solid #22c55e;
}

.technician-secret-card.expenses {
  border-left: 4px solid #f59e0b;
}

.technician-secret-card > span,
.technician-secret-card > small {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
}

.technician-secret-card strong {
  display: block;
  min-height: 38px;
  margin: 8px 0 4px;
  color: #0f172a;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0.05em;
}

.technician-secret-value {
  display: none;
  letter-spacing: -0.03em;
}

.technician-secret-card.is-revealed .technician-secret-mask {
  display: none;
}

.technician-secret-card.is-revealed .technician-secret-value {
  display: inline;
}

.technician-secret-card:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.32);
  outline-offset: 2px;
}

.technician-alert-card {
  min-width: 0;
}

.technician-alert-card.critical {
  border-color: #fecaca;
}

.technician-alert-card.warning {
  border-color: #fde68a;
}

.technician-alert-count {
  display: grid;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 0.82rem;
  font-weight: 950;
}

.technician-alert-card.warning .technician-alert-count {
  color: #422006;
  background: #fbbf24;
}

.technician-alert-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.technician-alert-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  background: #fff;
}

.technician-alert-date {
  min-width: 54px;
  padding: 7px 8px;
  border-radius: 10px;
  color: #0f5fb7;
  background: #eaf4ff;
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
}

.technician-alert-copy {
  min-width: 0;
}

.technician-alert-copy strong,
.technician-alert-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.technician-alert-copy strong {
  color: #172033;
  font-size: 0.8rem;
}

.technician-alert-copy small {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.69rem;
  line-height: 1.35;
}

.technician-alert-row .secondary-button {
  min-height: 36px;
  padding: 8px 11px;
  white-space: nowrap;
}

.technician-alert-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #cbd9e8;
  border-radius: 12px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

body.theme-dark .technician-overview-heading > div > p:last-child,
body.theme-dark .technician-section-heading > p,
body.theme-dark .technician-overview-period,
body.theme-dark .technician-kpi-grid span,
body.theme-dark .technician-kpi-grid small,
body.theme-dark .technician-secret-card > span,
body.theme-dark .technician-secret-card > small,
body.theme-dark .technician-alert-copy small {
  color: #9fb2ca;
}

body.theme-dark .technician-kpi-grid article,
body.theme-dark .technician-finance-section,
body.theme-dark .technician-alert-card {
  border-color: #344861;
  background: #142033;
}

body.theme-dark .technician-kpi-grid strong,
body.theme-dark .technician-secret-card strong,
body.theme-dark .technician-alert-copy strong {
  color: #f8fbff;
}

body.theme-dark .technician-month-navigation button,
body.theme-dark .technician-month-navigation select {
  border-color: #405672;
  color: #eef6ff;
  background: #19283c;
}

body.theme-dark .technician-month-navigation button { background: #176fcf; }

body.theme-dark .technician-year-summary > div {
  border-color: #365879;
  background: linear-gradient(135deg, #142a42, #142033);
}

body.theme-dark .technician-year-summary span,
body.theme-dark .technician-year-summary small { color: #9fb2ca; }
body.theme-dark .technician-year-summary strong { color: #f8fbff; }

body.theme-dark .technician-secret-card,
body.theme-dark .technician-alert-row {
  border-color: #3b506a;
  color: #f8fbff;
  background: #19283c;
}

body.theme-dark .technician-priority-alert {
  border-color: #ef4444;
  color: #fecaca;
  background: #34161b;
}

body.theme-dark .technician-priority-alert p {
  color: #fca5a5;
}

body.theme-dark .technician-priority-alert.warning {
  border-color: #f59e0b;
  color: #fde68a;
  background: #36270f;
}

body.theme-dark .technician-priority-alert.warning p {
  color: #fcd34d;
}

body.theme-dark .technician-alert-date {
  color: #bfdbfe;
  background: #17345a;
}

body.theme-dark .technician-alert-empty {
  border-color: #3b506a;
  color: #9fb2ca;
  background: rgba(25, 40, 60, 0.7);
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.technician-home-layout {
    grid-auto-flow: row;
    grid-auto-rows: auto;
  }

  .app-shell.desktop-layout.technician-home-layout > .topbar {
    grid-row: 1;
  }

  .app-shell.desktop-layout.technician-home-layout #deadlineAlerts {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.technician-home-layout #technicianOverviewPanel {
    grid-column: 2 / -1 !important;
    grid-row: 3 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.technician-home-layout #dailyNote {
    grid-column: 2 / span 5 !important;
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.technician-home-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.technician-home-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 7 / -1 !important;
    grid-row: 4 !important;
  }
}

@media (max-width: 860px) {
  .technician-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technician-alert-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .technician-overview-heading,
  .technician-section-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .technician-overview-period {
    width: 100%;
  }

  .technician-month-navigation {
    grid-template-columns: 40px minmax(112px, 1fr) minmax(80px, 0.7fr) 40px;
  }

  .technician-year-summary {
    grid-template-columns: 1fr;
  }

  .technician-section-heading > p {
    max-width: none;
    text-align: left;
  }

  .technician-finance-grid {
    grid-template-columns: 1fr;
  }

  .technician-alert-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .technician-alert-row .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .technician-kpi-grid {
    grid-template-columns: 1fr;
  }
}

body.theme-dark #historyCalendar.history-calendar button.calendar-day.saturday:disabled,
body.theme-dark #historyCalendar.history-calendar button.calendar-day.saturday {
  border-color: #eab308 !important;
  color: #fef08a !important;
  background: #3a3112 !important;
}

body.theme-dark #historyCalendar.history-calendar button.calendar-day:is(.sunday, .holiday):disabled,
body.theme-dark #historyCalendar.history-calendar button.calendar-day:is(.sunday, .holiday) {
  border-color: #ef4444 !important;
  color: #fecaca !important;
  background: #3a171b !important;
}

body.theme-dark #historyCalendar.history-calendar button.calendar-day.has-report-only {
  border-color: #3b82f6 !important;
}

body.theme-dark #historyCalendar.history-calendar button.calendar-day.has-linked-report {
  border-color: #22c55e !important;
}

body.theme-dark #historyCalendar.history-calendar button.calendar-day.has-unreported-order {
  border-color: #ef4444 !important;
}

/* V8.94: czytelny kalendarz, jasny motyw i pelna szerokosc strony glownej. */
.calendar-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

.calendar-status-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.calendar-marker,
.calendar-weekend-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #2563eb;
}

.calendar-marker.marker-linked {
  background: #16a34a;
}

.calendar-marker.marker-order {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
  animation: calendar-order-marker-pulse 1.25s ease-in-out infinite;
}

.calendar-marker.marker-own-vacation {
  background: #7c3aed;
}

.calendar-marker.marker-colleague-vacation {
  background: #f97316;
}

.calendar-weekend-swatch {
  border-radius: 3px;
}

.calendar-weekend-swatch.saturday {
  border: 1px solid #ca8a04;
  background: #fde047;
}

.calendar-weekend-swatch.sunday {
  border: 1px solid #dc2626;
  background: #fca5a5;
}

.history-calendar .calendar-day {
  position: relative;
  display: grid;
  width: min(54px, 100%);
  min-height: 54px;
  aspect-ratio: 1;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 3px;
  padding: 6px 4px 5px;
  border: 3px solid var(--opsui-border-strong);
  border-radius: 10px;
  color: var(--opsui-text);
  background: var(--opsui-surface);
  opacity: 1;
}

.history-calendar .calendar-day.saturday {
  color: #713f12;
  background: #fef9c3;
}

.history-calendar .calendar-day.sunday,
.history-calendar .calendar-day.holiday {
  color: #7f1d1d;
  background: #fee2e2;
}

.history-calendar .calendar-day.has-report-only {
  border-color: #2563eb;
}

.history-calendar .calendar-day.has-linked-report {
  border-color: #16a34a;
}

.history-calendar .calendar-day.has-unreported-order {
  border-color: #dc2626;
  animation: calendar-order-frame-pulse 1.25s ease-in-out infinite;
}

.history-calendar .calendar-day.selected {
  color: var(--opsui-text);
  background: var(--opsui-surface);
  outline: 3px solid color-mix(in srgb, var(--opsui-primary) 34%, transparent);
  outline-offset: 3px;
}

.history-calendar .calendar-day.selected.saturday {
  background: #fef9c3;
}

.history-calendar .calendar-day.selected:is(.sunday, .holiday) {
  background: #fee2e2;
}

.calendar-day-number {
  align-self: end;
  font-size: 0.95rem;
  line-height: 1;
}

.calendar-markers {
  display: flex;
  min-height: 9px;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.calendar-markers .calendar-marker {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
}

@keyframes calendar-order-frame-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.12);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.24);
  }
}

@keyframes calendar-order-marker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}

body.theme-dark .history-calendar .calendar-day.saturday {
  color: #fef08a;
  background: #3a3112;
}

body.theme-dark .history-calendar .calendar-day:is(.sunday, .holiday) {
  color: #fecaca;
  background: #3a171b;
}

body.theme-dark .history-calendar .calendar-day.selected {
  color: var(--opsui-text);
  background: var(--opsui-surface);
}

body.theme-dark .history-calendar .calendar-day.selected.saturday {
  background: #3a3112;
}

body.theme-dark .history-calendar .calendar-day.selected:is(.sunday, .holiday) {
  background: #3a171b;
}

body.theme-light {
  --ink: #101722;
  --muted: #526274;
  --surface: #ffffff;
  --background: #eef2f6;
  --line: #cbd7e5;
  --opsui-text: #101722;
  --opsui-muted: #526274;
  --opsui-surface: #ffffff;
  --opsui-surface-muted: #f6f9fd;
  --opsui-surface-raised: #edf3f9;
  --opsui-border: #d4deea;
  --opsui-border-strong: #b9c9da;
}

body.theme-light .summary-card,
body.theme-light #summaryPanel {
  color: #101722 !important;
  background: linear-gradient(135deg, #ffffff, #edf5ff) !important;
}

body.theme-light .summary-glow {
  background: rgba(20, 121, 247, 0.13);
}

body.theme-light .summary-card .summary-label,
body.theme-light .summary-card .summary-grid span,
body.theme-light .summary-card .top-technician-row span {
  color: #526274 !important;
}

body.theme-light .summary-card #monthTotal,
body.theme-light .summary-card .summary-grid b,
body.theme-light .summary-card .top-technician-row {
  color: #101722 !important;
}

body.theme-light .summary-card .summary-grid > div,
body.theme-light .summary-card .top-technicians-panel {
  border-color: #c9d8e8 !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body.theme-light .summary-card #monthPicker {
  border-color: #b9c9da !important;
  color: #101722 !important;
  background: #ffffff !important;
}

body.theme-light .summary-card #monthPicker::-webkit-calendar-picker-indicator {
  filter: none;
}

body.theme-light .app-shell :is(
  .panel,
  .history-section,
  .daily-note,
  .deadline-alerts,
  .boss-dashboard-panel,
  .admin-users,
  .admin-user-card-panel,
  .admin-user-create-panel,
  .vehicle-form,
  .tool-form,
  .work-hours-rates,
  .user-cert-actions,
  .expense-export-actions,
  .work-order-users,
  .work-order-guests,
  .work-order-selected-users,
  .work-order-guest,
  .vacation-team-block
) {
  color: #101722;
}

body.theme-light .app-shell :is(
  .panel,
  .history-section,
  .daily-note,
  .deadline-alerts,
  .boss-dashboard-panel,
  .admin-users
) :where(h1, h2, h3, h4, strong, b, th) {
  color: #101722;
}

body.theme-light .app-shell :is(
  .panel,
  .history-section,
  .daily-note,
  .deadline-alerts,
  .boss-dashboard-panel,
  .admin-users
) :where(p, small, label, td, .form-hint, .empty-state) {
  color: #526274;
}

body.theme-light .app-shell .eyebrow {
  color: var(--opsui-primary);
}

body.theme-light .app-shell :is(input, select, textarea) {
  border-color: #b9c9da;
  color: #101722;
  background: #ffffff;
}

body.theme-light .app-shell :is(input, textarea)::placeholder {
  color: #6b7b8f;
  opacity: 1;
}

body.theme-light .app-shell :is(
  .entry-card,
  .vehicle-item,
  .pending-report-card,
  .admin-work-order,
  .user-work-order,
  .work-order-active-group,
  .vacation-day-details,
  .vacation-user-days,
  .personal-note-item,
  .client-log-item
) {
  border-color: #cbd7e5;
  color: #101722;
  background: #f8fbff;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.home-route-layout:not(.home-dashboard-layout) > :is(
    #dailyNote,
    #deadlineAlerts,
    #summaryPanel,
    #activeWorkOrdersPanel,
    #bossDashboardPanel,
    #leaderAnalyticsPanel
  ).app-route-active {
    width: 100%;
    max-width: none;
    grid-column: 2 / -1 !important;
    grid-row: auto !important;
    margin: 0 !important;
  }
}

@media (max-width: 767px) {
  .calendar-status-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px;
  }

  .calendar-status-legend > span {
    font-size: 0.66rem;
  }

  .history-calendar .calendar-day {
    width: min(46px, 100%);
    min-height: 46px;
    padding: 5px 2px 4px;
  }

  .calendar-markers {
    gap: 2px;
  }

  .calendar-markers .calendar-marker {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-calendar .calendar-day.has-unreported-order,
  .calendar-marker.marker-order {
    animation: none;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(20, 121, 247, 0.07) 0, transparent 34%),
    repeating-linear-gradient(135deg, rgba(16, 23, 34, 0.018) 0 1px, transparent 1px 18px),
    var(--background);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: none;
  background-repeat: repeat;
  background-size: 420px 250px;
  background-position: 24px 30px;
  opacity: 0.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(46px, env(safe-area-inset-bottom));
}

.topbar,
.brand,
.section-title,
.summary-heading,
.field-row,
.dialog-actions {
  display: flex;
  align-items: center;
}

.topbar,
.section-title,
.summary-heading {
  justify-content: space-between;
}

.topbar {
  gap: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.layout-mode-button {
  position: relative;
  width: 46px;
  height: 42px;
  border: 1px solid rgba(0, 91, 187, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(16, 23, 34, 0.12);
}

.layout-mode-button.active {
  border-color: rgba(0, 91, 187, 0.45);
  background: #e8f3ff;
}

.version-info-button {
  color: #0f64d8;
  font-size: 1rem;
  font-weight: 950;
  font-family: inherit;
  line-height: 1;
}

.top-logout-icon-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(200, 62, 69, 0.92);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  font-size: 0.72rem;
  font-weight: 900;
}

.top-logout-icon-button:hover,
.top-logout-icon-button:focus-visible {
  background: #b92f38;
}

.theme-toggle-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #eaf3ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
}

.theme-toggle-button[aria-pressed="true"] {
  color: #101722;
  background: #ffffff;
}

.theme-toggle-button:hover,
.theme-toggle-button:focus-visible {
  color: #ffffff;
  background: rgba(20, 121, 247, 0.8);
}

.sound-toggle-button {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #eaf3ff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.sound-toggle-button[hidden] {
  display: none;
}

.sound-toggle-button:hover,
.sound-toggle-button:focus-visible {
  color: #ffffff;
  background: rgba(20, 121, 247, 0.8);
}

.sound-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 18px;
  transform: translate(-50%, -50%);
}

.sound-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 7px;
  height: 8px;
  border-radius: 3px 0 0 3px;
  background: currentColor;
  box-shadow: 6px -4px 0 -1px currentColor, 6px 4px 0 -1px currentColor;
}

.sound-icon::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 2px;
  width: 9px;
  height: 14px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
}

.sound-toggle-button.muted {
  color: #101722;
  background: #ffffff;
}

.sound-toggle-button.muted .sound-icon::after {
  right: 3px;
  top: 8px;
  width: 14px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-42deg);
}

.layout-icon::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 21px;
  height: 14px;
  border: 2px solid #0b5fc3;
  border-radius: 3px;
}

.layout-icon::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 26px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #0b5fc3;
  box-shadow: 14px -15px 0 -1px #0b5fc3, 14px -8px 0 -1px #0b5fc3;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  gap: 13px;
  min-width: 0;
}

.top-logout-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #d6323c;
  box-shadow: 0 8px 18px rgba(200, 62, 69, 0.25);
  font-size: 0.8rem;
  font-weight: 900;
}

.top-logout-button:hover,
.top-logout-button:focus-visible {
  background: #ad252e;
}

.caps-lock-warning {
  display: block;
  margin-top: 7px;
  color: #b4232c;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.035em;
}

@media (max-width: 520px) {
  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .logo-frame {
    width: 86px;
    height: 54px;
  }

  h1 {
    font-size: clamp(1.05rem, 5.3vw, 1.45rem);
  }

  .top-logout-button {
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0.7rem;
  }

  .top-logout-icon-button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.68rem;
  }
}

/* V8.88 — uporzadkowana nawigacja i panel kont w stylu SaaS */
.side-nav-group,
.side-admin-nav-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.side-nav-group + .side-nav-group {
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
}

.side-nav-group[hidden],
.side-admin-nav-group[hidden] {
  display: none;
}

.side-nav-group-label,
.side-admin-nav-group > p {
  margin: 0;
  padding: 3px 10px 4px;
  color: #718199;
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.side-nav-admin-group {
  margin-top: 10px !important;
  padding-top: 11px !important;
  border-top-color: rgba(59, 130, 246, 0.26) !important;
}

.side-admin-shortcuts {
  gap: 10px;
  margin: 4px 0 7px 12px;
  padding: 7px 0 7px 11px;
}

.side-admin-nav-group + .side-admin-nav-group {
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.11);
}

.side-admin-nav-group > p {
  padding-left: 8px;
  color: #7f92aa;
  font-size: 0.54rem;
}

.admin-user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.24);
}

.admin-user-create-panel {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-create-heading,
.admin-user-panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-create-heading strong,
.admin-user-panel-heading h4 {
  display: block;
  margin: 0;
  color: #f8fafc;
  font-size: 0.85rem;
}

.admin-user-create-heading small,
.admin-user-panel-heading p {
  display: block;
  margin: 3px 0 0;
  color: #8fa1b8;
  font-size: 0.68rem;
}

.admin-panel-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 10px;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  font-size: 1rem;
  font-weight: 950;
}

.admin-user-create-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.25fr) minmax(180px, 1fr);
  gap: 10px;
}

.admin-user-create-fields label {
  min-width: 0;
}

.admin-user-create-fields input {
  width: 100%;
}

.admin-user-create-access .role-checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boss-role-option {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 9px;
  color: #dbeafe !important;
  background: rgba(37, 99, 235, 0.12);
  font-size: 0.72rem;
  font-weight: 850;
}

.boss-role-option input {
  width: 17px !important;
  height: 17px;
}

.admin-user-create-submit {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 2px;
}

.admin-user-create-submit p {
  margin: 0 auto 0 0;
  color: #8496ad;
  font-size: 0.68rem;
}

.admin-user-create-submit .primary-button {
  min-width: 230px;
}

.admin-user-row {
  grid-template-columns: 1fr !important;
  gap: 12px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.26);
}

.admin-user-card-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.14), rgba(15, 23, 42, 0.05));
}

.admin-user-card-header .admin-user-name {
  min-width: 0;
}

.admin-user-login {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 5px 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: #a9b9cc !important;
  background: rgba(15, 23, 42, 0.28);
  font-size: 0.65rem !important;
  font-weight: 800;
}

.admin-user-card-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.35fr);
  gap: 12px;
  padding: 0 14px 14px;
}

.admin-user-card-panel,
.admin-user-danger-zone {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-card-panel h4 {
  margin: 0 0 10px;
  color: #e8eef7;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.admin-user-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.admin-user-facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, auto);
  gap: 10px;
  align-items: center;
}

.admin-user-facts dt {
  color: #8597ad;
  font-size: 0.66rem;
}

.admin-user-facts dd {
  margin: 0;
  color: #e6edf7;
  font-size: 0.68rem;
  font-weight: 850;
  text-align: right;
}

.admin-user-role-panel .role-checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.admin-user-role-panel .role-checkbox-grid label {
  min-height: 42px;
}

.admin-user-role-panel .role-checkbox-grid button {
  min-height: 38px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 8px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
  font-size: 0.68rem;
  font-weight: 850;
}

.admin-user-panel-note {
  margin: 12px 0 0;
  color: #8fa1b8;
  font-size: 0.7rem;
}

.admin-user-access-panel {
  grid-column: 1 / -1;
}

.admin-user-access-panel .admin-user-actions {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  margin-top: 12px;
}

.admin-user-danger-zone {
  grid-column: 1 / -1;
  padding: 0;
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(127, 29, 29, 0.08);
}

.admin-user-danger-zone summary {
  padding: 12px 14px;
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
}

.admin-user-danger-zone > p {
  margin: 0;
  padding: 0 14px 10px;
  color: #a99aa0;
  font-size: 0.66rem;
}

.admin-user-danger-actions {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  padding: 0 14px 14px;
}

body.theme-light .admin-user-form,
body.theme-light .admin-user-row {
  border-color: #d9e3ef;
  background: #f8fafc;
}

body.theme-light .admin-user-create-panel,
body.theme-light .admin-user-card-panel {
  border-color: #dde6f0;
  background: #ffffff;
}

body.theme-light .admin-user-create-heading strong,
body.theme-light .admin-user-panel-heading h4,
body.theme-light .admin-user-card-panel h4,
body.theme-light .admin-user-facts dd {
  color: #172033;
}

body.theme-light .admin-user-card-header {
  border-bottom-color: #dce6f1;
  background: linear-gradient(135deg, #edf5ff, #f8fbff);
}

body.theme-light .admin-user-login {
  border-color: #d5e0ec;
  color: #5b6b80 !important;
  background: #ffffff;
}

@media (max-width: 1100px) {
  .admin-user-form,
  .admin-user-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-create-submit,
  .admin-user-access-panel,
  .admin-user-danger-zone {
    grid-column: auto;
  }

  .admin-user-create-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .side-nav-group-label {
    padding-left: 12px;
  }

  .admin-user-form {
    padding: 10px;
  }

  .admin-user-create-access .role-checkbox-grid,
  .admin-user-role-panel .role-checkbox-grid,
  .admin-user-access-panel .admin-user-actions,
  .admin-user-danger-actions {
    grid-template-columns: 1fr;
  }

  .admin-user-create-submit,
  .admin-user-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-user-create-submit .primary-button {
    width: 100%;
    min-width: 0;
  }

  .admin-user-login {
    align-self: flex-start;
  }
}

@media (min-width: 1101px) {
  .admin-user-create-fields {
    grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1.2fr);
  }

  .admin-user-create-fields > label:nth-child(3) {
    grid-column: 1 / -1;
  }
}

body.theme-light .boss-role-option {
  border-color: #bfdbfe;
  color: #174d8d !important;
  background: #eff6ff;
}

body.theme-light .admin-user-role-panel .role-checkbox-grid button {
  border-color: #a9cbee;
  color: #0b5fc3;
  background: #eaf3ff;
}

body.theme-light .admin-user-role-panel .role-checkbox-grid button:hover,
body.theme-light .admin-user-role-panel .role-checkbox-grid button:focus-visible {
  color: #ffffff;
  background: #1479f7;
}

/* V8.88: finalna siatka UI KIT dla monitorow, laptopow, iPadow i telefonow. */
:root {
  --ui-page-gutter: clamp(10px, 1.25vw, 24px);
  --ui-panel-gap: clamp(10px, 1vw, 18px);
  --ui-touch-target: 42px;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.app-shell,
.app-shell > *,
.app-shell :where(section, article, form, fieldset, label, div, dl, table, thead, tbody, tr, td, th) {
  min-width: 0;
  max-width: 100%;
}

.app-shell :where(input, select, textarea, button) {
  max-width: 100%;
}

.app-shell :where(img, svg, canvas, video) {
  max-width: 100%;
  height: auto;
}

.app-shell :where(.table-wrap, .responsive-table, .admin-table-wrap, .analytics-table-wrap, .boss-history-table-wrap) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.admin-user-create-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-user-create-fields > label:nth-child(n) {
  grid-column: auto;
}

.admin-user-facts dd {
  overflow-wrap: anywhere;
}

@media (min-width: 980px) {
  :root {
    --desktop-sidebar-width: clamp(205px, 15vw, 245px);
  }

  .app-shell.desktop-layout,
  .app-shell.desktop-layout.home-dashboard-layout {
    width: 100%;
    max-width: none;
    padding-right: var(--ui-page-gutter);
  }

  .app-shell.desktop-layout > :not(.topbar):not(.side-menu) {
    min-width: 0;
    max-width: 100%;
  }

  .app-shell.desktop-layout .side-menu {
    width: var(--desktop-sidebar-width);
    max-width: var(--desktop-sidebar-width);
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  :root {
    --desktop-sidebar-width: clamp(215px, 14vw, 235px);
  }
}

@media (min-width: 1600px) and (max-width: 2199px) {
  :root {
    --desktop-sidebar-width: clamp(225px, 13vw, 270px);
    --ui-page-gutter: clamp(18px, 1.35vw, 30px);
  }

  .app-shell.desktop-layout {
    column-gap: 18px !important;
    row-gap: 18px !important;
  }
}

@media (min-width: 2200px) {
  :root {
    --desktop-sidebar-width: clamp(250px, 11vw, 300px);
    --ui-page-gutter: clamp(22px, 1.5vw, 42px);
  }

  .app-shell.desktop-layout {
    column-gap: 22px !important;
    row-gap: 22px !important;
  }

  .app-shell.desktop-layout :where(.panel, .summary-card, .admin-users, .daily-note) {
    border-radius: 16px;
  }
}

@media (min-width: 600px) and (max-width: 979px) {
  .app-shell {
    padding-inline: clamp(14px, 2.4vw, 26px);
  }

  .app-shell :where(.field-row, .admin-filter-row, .analytics-filter-grid, .company-settings-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-form,
  .admin-user-card-grid {
    grid-template-columns: 1fr;
  }

  .side-menu {
    width: min(360px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
  }
}

@media (max-width: 699px) {
  :root {
    --ui-touch-target: 46px;
  }

  .app-shell {
    padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
    padding-bottom: max(78px, calc(70px + env(safe-area-inset-bottom)));
  }

  .app-shell :where(.panel, .summary-card, .admin-users, .daily-note) {
    padding: clamp(12px, 4vw, 18px);
    border-radius: 14px;
  }

  .admin-user-create-fields,
  .admin-user-form,
  .admin-user-card-grid,
  .admin-user-facts > div {
    grid-template-columns: 1fr;
  }

  .admin-user-facts dd {
    text-align: left;
  }

  .side-menu {
    width: min(88vw, 340px);
    max-width: calc(100vw - 24px);
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .app-shell :where(button, input, select) {
    min-height: var(--ui-touch-target);
  }
}

@media (pointer: coarse) {
  .app-shell :where(button, [role="button"], input, select) {
    min-height: var(--ui-touch-target);
  }

  .app-shell :where(button, [role="button"]) {
    touch-action: manipulation;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell *,
  .app-shell *::before,
  .app-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.logo-frame {
  display: grid;
  width: 112px;
  height: 64px;
  overflow: hidden;
  place-items: center;
  border: 1px solid #dce2e8;
  border-radius: 17px;
  background: white;
  box-shadow: 0 9px 24px rgba(16, 23, 34, 0.1);
}

.logo-frame img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 5vw, 2.15rem);
  font-weight: 900;
  color: var(--gp-green);
  letter-spacing: 0.02em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  font-weight: 900;
  letter-spacing: 0.13em;
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid #cad4df;
  border-radius: 14px;
  color: var(--navy);
  background: white;
  box-shadow: 0 8px 20px rgba(16, 23, 34, 0.08);
  font-size: 1.4rem;
}

.user-button {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: #536174;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
}

.user-button b {
  display: block;
  text-align: left;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22b573;
  box-shadow: 0 0 0 3px rgba(34, 181, 115, 0.13);
}

.summary-card {
  position: relative;
  margin: 25px 0 18px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  color: white;
  background: linear-gradient(135deg, #111925, #202d3e);
  box-shadow: 0 20px 45px rgba(16, 23, 34, 0.22);
}

.summary-heading {
  cursor: pointer;
}

.top-technicians-panel {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.top-technician-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: #fff;
  font-weight: 850;
}

.top-technician-row + .top-technician-row {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.top-technician-row span {
  color: #c8d7ef;
  font-size: 0.8rem;
}

.daily-note {
  margin: 24px 0 18px;
  padding: 20px 22px;
  border: 1px solid #c9def7;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbff, #eaf4ff);
  box-shadow: 0 12px 28px rgba(16, 23, 34, 0.07);
}

.daily-note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-note-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.daily-note-text {
  margin: 14px 0 0;
  color: #20364f;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
}

.daily-note-form {
  margin-top: 15px;
}

.daily-note-form textarea {
  resize: vertical;
}

.daily-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-note-actions span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.daily-note-actions button {
  min-width: 145px;
}

.farm-info-box {
  padding: 16px;
  border: 1px solid #cfe0f4;
  border-radius: 18px;
  background: #f3f8ff;
}

.farm-info-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #cfe0f4;
  border-radius: 15px;
  color: #0057ad;
  background: #f3f8ff;
  font-size: 0.85rem;
  font-weight: 900;
  text-align: left;
}

.farm-info-toggle.active {
  background: #e8f3ff;
}

.farm-info-toggle b {
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: #d6323c;
  font-size: 0.65rem;
}

.farm-info-heading,
.admin-farm-heading,
.admin-farm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.farm-info-heading h3,
.admin-farm-heading h4 {
  margin: 0;
}

.new-info-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: #d6323c;
  font-size: 0.68rem;
  font-weight: 900;
}

.farm-info-text {
  margin: 10px 0 14px;
  color: #33445c;
  line-height: 1.45;
  white-space: pre-wrap;
}

.farm-info-box textarea,
.admin-farm-row textarea {
  min-height: 92px;
  resize: vertical;
}

.summary-card::after {
  position: absolute;
  right: -35px;
  bottom: -90px;
  width: 210px;
  height: 210px;
  border: 24px solid rgba(255, 255, 255, 0.025);
  border-radius: 50%;
  content: "";
}

.summary-glow {
  position: absolute;
  top: -65px;
  right: -45px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(20, 121, 247, 0.34);
  filter: blur(30px);
}

.summary-heading,
.summary-grid {
  position: relative;
  z-index: 1;
}

.summary-label {
  margin-bottom: 6px;
  color: #9cabc0;
  font-size: 0.78rem;
  font-weight: 600;
}

#monthTotal {
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.045em;
}

#monthPicker {
  max-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

#monthPicker::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 23px;
}

.summary-grid div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.summary-grid [data-summary-farms-jump] {
  cursor: pointer;
}

.summary-grid [data-summary-farms-jump]:focus-visible {
  outline: 3px solid rgba(20, 121, 247, 0.35);
  outline-offset: 2px;
}

.summary-grid span,
.summary-grid b {
  display: block;
}

.summary-grid span {
  margin-bottom: 4px;
  color: #9cabc0;
  font-size: 0.66rem;
  font-weight: 700;
}

.summary-grid b {
  font-size: 1.05rem;
}

.panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 23px;
  border: 1px solid #dfe5eb;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 14px 35px rgba(16, 23, 34, 0.08);
}

.section-title {
  margin-bottom: 21px;
}

.section-title,
.admin-users-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-collapse {
  min-width: 82px;
  border: 1px solid rgba(0, 91, 187, 0.16);
  border-radius: 999px;
  color: #0756a8;
  background: linear-gradient(135deg, #eef6ff, #ffffff);
  box-shadow: 0 8px 18px rgba(0, 91, 187, 0.12);
  white-space: nowrap;
}

.collapsible-section.collapsed form,
.collapsible-section.collapsed .expense-export-actions,
.admin-users.collapsed > :not(.admin-users-heading) {
  display: none !important;
}

.vehicle-panel.collapsed .vehicle-content {
  display: none !important;
}

.history-section.collapsed .history-content {
  display: none !important;
}

.vehicle-content {
  display: grid;
  gap: 18px;
}

.user-cert-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(0, 91, 187, 0.14);
  border-radius: 18px;
  background: #f4f9ff;
}

.vehicle-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  padding: 16px;
  border: 1px solid #e1e8f0;
  border-radius: 16px;
  background: #f8fbff;
}

.vehicle-form .full-width {
  grid-column: 1 / -1;
}

.remember-password {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: #526174;
  font-size: 0.78rem;
}

.remember-password input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

#toggleLoginPassword.password-preview-button {
  display: none;
}

.password-eye-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8a95a3;
  background: transparent;
  box-shadow: none;
  opacity: 0.62;
  transform: translateY(-50%);
  transition: color 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.password-eye-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-field:hover .password-eye-button,
.password-eye-button:focus-visible,
.password-eye-button[aria-pressed="true"] {
  color: #4f5d6d;
  background: rgba(15, 23, 42, 0.06);
  opacity: 1;
}

.include-current-user {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #cfe0f5;
  border-radius: 14px;
  background: #f4f9ff;
  color: #26364a;
  font-size: 0.78rem;
  font-weight: 900;
}

.include-current-user input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
}

.tool-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vehicle-form .primary-button {
  min-height: 47px;
}

.vehicle-list {
  display: grid;
  gap: 10px;
}

.vehicle-cost-export {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 91, 187, 0.14);
  border-radius: 16px;
  background: rgba(244, 249, 255, 0.86);
}

.vehicle-cost-export .section-title {
  padding: 0;
}

.vehicle-cost-form {
  margin: 0;
}

.vehicle-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-left: 7px solid var(--vehicle-color, #22c55e);
  border-radius: 14px;
  background: #fff;
}

.vehicle-item.warning {
  background: #fff7f7;
}

.inventory-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.inventory-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #d7e2ef;
  border-radius: 999px;
  color: #41536a;
  background: #f8fbff;
  font-size: 0.68rem;
  font-weight: 900;
}

.inventory-badge.ok {
  color: #166534;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.inventory-badge.warning {
  color: #92400e;
  background: #fff7ed;
  border-color: #fed7aa;
}

.inventory-badge.danger {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.inventory-badge.warehouse {
  color: #0756a8;
  background: #eef6ff;
  border-color: #bfdbfe;
}

.vehicle-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 7px;
}

.edit-inline-button {
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 91, 187, 0.18);
  border-radius: 999px;
  color: #0756a8;
  background: #eef6ff;
  box-shadow: 0 7px 16px rgba(0, 91, 187, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.edit-inline-button.danger {
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
  background: #fff1f2;
  box-shadow: 0 7px 16px rgba(220, 38, 38, 0.1);
}

.edit-inline-button.warning-action {
  border-color: rgba(217, 119, 6, 0.26);
  color: #92400e;
  background: #fff7ed;
  box-shadow: 0 7px 16px rgba(217, 119, 6, 0.1);
}

.vehicle-item strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.vehicle-item span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.inventory-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe6f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(30, 41, 59, 0.08);
}

.inventory-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.76rem;
}

.inventory-table th,
.inventory-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e5edf6;
  text-align: left;
  vertical-align: top;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #516176;
  background: #f3f8fd;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inventory-table tbody tr {
  --inventory-row-color: #22c55e;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.inventory-table tbody tr:hover,
.inventory-table tbody tr:focus {
  background: #eef6ff;
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(0, 91, 187, 0.12);
}

.inventory-table tbody tr.warning {
  background: #fff8f8;
}

.inventory-table tbody tr.warning:hover,
.inventory-table tbody tr.warning:focus {
  background: #fff1f2;
}

.inventory-table td {
  color: #53657c;
  font-weight: 800;
}

.inventory-table td:first-child {
  border-left: 6px solid var(--inventory-row-color);
}

.inventory-name {
  display: grid;
  gap: 3px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.inventory-name small {
  color: #7b8ba0;
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: none;
}

.inventory-notes {
  max-width: 220px;
  line-height: 1.35;
}

.inventory-actions {
  min-width: 210px;
}

.inventory-table .vehicle-item-actions {
  justify-content: flex-start;
  gap: 6px;
  margin-top: 0;
}

.inventory-table .edit-inline-button {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 9px;
  white-space: nowrap;
}

.sms-settings-table-wrap {
  margin-top: 12px;
  width: 100%;
  overflow-x: auto;
}

.sms-settings-table {
  min-width: 1180px;
}

.sms-settings-table .inventory-name small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.sms-settings-list {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.sms-users-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8e5f5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.sms-users-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sms-users-heading h3 {
  margin: 2px 0 4px;
}

.sms-users-heading .secondary-button {
  flex: 0 0 auto;
}

.sms-gateway-card {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid #d8e5f5;
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.sms-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.sms-gateway-grid label {
  min-width: 0;
}

.sms-gateway-grid input,
.sms-gateway-grid select,
.sms-broadcast-card textarea {
  width: 100%;
}

.sms-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.sms-counter-grid div {
  padding: 12px;
  border: 1px solid rgba(29, 122, 240, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.sms-counter-grid span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
}

.sms-counter-grid b {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 1.2rem;
}

.sms-broadcast-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid #cfe0f3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.sms-broadcast-card textarea {
  min-height: 92px;
  resize: vertical;
}

.sms-broadcast-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.sms-broadcast-targets select {
  width: 100%;
}

.sms-broadcast-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sms-phone-input {
  width: 100%;
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid #cbd8e8;
  border-radius: 10px;
  color: #0f172a;
  background: #ffffff;
  font-weight: 850;
}

.sms-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 850;
}

.sms-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #1d7af0;
}

.sms-toggle input:disabled + span {
  color: #94a3b8;
  opacity: 0.7;
}

.sms-gateway-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sms-gateway-response {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sms-log-heading {
  margin-top: 22px;
}

.sms-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sms-queue-actions .danger-action {
  border-color: #fecaca;
  color: #991b1b;
  background: #fee2e2;
}

body.theme-dark .sms-phone-input {
  border-color: #33445d;
  color: #f8fafc;
  background: #172235;
}

body.theme-dark .sms-users-card,
body.theme-dark .sms-gateway-card {
  border-color: #2e4159;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
}

body.theme-dark .sms-broadcast-card,
body.theme-dark .sms-counter-grid div {
  border-color: #2e4159;
  background: rgba(15, 23, 42, 0.88);
}

body.theme-dark .sms-counter-grid span {
  color: #a8b7ca;
}

body.theme-dark .sms-counter-grid b {
  color: #eef5ff;
}

body.theme-dark .sms-toggle {
  color: #e5edf7;
}

body.theme-dark .sms-queue-actions .danger-action {
  border-color: #7f1d1d;
  color: #fee2e2;
  background: #7f1d1d;
}

@media (max-width: 820px) {
  .sms-gateway-grid {
    grid-template-columns: 1fr;
  }

  .sms-users-heading {
    display: grid;
  }
}

.account-dialog-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.account-dialog-actions .secondary-button,
.account-dialog-actions .logout-button {
  width: 100%;
}

form {
  display: grid;
  gap: 15px;
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  color: #556171;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 12px 13px;
  border: 1px solid #d3dce5;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #f8fafc;
  font-size: 16px;
  text-overflow: ellipsis;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

input[type="date"] {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 4px rgba(20, 121, 247, 0.11);
}

.uppercase-input {
  text-transform: uppercase;
}

.field-row {
  gap: 10px;
}

.field-row label {
  flex: 1;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hours-counter {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
}

.hours-counter button {
  border: 1px solid #c6d8ec;
  border-radius: 11px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 1.35rem;
  font-weight: 900;
}

.hours-counter input {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
}

.work-time-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.work-time-range label {
  min-width: 0;
}

.work-time-range input,
.work-time-range select {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: clamp(0.92rem, 4vw, 1rem);
  font-weight: 900;
}

.travel-hours-field {
  border-left: 4px solid var(--blue);
  padding-left: 12px;
}

.include-current-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-weight: 850;
}

.include-current-user input {
  width: 18px;
  height: 18px;
}

@media (max-width: 820px) {
  .work-time-range {
    grid-template-columns: 1fr;
  }

  .collaborators-box {
    grid-template-columns: 1fr;
  }
}

.farm-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px auto;
  gap: 9px;
  align-items: end;
}

.favorite-button {
  height: 47px;
  border: 1px solid #d3dce5;
  border-radius: 11px;
  color: #8390a0;
  background: #f8fafc;
  font-size: 1.5rem;
  line-height: 1;
}

.favorite-button.active {
  color: #f0a500;
  border-color: #f1cc73;
  background: #fff8e2;
}

.favorite-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.add-database-toggle {
  width: fit-content;
  margin-top: -5px;
  padding: 3px 0;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 850;
}

.add-database-box {
  padding: 14px;
  border: 1px solid #cbdcf0;
  border-radius: 13px;
  background: #f2f7fd;
}

.inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 11px;
}

.work-type-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px auto;
  align-items: end;
  gap: 10px;
}

.work-type-field label {
  min-width: 0;
}

.danger-soft {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff1f2;
}

.danger-soft:hover {
  color: #9f1239;
  border-color: #fda4af;
  background: #ffe4e6;
}

.small-button {
  min-height: 40px;
  padding: 8px 14px;
}

.calculated-time {
  margin: 1px 0 0;
  padding: 13px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 8px 12px 12px 8px;
  color: #244262;
  background: var(--blue-soft);
  font-size: 0.84rem;
}

.calculated-time strong {
  color: var(--navy);
}

.error-message {
  display: none;
  margin: -5px 0 0;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
}

.error-message:not(:empty) {
  display: block;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 49px;
  border: 0;
  border-radius: 11px;
  font-weight: 900;
  transition: transform 0.15s, box-shadow 0.15s;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), #0866d8);
  box-shadow: 0 9px 20px rgba(20, 121, 247, 0.24);
}

.primary-button:active,
.export-button:active {
  transform: translateY(1px);
}

.history-section {
  margin-top: 31px;
  padding: 23px;
  border: 1px solid rgba(213, 222, 232, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 38px rgba(30, 41, 59, 0.09);
}

.deadline-alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.deadline-alert {
  padding: 13px 15px;
  border: 1px solid #ffd7a6;
  border-left: 5px solid #f59e0b;
  border-radius: 14px;
  background: #fff7ed;
  color: #8a3d00;
  font-size: 0.86rem;
  font-weight: 850;
}

.deadline-alerts-card {
  padding: 15px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(16, 23, 34, 0.07);
}

.deadline-alerts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.deadline-alerts-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.deadline-alerts-table {
  min-width: 760px;
}

.deadline-alerts-table .deadline-overdue td {
  background: #fff7f7;
}

.leader-vacation-alerts {
  border-left: 5px solid #22c55e;
}

.leader-vacation-alerts .deadline-alerts-heading {
  margin-bottom: 10px;
}

.leader-vacation-table {
  min-width: 560px;
}

.leader-vacation-table td:first-child {
  color: var(--text);
}

.leader-vacation-table tbody tr {
  background: rgba(34, 197, 94, 0.06);
}

.deadline-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.deadline-status.danger {
  color: #991b1b;
  background: #fee2e2;
}

.deadline-status.warning {
  color: #92400e;
  background: #ffedd5;
}

.pending-report-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.pending-report-list {
  display: grid;
  gap: 10px;
}

.pending-report-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-left: 6px solid #f59e0b;
  border-radius: 16px;
  color: #78350f;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.14);
}

.pending-report-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.pending-report-main span {
  color: #b45309;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.13em;
}

.pending-report-main b {
  color: #451a03;
  font-size: 0.98rem;
}

.pending-report-main small {
  color: #92400e;
  font-weight: 800;
}

.pending-report-dismiss {
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 10px 12px;
  color: #991b1b;
  background: #fee2e2;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.pending-report-dismiss:hover {
  background: #fecaca;
}

.collaborators-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.selected-collaborators {
  display: grid;
  gap: 8px;
}

.travel-km-assignments {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.travel-km-assignments > div {
  display: grid;
  gap: 2px;
}

.travel-km-assignments strong {
  color: var(--text);
  font-weight: 900;
}

.travel-km-assignments small {
  color: var(--muted);
}

.travel-cert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 96px;
  gap: 10px;
  align-items: center;
}

.travel-cert-row > span {
  min-width: 0;
  color: var(--muted);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.travel-cert-row.locked > span::after {
  content: "tylko podglad";
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  opacity: 0.72;
  text-transform: uppercase;
}

.travel-cert-row.locked input {
  background: #eef3f8;
  color: #6b7688;
  cursor: not-allowed;
}

.travel-cert-row label {
  display: grid;
  gap: 4px;
}

.travel-cert-row label small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.expense-title-field {
  position: relative;
}

.expense-type-field,
.expense-car-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.expense-category-box[hidden],
.expense-car-field[hidden],
.expense-mileage-field[hidden] {
  display: none !important;
}

.expense-diet-control {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 91, 187, 0.14);
  border-radius: 12px;
  background: rgba(247, 251, 255, 0.92);
}

.expense-diet-control[hidden],
.expense-diet-fields[hidden] {
  display: none !important;
}

.expense-diet-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
}

.expense-diet-fields small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--text);
}

.checkbox-card input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.expense-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.expense-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  background: #eef6ff;
  color: #315173;
  font-size: 0.75rem;
  font-weight: 900;
}

.expense-vehicle-favorite-active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: #fff7ed;
}

.expense-title-suggestions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #cfe0f2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.expense-title-suggestions[hidden] {
  display: none;
}

.expense-title-suggestions button {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #eef6ff;
  color: #132033;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.expense-title-suggestions button:hover,
.expense-title-suggestions button:focus-visible {
  color: #ffffff;
  background: #1479f7;
}

@media (max-width: 560px) {
  .expense-export-actions {
    grid-template-columns: 1fr;
  }

  .expense-type-field,
  .expense-car-field {
    grid-template-columns: 1fr;
  }

  .expense-type-field .small-button,
  .expense-car-field .favorite-button {
    width: 100%;
  }

  .travel-cert-row {
    grid-template-columns: minmax(0, 1fr) 84px 84px;
    gap: 8px;
  }
}

.expense-row.prepayment {
  border-color: rgba(22, 163, 74, 0.32);
  background: rgba(22, 163, 74, 0.08);
}

.expense-row.prepayment .expense-amount {
  color: #16a34a;
}

.expense-amount {
  color: #be123c;
}

.coordinator-groups {
  display: grid;
  gap: 14px;
}

.coordinator-leader-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--background);
}

.coordinator-leader-heading,
.coordinator-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.coordinator-leader-heading > div,
.coordinator-technician-option span {
  display: grid;
  gap: 3px;
}

.coordinator-leader-heading span,
.coordinator-technician-option small {
  color: var(--muted);
}

.coordinator-flow-info {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(35, 133, 255, 0.42);
  border-left: 4px solid #2385ff;
  border-radius: 10px;
  color: var(--text);
  background: rgba(35, 133, 255, 0.1);
}

.coordinator-technician-list {
  margin-top: 12px;
  overflow-x: auto;
}

.coordinator-technician-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.coordinator-technician-table th,
.coordinator-technician-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.84rem;
  text-align: left;
  vertical-align: middle;
}

.coordinator-technician-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(35, 133, 255, 0.08);
}

.coordinator-technician-table tbody tr:last-child td {
  border-bottom: 0;
}

.coordinator-technician-table tbody tr.is-selected {
  background: rgba(35, 133, 255, 0.14);
}

.coordinator-technician-table .coordinator-check-column {
  width: 92px;
  text-align: center;
}

.coordinator-technician-table input[type="checkbox"] {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #2385ff;
  vertical-align: middle;
}

.coordinator-technician-name {
  display: block;
  margin: 0;
  color: var(--text) !important;
  font-size: 0.86rem !important;
  font-weight: 900;
  line-height: 1.25;
  cursor: pointer;
}

.coordinator-technician-login {
  width: 28%;
  color: var(--muted) !important;
  font-weight: 700;
}

.coordinator-technician-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.coordinator-technician-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.coordinator-technician-option:has(input:checked) {
  border-color: #2385ff;
  background: rgba(35, 133, 255, 0.12);
}

.coordinator-technician-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.coordinator-technician-option span {
  min-width: 0;
}

.coordinator-technician-option strong,
.coordinator-technician-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinator-actions {
  margin-top: 14px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .coordinator-technician-table .coordinator-check-column {
    width: 70px;
  }

  .coordinator-technician-table th,
  .coordinator-technician-table td {
    padding: 10px 8px;
  }

  .coordinator-technician-login {
    width: 34%;
  }

  .coordinator-technician-grid {
    grid-template-columns: 1fr;
  }

  .coordinator-actions {
    align-items: stretch;
  }

  .coordinator-actions .primary-button {
    width: 100%;
  }
}

.expense-row-actions {
  flex-wrap: wrap;
}

.expense-row-actions .small-button {
  min-width: 92px;
}

.expense-export-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(0, 91, 187, 0.14);
  border-radius: 16px;
  background: #f4f9ff;
}

.work-hours-form {
  grid-template-columns: minmax(180px, 1fr);
  align-items: end;
}

.work-hours-rates {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  padding: 13px;
  border: 1px solid #d7e4f4;
  border-radius: 14px;
  background: #fff;
}

.work-hours-rates label {
  min-width: 0;
}

.work-hours-rates input[readonly] {
  color: #475569;
  background: #eef4fb;
}

.work-hours-form .primary-button {
  min-height: 52px;
}

.collaborator-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto 34px 34px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbdcf0;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.collaborator-chip select {
  min-height: 38px;
  min-width: 92px;
  padding: 6px 28px 6px 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.collaborator-chip button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.collaborator-chip .user-favorite-toggle,
.work-order-user-chip .user-favorite-toggle {
  color: #8a6a00;
  border: 1px solid #e3c458;
  background: #fff8d8;
  font-size: 1rem;
}

.collaborator-chip .user-favorite-toggle.active,
.work-order-user-chip .user-favorite-toggle.active {
  color: #9a6700;
  border-color: #e4ad1a;
  background: #ffefad;
}

.collaborator-chip .user-remove-action,
.work-order-user-chip .user-remove-action {
  color: #b4232b;
  border: 1px solid #f1aeb2;
  background: #fff1f2;
  font-size: 1rem;
}

.history-calendar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.history-title {
  align-items: flex-start;
}

.history-title-main {
  display: grid;
  gap: 10px;
}

.history-title .section-collapse {
  margin-left: auto;
}

.history-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.history-month-arrow,
.history-month-label {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.history-month-arrow {
  width: 44px;
  color: #0b5ecb;
  background: #e8f2ff;
  font-size: 1.35rem;
}

.history-month-label {
  min-width: 156px;
  padding: 0 16px;
  color: var(--text);
  background: white;
  text-transform: capitalize;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.history-month-picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.history-user-filter {
  display: flex;
  align-items: end;
  gap: 8px;
}

.history-user-filter label {
  display: grid;
  gap: 6px;
  min-width: min(100%, 260px);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.history-user-filter select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: #ffffff;
  font-weight: 900;
}

.admin-user-filter-label {
  min-width: min(100%, 360px);
}

.admin-user-filter-label select[multiple] {
  min-height: 132px;
  padding: 8px;
}

.admin-user-filter-label input[type="search"],
.admin-cert-range input {
  border-color: #3b4b5f;
  color: white;
  background: #202d3d;
}

.admin-filter-actions,
.admin-cert-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.admin-user-filter-label option {
  padding: 8px 10px;
  border-radius: 10px;
}

.admin-user-filter-label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.admin-user-filter-label .export-button {
  width: fit-content;
  margin-top: 10px;
}

.admin-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin: 8px 0;
}

.admin-picker-row label {
  min-width: 0;
}

#adminWorkHoursPanel .admin-picker-row {
  grid-template-columns: repeat(3, minmax(210px, 1fr));
}

#adminWorkHoursPanel .payroll-slip-button {
  border-color: #8dc9aa;
}

#adminWorkHoursPanel .primary-button.payroll-slip-button {
  background: #137a46;
}

@media (max-width: 980px) {
  #adminWorkHoursPanel .admin-picker-row {
    grid-template-columns: 1fr;
  }
}

.admin-selected-users {
  margin-top: 0;
}

.admin-selected-users .collaborator-chip {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.work-order-bulk-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.work-order-bulk-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.work-order-bulk-tools input {
  min-height: 44px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
}

.calendar-day,
.calendar-cell {
  min-height: clamp(34px, 9vw, 46px);
}

.calendar-day {
  width: min(46px, 100%);
  min-width: 0;
  aspect-ratio: 1;
  height: auto;
  justify-self: center;
  border: 3px solid #1d7cf2;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1220;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.calendar-day.filled {
  color: #0b1220;
  background: #ffffff;
  border-color: #1d7cf2;
}

.calendar-day.saturday {
  color: #0b1220;
  border-color: #f6c343;
}

.calendar-day.holiday {
  color: #0b1220;
  border-color: #e63946;
}

.calendar-day.filled.saturday {
  border-color: #f6c343;
  color: #0b1220;
}

.calendar-day.filled.holiday {
  border-color: #e63946;
  color: #0b1220;
}

.vacation-content {
  display: grid;
  gap: 14px;
}

.vacation-month-nav {
  width: fit-content;
  max-width: 100%;
}

.vacation-day.vacation-selected {
  color: #ffffff;
  border-color: #7c3aed;
  background: #7c3aed;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.26);
}

.vacation-day.vacation-focused {
  outline: 3px solid rgba(20, 121, 247, 0.38);
  outline-offset: 4px;
}

.vacation-day-details {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d5e1ee;
  border-radius: 14px;
  background: #f7fbff;
  color: #132033;
}

.vacation-day-details[hidden] {
  display: none;
}

.vacation-day-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #536276;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vacation-day-details-header strong {
  color: #132033;
}

.vacation-day-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vacation-day-people span {
  padding: 8px 12px;
  border: 1px solid #b9d3f0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f4f93;
  font-weight: 900;
}

.vacation-user-days {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid #c8d9eb;
  border-radius: 14px;
  background: #f7fbff;
}

.vacation-user-days[hidden] {
  display: none;
}

.vacation-user-days-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vacation-user-days-heading div {
  display: grid;
  gap: 3px;
}

.vacation-user-days-heading span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vacation-user-days-heading strong {
  color: #132033;
}

.vacation-user-days-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vacation-user-days-list button {
  padding: 8px 11px;
  border: 1px solid #a9c8e9;
  border-radius: 999px;
  color: #0f4f93;
  background: #ffffff;
  font-weight: 850;
}

.calendar-day.has-order {
  border-style: dashed;
}

.calendar-day.has-vacation {
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12), 0 10px 22px rgba(34, 197, 94, 0.14);
}

.calendar-day.complete {
  border-color: #16a34a;
  border-style: solid;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12), 0 10px 24px rgba(22, 163, 74, 0.18);
}

.calendar-day.selected {
  transform: translateY(-2px);
  box-shadow: 0 0 0 5px rgba(20, 121, 247, 0.16), 0 14px 28px rgba(15, 23, 42, 0.16);
}

.calendar-day:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.calendar-day:not(:disabled):hover {
  transform: translateY(-2px);
}

.history-calendar {
  touch-action: pan-y;
  user-select: none;
}

.month-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  border-radius: 28px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
}

.month-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
}

.month-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.month-dialog-head strong {
  font-size: 1.35rem;
  color: var(--text);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.month-choice {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: #f8fbff;
  font-weight: 900;
  text-transform: capitalize;
  cursor: pointer;
}

.month-choice.active {
  border-color: #1d7cf2;
  color: white;
  background: #1d7cf2;
  box-shadow: 0 12px 28px rgba(29, 124, 242, 0.22);
}

.selected-history-title {
  margin: 8px 0 10px;
  font-size: 1rem;
}

.admin-panel {
  margin-top: 31px;
  padding: 23px;
  border: 1px solid #26374c;
  border-radius: 22px;
  color: white;
  background: linear-gradient(145deg, #101722, #1c2939);
  box-shadow: 0 18px 42px rgba(16, 23, 34, 0.22);
}

.admin-panel [hidden] {
  display: none !important;
}

.admin-heading,
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.admin-heading {
  margin-bottom: 20px;
}

.admin-badge {
  padding: 6px 9px;
  border: 1px solid rgba(20, 121, 247, 0.5);
  border-radius: 6px;
  color: #72b1ff;
  background: rgba(20, 121, 247, 0.12);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.admin-toolbar label {
  flex: 1;
  color: #aab6c6;
}

.admin-toolbar select {
  border-color: #3b4b5f;
  color: white;
  background: #202d3d;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 18px 0;
}

.admin-summary div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
}

.admin-summary span,
.admin-summary b {
  display: block;
}

.admin-summary span {
  margin-bottom: 4px;
  color: #9cabc0;
  font-size: 0.66rem;
}

.boss-dashboard-panel {
  display: grid;
  gap: 16px;
}

.boss-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.boss-metrics div {
  padding: 14px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f7fbff;
}

.boss-metrics span,
.boss-metrics b {
  display: block;
}

.boss-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.boss-metrics b {
  margin-top: 4px;
  color: var(--navy);
  font-size: 1.35rem;
}

#bossExpensesTotal {
  color: #be123c;
}

#bossExpensesTotal.positive-balance {
  color: #16a34a;
}

#bossExpensesTotal.negative-balance {
  color: #be123c;
}

.boss-dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #eef5ff;
}

.boss-dashboard-tab {
  flex: 1 1 160px;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  color: #41536a;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.boss-dashboard-tab.active {
  color: #fff;
  background: #1677f2;
  box-shadow: 0 10px 20px rgba(22, 119, 242, 0.18);
}

.boss-dashboard-section {
  display: grid;
  gap: 12px;
}

.company-settings-form {
  display: grid;
  gap: 14px;
}

.company-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.company-settings-fields,
.company-logo-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbff;
}

.company-settings-fields textarea {
  min-height: 132px;
  resize: vertical;
}

.company-logo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 78px;
  padding: 10px;
  border: 1px dashed #b8c7d8;
  border-radius: 12px;
  background: #fff;
}

.company-logo-preview-wrap img {
  display: block;
  max-width: 170px;
  max-height: 56px;
  object-fit: contain;
}

.company-logo-upload input {
  margin-top: 8px;
}

.company-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .company-settings-grid {
    grid-template-columns: 1fr;
  }

  .company-settings-actions button {
    flex: 1 1 100%;
  }
}

.boss-vacation-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbff;
}

.boss-vacation-block h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.boss-expenses-section {
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbff;
}

.boss-expenses-section summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 900;
}

.boss-history-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 10px;
  align-items: end;
}

.boss-history-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.boss-history-table-wrap {
  overflow-x: auto;
}

.boss-history-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.boss-history-table th,
.boss-history-table td {
  padding: 10px 9px;
  border-bottom: 1px solid #dbe5f0;
  text-align: left;
}

.boss-history-table th {
  color: #41536a;
  background: #edf5ff;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.boss-expenses-table .cost-row td:last-child {
  color: #be123c;
  font-weight: 900;
}

.boss-expenses-table .prepayment-row td:last-child {
  color: #16a34a;
  font-weight: 900;
}

.admin-entries-list {
  display: grid;
  gap: 8px;
}

.admin-farm-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-add-farm-form {
  display: grid;
  grid-template-columns: minmax(240px, 520px) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .farm-field,
  .work-type-field,
  .admin-add-farm-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .farm-field label,
  .work-type-field label,
  .admin-add-farm-form label {
    grid-column: 1 / -1;
  }
}

.import-file-button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 8px 14px;
  border: 1px solid #c6d8ec;
  border-radius: 11px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-farms-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.admin-farm-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}

.admin-farm-row textarea {
  font-family: inherit;
}

.admin-farm-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-entry {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.065);
}

.admin-entry div:last-child {
  text-align: right;
}

.admin-entry strong,
.admin-entry b,
.admin-entry span {
  display: block;
}

.admin-entry span {
  margin-top: 3px;
  color: #9cabc0;
  font-size: 0.7rem;
}

.admin-panel .empty-state {
  border-color: #415166;
  background: rgba(255, 255, 255, 0.04);
}

.admin-users {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-users-heading {
  margin-bottom: 14px;
}

.admin-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-user-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.admin-user-form label {
  color: #aab6c6;
}

.admin-user-form input {
  border-color: #3b4b5f;
  color: white;
  background: #202d3d;
  text-transform: uppercase;
}

.admin-user-form input[type="password"] {
  text-transform: none;
}

.admin-user-form .primary-button {
  min-height: 46px;
  padding-inline: 18px;
}

.admin-users-list {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.admin-problem-reports-list {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.backup-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.backup-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.072);
}

.backup-card h4 {
  margin: 0;
  font-size: 1rem;
}

.admin-month-delete-card {
  grid-column: 1 / -1;
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(127, 29, 29, 0.14);
}

.admin-month-delete-card .eyebrow { color: #ef4444; }

.admin-month-delete-preview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 11px;
  background: rgba(127, 29, 29, 0.14);
}

.admin-month-delete-preview[hidden] { display: none; }
.admin-month-delete-preview h5,
.admin-month-delete-preview p { margin: 0; }

.admin-month-delete-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-month-delete-counts div {
  padding: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-month-delete-counts span,
.admin-month-delete-counts strong { display: block; }
.admin-month-delete-counts span { font-size: 0.68rem; }
.admin-month-delete-counts strong { margin-top: 4px; font-size: 1.1rem; }

@media (max-width: 760px) {
  .backup-panel-grid { grid-template-columns: 1fr; }
  .admin-month-delete-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.problem-report-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.072);
}

.problem-report-item small {
  color: #9cabc0;
  font-weight: 800;
}

.problem-report-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
}

.problem-report-item button {
  justify-self: end;
}

.statistics-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.statistics-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(114, 177, 255, 0.24);
  border-left: 5px solid #1479f7;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 121, 247, 0.16), rgba(9, 20, 34, 0.82));
  box-shadow: 0 14px 28px rgba(4, 12, 24, 0.18);
  color: inherit;
  font: inherit;
  text-align: left;
}

.statistics-card.is-clickable {
  cursor: pointer;
}

.statistics-card.is-clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 177, 255, 0.45);
  box-shadow: 0 18px 34px rgba(4, 12, 24, 0.28);
}

.statistics-card span,
.statistics-card small {
  color: #b9c7d9;
  font-size: 0.72rem;
  font-weight: 900;
}

.statistics-card span {
  display: flex;
  gap: 9px;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.statistics-card span i {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 1000;
}

.statistics-card b {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
}

.statistics-card.tone-good {
  border-left-color: #21c875;
  background: linear-gradient(135deg, rgba(33, 200, 117, 0.22), rgba(9, 20, 34, 0.84));
}

.statistics-card.tone-warning {
  border-left-color: #f4c430;
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.22), rgba(9, 20, 34, 0.84));
}

.statistics-card.tone-danger {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(9, 20, 34, 0.84));
}

.statistics-card.tone-info {
  border-left-color: #1479f7;
}

.statistics-card.tone-neutral {
  border-left-color: #8fa6bf;
}

.statistics-actions {
  margin: 8px 0 16px;
}

.analytics-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
  padding: 6px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.analytics-tab,
.analytics-range-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  color: #b9c7d9;
  font-weight: 900;
  cursor: pointer;
}

.analytics-tab.active,
.analytics-range-button.active {
  border-color: rgba(114, 177, 255, 0.42);
  background: #1479f7;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(20, 121, 247, 0.22);
}

.analytics-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.analytics-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-date-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.analytics-date-fields label {
  display: grid;
  gap: 5px;
  color: #b9c7d9;
  font-size: 0.76rem;
  font-weight: 900;
}

.analytics-date-fields input {
  min-height: 40px;
  border: 1px solid rgba(114, 177, 255, 0.24);
  border-radius: 10px;
  background: rgba(8, 20, 34, 0.75);
  color: #f8fbff;
  font-weight: 900;
}

.analytics-content {
  display: grid;
  gap: 14px;
}

.analytics-clients-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.analytics-client-form,
.analytics-client-analysis-controls {
  display: grid;
  gap: 14px;
}

.analytics-client-name,
.analytics-client-analysis-controls > label {
  display: grid;
  gap: 6px;
  color: #b9c7d9;
  font-size: 0.78rem;
  font-weight: 900;
}

.analytics-client-name input,
.analytics-client-rate input[type="number"],
.analytics-client-analysis-controls input[type="date"] {
  min-height: 42px;
  border: 1px solid rgba(114, 177, 255, 0.26);
  border-radius: 10px;
  background: rgba(8, 20, 34, 0.78);
  color: #f8fbff;
  font-weight: 850;
}

.analytics-client-rates {
  display: grid;
  gap: 8px;
}

.analytics-client-rate {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.75fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(114, 177, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.analytics-client-rate > span:first-child {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #f8fbff;
  font-weight: 900;
}

.analytics-client-rate input[type="checkbox"],
.analytics-client-technician-grid input {
  width: 19px;
  height: 19px;
  accent-color: #1479f7;
}

.analytics-client-rate-value {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
}

.analytics-client-rate-value small {
  color: #9fc4ff;
  font-weight: 850;
}

.analytics-client-list {
  display: grid;
  gap: 9px;
}

.analytics-client-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(114, 177, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.analytics-client-card.active {
  border-color: #1479f7;
  background: rgba(20, 121, 247, 0.14);
  box-shadow: inset 4px 0 0 #1479f7;
}

.analytics-client-card > button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.analytics-client-card > button small {
  overflow: hidden;
  color: #9fc4ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-client-card > div {
  display: flex;
  gap: 6px;
}

.analytics-client-analysis {
  margin-top: 0;
}

.analytics-client-analysis-controls {
  grid-template-columns: repeat(2, minmax(160px, 220px)) minmax(300px, 1fr);
  align-items: end;
}

.analytics-client-technicians {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(114, 177, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.analytics-client-technicians .analytics-section-heading {
  margin-bottom: 9px;
}

.analytics-client-technicians .analytics-section-heading span {
  display: flex;
  gap: 6px;
}

.analytics-client-technician-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 7px;
}

.analytics-client-technician-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px 8px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  font-weight: 850;
}

.analytics-client-technician-grid input {
  grid-row: 1 / 3;
}

.analytics-client-technician-grid small {
  overflow: hidden;
  color: #9cabc0;
  text-overflow: ellipsis;
}

.analytics-client-download {
  width: min(100%, 320px);
}

.analytics-client-result {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.analytics-client-result span {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid rgba(33, 200, 117, 0.25);
  border-radius: 11px;
  background: rgba(33, 200, 117, 0.1);
  color: #b9c7d9;
  font-size: 0.76rem;
  font-weight: 850;
}

.analytics-client-result b {
  color: #ffffff;
  font-size: 1rem;
}

.analytics-client-quick-range {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.analytics-client-quick-range > span {
  margin-right: 4px;
  color: #b9c7d9;
  font-size: 0.78rem;
  font-weight: 950;
}

.analytics-client-analysis-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 9px;
}

.analytics-client-analysis-actions button {
  min-width: 210px;
}

.client-profitability-dashboard {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.client-profitability-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(114, 177, 255, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 10%, rgba(20, 121, 247, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(12, 34, 58, 0.98), rgba(8, 20, 34, 0.92));
  box-shadow: 0 18px 36px rgba(3, 10, 20, 0.2);
}

.client-profitability-head h4 {
  margin: 2px 0 4px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.client-profitability-head > div:first-child > span {
  color: #9fc4ff;
  font-weight: 850;
}

.client-margin-gauge {
  display: grid;
  position: relative;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#21c875 var(--client-margin), rgba(255, 255, 255, 0.09) 0);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.client-margin-gauge::before {
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: #102036;
  content: "";
}

.client-margin-gauge b,
.client-margin-gauge small {
  position: relative;
  z-index: 1;
}

.client-margin-gauge b {
  align-self: end;
  color: #ffffff;
  font-size: 1.12rem;
}

.client-margin-gauge small {
  align-self: start;
  color: #9fc4ff;
  font-weight: 850;
}

.client-margin-gauge.tone-warning {
  background: conic-gradient(#f4c430 var(--client-margin), rgba(255, 255, 255, 0.09) 0);
}

.client-margin-gauge.tone-danger {
  background: conic-gradient(#ef4444 var(--client-margin), rgba(255, 255, 255, 0.09) 0);
}

.client-profitability-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.client-profitability-kpis article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-left: 4px solid #7d93ad;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.client-profitability-kpis span,
.client-profitability-kpis small {
  color: #9cabc0;
  font-size: 0.76rem;
  font-weight: 850;
}

.client-profitability-kpis b {
  color: #ffffff;
  font-size: clamp(1.05rem, 2vw, 1.38rem);
  overflow-wrap: anywhere;
}

.client-profitability-kpis .tone-revenue {
  border-left-color: #1479f7;
  background: linear-gradient(135deg, rgba(20, 121, 247, 0.15), rgba(255, 255, 255, 0.035));
}

.client-profitability-kpis .tone-earnings {
  border-left-color: #a78bfa;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.14), rgba(255, 255, 255, 0.035));
}

.client-profitability-kpis .tone-expenses {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.035));
}

.client-profitability-kpis .tone-profit {
  border-left-color: #21c875;
  background: linear-gradient(135deg, rgba(33, 200, 117, 0.14), rgba(255, 255, 255, 0.035));
}

.client-profitability-kpis .tone-loss {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(255, 255, 255, 0.035));
}

.client-extremes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-extremes article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
}

.client-extremes span {
  grid-column: 1 / -1;
  color: #9cabc0;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-extremes b {
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-extremes strong {
  color: #9fc4ff;
  font-size: 1.08rem;
}

.client-extreme-top {
  box-shadow: inset 4px 0 0 #21c875;
}

.client-extreme-low {
  box-shadow: inset 4px 0 0 #f4c430;
}

.client-profitability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-insight-card,
.client-ranking-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 14px;
  background: rgba(8, 20, 34, 0.54);
}

.client-insight-card.full {
  grid-column: 1 / -1;
}

.client-finance-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 16px;
  min-height: 260px;
  padding: 14px 8px 0;
  align-items: end;
}

.client-finance-column {
  display: grid;
  grid-template-rows: auto 180px auto;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.client-finance-column > b {
  color: #ffffff;
  font-size: 0.82rem;
}

.client-finance-column > span {
  color: #b9c7d9;
  font-size: 0.72rem;
  font-weight: 850;
}

.client-finance-track {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 0;
  border-radius: 10px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.client-finance-track i {
  display: block;
  width: 72%;
  min-height: 2px;
  border-radius: 8px 8px 0 0;
  background: #1479f7;
  box-shadow: 0 -8px 20px rgba(20, 121, 247, 0.25);
}

.client-finance-track .tone-earnings {
  background: #a78bfa;
  box-shadow: 0 -8px 20px rgba(167, 139, 250, 0.25);
}

.client-finance-track .tone-expenses {
  background: #f59e0b;
  box-shadow: 0 -8px 20px rgba(245, 158, 11, 0.25);
}

.client-finance-track .tone-profit {
  background: #21c875;
  box-shadow: 0 -8px 20px rgba(33, 200, 117, 0.25);
}

.client-finance-track .tone-loss {
  background: #ef4444;
  box-shadow: 0 -8px 20px rgba(239, 68, 68, 0.25);
}

.client-hours-bars {
  display: grid;
  gap: 10px;
}

.client-hours-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
}

.client-hours-row > span {
  overflow: hidden;
  color: #dbe8f7;
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-hours-row > span b {
  color: #65a7ff;
}

.client-hours-row > strong {
  min-width: 62px;
  color: #ffffff;
  text-align: right;
}

.client-hours-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.client-hours-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1479f7, #54b8ff);
}

.client-trend-wrap {
  overflow-x: auto;
}

.client-profit-trend {
  display: block;
  width: 100%;
  min-width: 640px;
  max-height: 290px;
}

.client-profit-trend line {
  stroke: rgba(159, 196, 255, 0.22);
  stroke-width: 1;
}

.client-profit-trend polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-revenue-line {
  stroke: #1479f7;
}

.client-earnings-line {
  stroke: #a78bfa;
}

.client-expenses-line {
  stroke: #f59e0b;
}

.client-revenue-dot {
  fill: #1479f7;
  stroke: #dbeafe;
  stroke-width: 2;
}

.legend-client-revenue {
  background: #1479f7 !important;
}

.legend-client-earnings {
  background: #a78bfa !important;
}

.legend-client-expenses {
  background: #f59e0b !important;
}

.client-ranking-table td strong,
.client-ranking-table td small {
  display: block;
}

.client-ranking-table td small {
  margin-top: 3px;
  color: #8fa6bf;
  font-size: 0.68rem;
}

.client-ranking-table .ranking-top {
  background: rgba(33, 200, 117, 0.09);
}

.client-ranking-table .ranking-low {
  background: rgba(244, 196, 48, 0.08);
}

.profit-positive {
  color: #58dd9a !important;
  font-weight: 950;
}

.profit-negative {
  color: #ff7d86 !important;
  font-weight: 950;
}

.client-analysis-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #1479f7;
  border-radius: 9px;
  background: rgba(20, 121, 247, 0.1);
  color: #b9c7d9;
  font-size: 0.76rem;
  font-weight: 800;
}

.analytics-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(114, 177, 255, 0.2);
  border-radius: 14px;
  background: rgba(13, 28, 46, 0.86);
}

.analytics-section[data-analytics-anchor] {
  scroll-margin-top: 90px;
}

.analytics-section-flash {
  animation: analyticsSectionFlash 1.4s ease;
}

@keyframes analyticsSectionFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
  }
  45% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.35);
  }
  100% {
    box-shadow: 0 14px 28px rgba(4, 12, 24, 0.18);
  }
}

.analytics-section.full {
  grid-column: 1 / -1;
}

.analytics-section h4 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 1rem;
}

.analytics-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.analytics-section-heading h4 {
  margin: 0;
}

.analytics-section-heading span {
  color: #9fc4ff;
  font-weight: 900;
}

.analytics-alert-list {
  display: grid;
  gap: 8px;
}

.analytics-alert {
  display: grid;
  grid-template-columns: auto minmax(130px, 0.45fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(114, 177, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.analytics-alert b {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.analytics-alert span {
  font-weight: 1000;
}

.analytics-alert small {
  color: #b9c7d9;
  font-weight: 800;
}

.analytics-alert.tone-warning {
  border-left: 5px solid #f4c430;
  background: rgba(244, 196, 48, 0.1);
}

.analytics-alert.tone-danger {
  border-left: 5px solid #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.analytics-alert.tone-good {
  border-left: 5px solid #21c875;
  background: rgba(33, 200, 117, 0.1);
}

.analytics-chart-wrap {
  overflow-x: auto;
  padding: 8px 0 2px;
}

.analytics-line-chart {
  width: 100%;
  min-width: 560px;
  height: auto;
}

.analytics-line-chart line {
  stroke: rgba(185, 199, 217, 0.35);
  stroke-width: 1.4;
}

.analytics-line-chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orders-line {
  stroke: #1479f7;
}

.signature-line {
  stroke: #f4c430;
}

.orders-dot {
  fill: #1479f7;
  stroke: #ffffff;
  stroke-width: 2;
}

.analytics-chart-legend {
  display: flex;
  gap: 16px;
  color: #b9c7d9;
  font-size: 0.78rem;
  font-weight: 900;
}

.analytics-chart-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.analytics-chart-legend i {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.legend-orders {
  background: #1479f7;
}

.legend-signature {
  background: #f4c430;
}

.analytics-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(114, 177, 255, 0.16);
  border-radius: 10px;
}

.analytics-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.analytics-table th {
  padding: 10px;
  background: rgba(114, 177, 255, 0.14);
  color: #dceaff;
  font-size: 0.72rem;
  text-align: left;
}

.analytics-table td {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  font-weight: 800;
}

.analytics-bars {
  display: grid;
  gap: 8px;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 3fr) minmax(50px, 0.3fr);
  gap: 10px;
  align-items: center;
  color: #f8fbff;
  font-weight: 900;
}

.analytics-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.analytics-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1479f7, #21c875);
}

.statistics-history-heading {
  margin-top: 18px;
}

.statistics-history-list {
  display: grid;
  gap: 8px;
}

.statistics-history-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) repeat(4, minmax(110px, 1fr)) minmax(150px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.statistics-history-row span,
.statistics-history-row small {
  color: #9cabc0;
  font-weight: 800;
}

.statistics-history-row b {
  color: #ffffff;
}

@media (max-width: 900px) {
  .statistics-card-grid {
    grid-template-columns: 1fr;
  }

  .statistics-history-row {
    grid-template-columns: 1fr;
  }

  .analytics-filter-bar {
    grid-template-columns: 1fr;
  }

  .analytics-range-buttons,
  .analytics-date-fields,
  .analytics-export-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-section-grid {
    grid-template-columns: 1fr;
  }

  .analytics-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .analytics-alert small {
    grid-column: 1 / -1;
  }

  .analytics-bar-row {
    grid-template-columns: 1fr;
  }

  .analytics-clients-layout,
  .analytics-client-analysis-controls {
    grid-template-columns: 1fr;
  }

  .analytics-client-technician-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-client-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-profitability-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-profitability-grid,
  .client-extremes {
    grid-template-columns: 1fr;
  }

  .client-insight-card.full {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .analytics-client-rate,
  .analytics-client-card {
    grid-template-columns: 1fr;
  }

  .analytics-client-card > div {
    justify-content: stretch;
  }

  .analytics-client-card > div button {
    flex: 1;
  }

  .analytics-client-technician-grid,
  .analytics-client-result {
    grid-template-columns: 1fr;
  }

  .analytics-client-quick-range {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-client-quick-range > span {
    grid-column: 1 / -1;
  }

  .analytics-client-analysis-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .analytics-client-analysis-actions button {
    width: 100%;
    min-width: 0;
  }

  .client-profitability-head {
    align-items: flex-start;
  }

  .client-margin-gauge {
    width: 86px;
    height: 86px;
  }

  .client-profitability-kpis {
    grid-template-columns: 1fr;
  }

  .client-finance-bars {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 8px;
  }

  .client-hours-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .client-hours-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.admin-user-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.072);
}

.admin-user-row > div:first-child {
  min-width: 0;
}

.admin-user-main {
  display: grid;
  gap: 8px;
}

.admin-user-row span {
  display: block;
  margin-top: 3px;
  color: #9cabc0;
  font-size: 0.72rem;
  overflow-wrap: normal;
  word-break: normal;
}

.admin-user-row span b {
  color: white;
}

.admin-user-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-user-name strong {
  font-size: 1rem;
}

.presence-badge {
  display: inline-block !important;
  margin-top: 0 !important;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.58rem !important;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.presence-badge.role {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.22);
}

.presence-badge.online {
  color: #74efb4;
  background: rgba(34, 181, 115, 0.16);
}

.presence-badge.offline {
  color: #aab6c6;
  background: rgba(255, 255, 255, 0.08);
}

.presence-badge.frozen {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.24);
}

.admin-user-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.admin-user-actions button {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #4a5d74;
  border-radius: 8px;
  color: white;
  background: #26364a;
  font-size: 0.7rem;
  font-weight: 800;
}

.admin-user-actions button[data-user-action="role"] {
  border-color: rgba(96, 165, 250, 0.54);
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
}

.role-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  width: 100%;
}

.role-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.28);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.role-checkbox-grid input {
  width: 16px;
  height: 16px;
  accent-color: #22c55e;
}

.boss-feature-grid {
  margin: 10px 0;
}

.admin-user-actions button[data-user-action="hours"],
.admin-user-actions button[data-user-action="password"],
.admin-user-actions button[data-user-action="login"] {
  background: rgba(255, 255, 255, 0.09);
}

.admin-user-actions .delete-user {
  border-color: #81404a;
  color: #ffb7bf;
  background: #42242b;
}

@media (min-width: 760px) {
  .admin-user-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.9fr);
  }
}

.admin-user-actions .danger-action,
.admin-farm-row-actions .danger-action {
  border-color: #b91c1c;
  color: #fecaca;
  background: #7f1d1d;
}

.work-order-panel {
  border-top: 0;
}

.signature-form {
  display: grid;
  gap: 12px;
}

.signature-canvas {
  width: 100%;
  min-height: 180px;
  border: 1px dashed #9db4cf;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(22, 119, 242, 0.08) 35px 36px);
  box-shadow: inset 0 1px 8px rgba(15, 23, 42, 0.08);
  touch-action: none;
}

.signature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.work-order-users,
.work-order-guests {
  margin: 0;
  padding: 14px;
  border: 1px solid #ccd8e7;
  border-radius: 14px;
}

.work-order-users legend,
.work-order-guests legend {
  padding: 0 6px;
  font-weight: 800;
  color: #34445a;
}

.single-action-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #8ebcf4;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(22, 119, 242, 0.12), rgba(46, 204, 113, 0.08));
  cursor: pointer;
}

.single-action-option input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--blue);
}

.single-action-option span {
  display: grid;
  gap: 3px;
}

.single-action-option b {
  color: var(--blue-dark);
  font-size: 0.92rem;
}

.single-action-option small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

body.theme-dark .single-action-option {
  border-color: #315f91;
  background: linear-gradient(135deg, rgba(22, 119, 242, 0.18), rgba(46, 204, 113, 0.1));
}

body.theme-dark .single-action-option b {
  color: #d8eaff;
}

.work-order-partner-box {
  margin-bottom: 12px;
}

.work-order-selected-users {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cfe0f5;
  border-radius: 16px;
  background: #eef6ff;
}

.work-order-selected-users p {
  margin: 0;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-order-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-order-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #9fc7f6;
  border-radius: 999px;
  color: var(--blue-dark);
  background: white;
  font-size: 0.76rem;
  font-weight: 900;
}

.work-order-user-chip button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

.admin-work-order > div:first-child {
  display: grid;
  gap: 4px;
}

.work-order-guests {
  display: grid;
  gap: 12px;
  background: #f8fbff;
}

.work-order-submit-hint + .form-hint {
  display: none;
}

#workOrderGuestsList {
  display: grid;
  gap: 12px;
}

.work-order-guest {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e6f5;
  border-radius: 14px;
  background: #fff;
}

.guest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest-add-button {
  justify-self: start;
}

.guest-signature-canvas {
  width: 100%;
  min-height: 140px;
  border: 1px dashed #9db4cf;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 253, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(22, 119, 242, 0.08) 31px 32px);
  box-shadow: inset 0 1px 8px rgba(15, 23, 42, 0.08);
  touch-action: none;
}

.work-order-user small,
.admin-work-order span,
.form-hint,
.empty-order-list {
  color: #66758a;
}

.form-hint,
.empty-order-list {
  margin: 0;
}

.admin-work-orders-list {
  display: grid;
  gap: 10px;
}

.admin-work-order {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d7e2ef;
  border-left: 4px solid #f0a000;
  border-radius: 12px;
  background: #fffaf0;
}

.user-work-order {
  display: block;
}

.user-work-order-summary,
.user-work-order-info {
  display: grid;
  gap: 8px;
}

.user-work-order .admin-user-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.user-work-order .work-order-active-details {
  width: 100%;
  margin-top: 14px;
}

.work-order-download-button,
.work-order-sign-button {
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  color: #111827;
  background: #e8eef5;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
  font-weight: 850;
  cursor: pointer;
}

.work-order-sign-button {
  color: #fff;
  background: #1677f2;
}

.work-order-close-button {
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.18);
  font-weight: 900;
  cursor: pointer;
}

.work-order-download-button:hover,
.work-order-sign-button:hover,
.work-order-close-button:hover {
  transform: translateY(-1px);
}

.signed-work-order {
  border-left-color: #16a34a;
  background: linear-gradient(135deg, #ecfdf5, #dcfce7);
}

.signed-work-order strong {
  color: #166534;
}

.coordinator-work-order {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.coordinator-work-order strong {
  color: #92400e;
}

.history-pdf-button {
  display: grid;
  gap: 4px;
  min-width: 128px;
  padding: 11px 14px;
}

.history-pdf-button span {
  justify-self: center;
  padding: 3px 7px;
  border-radius: 8px;
  color: white;
  background: #22344d;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.history-pdf-button b {
  color: #172337;
  font-size: 0.72rem;
}

.work-order-active-details {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(244, 249, 255, 0.86);
}

.work-order-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.work-order-role-grid input:disabled {
  color: #172337;
  background: #eef5ff;
  opacity: 1;
}

.work-order-active-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--navy);
}

.work-order-active-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.work-order-active-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 91, 187, 0.12);
  border-radius: 12px;
  background: #f7fbff;
}

.work-order-active-group > div:first-child {
  display: grid;
  gap: 2px;
}

.work-order-active-group strong {
  color: var(--navy);
  font-size: 0.86rem;
}

.work-order-role-hint {
  justify-self: start;
  border: 0;
  padding: 0;
  color: #617088;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.work-order-role-hint:hover,
.work-order-role-hint:focus-visible {
  color: #1677f2;
  text-decoration: underline;
}

.work-order-active-group-tasks {
  display: grid;
  gap: 7px;
}

.work-order-active-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(86px, 104px);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(0, 91, 187, 0.1);
  border-radius: 10px;
  background: #ffffff;
}

.work-order-active-task span {
  font-size: 0.82rem;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}

.work-order-active-task.readonly-task {
  background: #f3f7fb;
}

.work-order-active-task.readonly-task span,
.work-order-active-task.readonly-task .active-time-button {
  color: #526579;
}

.work-order-active-task select,
.work-order-break-row input,
.work-order-break-row select,
.work-order-active-extra input,
.work-order-active-extra select {
  min-height: 38px;
}

.active-time-control {
  display: block;
  min-width: 86px;
}

.active-time-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d7e2ef;
  border-radius: 12px;
  color: #66758a;
  background: #f8fafc;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.active-time-button.has-value {
  color: #101827;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0, 91, 187, 0.08);
}

.work-order-active-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.work-order-active-task select {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.work-order-breaks-field {
  display: grid;
  gap: 6px;
}

.work-order-breaks-field:not([open]) .work-order-break-row,
.work-order-breaks-field:not([open]) .work-order-break-extra {
  display: none;
}

.work-order-break-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.work-order-breaks-field > span,
.work-order-breaks-field > summary {
  color: #41536a;
  font-size: 0.78rem;
  font-weight: 900;
}

.work-order-breaks-field > summary {
  cursor: pointer;
  list-style: none;
}

.work-order-breaks-field > summary::-webkit-details-marker {
  display: none;
}

.work-order-breaks-field > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
}

.work-order-breaks-field[open] > summary::before {
  content: "▾";
}

.work-order-active-extra .full-width {
  grid-column: 1 / -1;
}

.active-save-state {
  align-self: center;
  color: #536276;
  font-size: 0.78rem;
  font-weight: 800;
}

.active-time-dialog[hidden] {
  display: none;
}

.active-time-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.active-time-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.active-time-sheet {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: grid;
  grid-template-rows: auto auto minmax(0, auto) auto;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.active-time-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.active-time-head strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.active-time-preview {
  color: #0f172a;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 950;
  letter-spacing: 0.05em;
  text-align: center;
}

.active-time-wheel {
  position: relative;
  overflow: hidden;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.active-time-dual-wheel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.active-time-wheel-labels,
.active-time-wheels-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
}

.active-time-wheel-labels {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.active-time-wheel-labels span:first-child {
  grid-column: 1;
}

.active-time-wheel-labels span:last-child {
  grid-column: 3;
}

.active-time-wheels-body {
  position: relative;
  overflow: hidden;
  align-items: stretch;
}

.active-time-wheels-body::before,
.active-time-wheels-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  height: 74px;
  pointer-events: none;
}

.active-time-wheels-body::before {
  top: 0;
  background: linear-gradient(180deg, #f8fbff 0%, rgba(248, 251, 255, 0) 100%);
}

.active-time-wheels-body::after {
  bottom: 0;
  background: linear-gradient(0deg, #eef5ff 0%, rgba(238, 245, 255, 0) 100%);
}

.active-time-options {
  --active-time-wheel-height: clamp(220px, 36vh, 320px);
  height: var(--active-time-wheel-height);
  max-height: none;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: calc((var(--active-time-wheel-height) - 54px) / 2) 8px;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
}

#activeTimeConfirm {
  position: relative;
  z-index: 5;
  min-height: 52px;
}

@supports (height: 1dvh) {
  .active-time-options {
    --active-time-wheel-height: clamp(220px, 36dvh, 320px);
  }
}

@media (max-height: 640px) {
  .active-time-sheet {
    gap: 8px;
    padding: 12px;
  }

  .active-time-preview {
    font-size: 1.65rem;
  }

  .active-time-options {
    --active-time-wheel-height: clamp(190px, 32vh, 230px);
  }

  #activeTimeConfirm {
    min-height: 48px;
  }
}

.active-time-separator {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  color: #0f172a;
  font-size: 2rem;
  font-weight: 950;
  pointer-events: none;
}

.active-time-options::-webkit-scrollbar {
  display: none;
}

.active-time-selection {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  z-index: 2;
  height: 54px;
  transform: translateY(-50%);
  pointer-events: none;
  border: 2px solid rgba(22, 119, 242, 0.72);
  border-radius: 14px;
  background: rgba(22, 119, 242, 0.1);
  box-shadow: 0 10px 26px rgba(22, 119, 242, 0.16);
}

.active-time-option {
  position: relative;
  z-index: 1;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #627287;
  background: transparent;
  font-size: 1.12rem;
  font-weight: 900;
  cursor: pointer;
  scroll-snap-align: center;
}

.active-time-option.selected {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 760px) {
  .boss-metrics {
    grid-template-columns: 1fr;
  }

  .boss-dashboard-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .boss-dashboard-tab {
    flex-basis: auto;
    min-width: 0;
  }

  .boss-history-filters,
  .boss-history-picker {
    grid-template-columns: 1fr;
  }

  .boss-history-table-wrap {
    overflow: visible;
  }

  .boss-history-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  .boss-history-table thead {
    display: none;
  }

  .boss-history-table,
  .boss-history-table tbody,
  .boss-history-table tr,
  .boss-history-table td {
    display: block;
    width: 100%;
  }

  .boss-history-table tr {
    padding: 10px;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    background: #fff;
  }

  .boss-history-table td {
    padding: 4px 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .boss-history-table td:nth-child(1) {
    color: var(--navy);
    font-weight: 900;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table tr {
    border-color: #34465f;
    color: #eef5ff;
    background: #101a28;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table td {
    color: #d6e3f4;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table td:nth-child(1) {
    color: #ffffff;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table-wrap {
    border-color: #34465f;
    background: #0f1825;
  }

  body.theme-dark .app-shell.home-dashboard-layout .boss-dashboard-panel .boss-history-table tr,
  body.theme-dark .app-shell.home-dashboard-layout .boss-vacation-block .boss-history-table tr {
    color: #eef5ff !important;
    border-color: #34465f !important;
    background: #101a28 !important;
  }

  body.theme-dark .app-shell.home-dashboard-layout .boss-dashboard-panel .boss-history-table td,
  body.theme-dark .app-shell.home-dashboard-layout .boss-vacation-block .boss-history-table td {
    color: #dbe8f7 !important;
  }

  body.theme-dark .app-shell.home-dashboard-layout .boss-dashboard-panel .boss-history-table td:first-child,
  body.theme-dark .app-shell.home-dashboard-layout .boss-vacation-block .boss-history-table td:first-child {
    color: #ffffff !important;
  }

  .inventory-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .inventory-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .inventory-table thead {
    display: none;
  }

  .inventory-table,
  .inventory-table tbody,
  .inventory-table tr,
  .inventory-table td {
    display: block;
    width: 100%;
  }

  .inventory-table tbody {
    display: grid;
    gap: 10px;
  }

  .inventory-table tr {
    padding: 12px;
    border: 1px solid #dbe5f0;
    border-left: 6px solid var(--inventory-row-color);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 20px rgba(30, 41, 59, 0.08);
  }

  .inventory-table tr.warning {
    background: #fff8f8;
  }

  .inventory-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .inventory-table td:first-child {
    border-left: 0;
  }

  .inventory-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  .inventory-table .inventory-name small {
    display: none;
  }

  .inventory-table .inventory-actions {
    min-width: 0;
  }

  .inventory-table .vehicle-item-actions {
    flex-wrap: wrap;
  }

  .work-order-active-details {
    padding: 10px;
  }

  .work-order-active-task {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .work-order-active-task .active-time-control {
    grid-column: 2;
  }

  .work-order-break-extra {
    grid-template-columns: 1fr;
  }

  .user-work-order .admin-user-actions > * {
    flex: 1 1 180px;
  }
}

.boss-work-order-info {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(22, 101, 52, 0.18);
  border-radius: 12px;
  background: #f0fdf4;
  color: #14532d;
}

.boss-work-order-info b {
  font-size: 0.86rem;
}

.boss-work-order-info span,
.boss-work-order-info small {
  color: #166534;
}

.boss-sign-direct {
  min-width: 190px;
}

.boss-sign-direct b,
.boss-sign-direct span {
  display: block;
}

.work-order-break-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.work-order-sign-as {
  display: grid;
  gap: 7px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef5ff;
  border: 1px solid #cbd8e8;
  color: #536276;
  font-size: 0.76rem;
  font-weight: 800;
}

.sign-as-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.work-order-sign-as select {
  min-height: 44px;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  background: #f7f9fc;
  color: #111827;
  font-weight: 800;
}

.work-order-sign-favorite {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.empty-state.compact {
  padding: 24px 15px;
}

.export-button,
.text-button {
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-weight: 850;
}

.export-button {
  padding: 10px 14px;
  border: 1px solid #b8d5f6;
  border-radius: 10px;
  background: var(--blue-soft);
}

.empty-state {
  padding: 42px 20px;
  border: 1px dashed #b9c5d1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 6px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(20, 121, 247, 0.22);
  font-weight: 900;
}

.entries-list {
  display: grid;
  gap: 10px;
}

.entry-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid #dde4eb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 22px rgba(16, 23, 34, 0.055);
}

.date-tile {
  display: grid;
  width: 51px;
  height: 55px;
  place-content: center;
  border-radius: 12px;
  text-align: center;
  color: white;
  background: linear-gradient(150deg, var(--navy-2), #2d3d52);
}

.date-tile b {
  font-size: 1.2rem;
  line-height: 1;
}

.date-tile span {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 0.57rem;
  font-weight: 900;
  text-transform: uppercase;
}

.entry-main strong,
.entry-main span {
  display: block;
}

.entry-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.type-badge {
  width: fit-content;
  margin-top: 0 !important;
  padding: 3px 7px;
  border-radius: 5px;
  color: #075cc4 !important;
  background: var(--blue-soft);
  font-size: 0.61rem !important;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.shared-badge {
  color: #0f5132 !important;
  background: #d1e7dd;
}

.entry-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.entry-hours {
  text-align: right;
}

.entry-hours b {
  display: block;
  white-space: nowrap;
}

.vacation-entry-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.vacation-date-tile {
  background: linear-gradient(150deg, #0f9f57, #16a34a);
}

.vacation-badge {
  color: #166534 !important;
  background: #dcfce7;
}

.personal-notes-list {
  display: grid;
  gap: 12px;
}

.personal-note-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #ffffff;
}

.personal-note-item.note-due {
  border-color: #f59e0b;
  background: #fffbeb;
}

.personal-note-item strong,
.personal-note-item span {
  display: block;
}

.personal-note-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.personal-note-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
}

.entry-actions button {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #cbdcf0;
  border-radius: 10px;
  color: #0f5fb8;
  background: #eef6ff;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.entry-actions .entry-delete-action {
  color: #9f1239;
  border-color: #fecdd3;
  background: #fff1f2;
}

dialog {
  width: min(calc(100% - 36px), 380px);
  padding: 24px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(10, 19, 30, 0.35);
}

.login-dialog {
  width: min(calc(100% - 32px), 420px);
  padding: 34px 30px 26px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  text-align: center;
}

.login-dialog::backdrop {
  background-color: var(--login-gray);
  background-image:
    radial-gradient(circle at 50% 42%, rgba(16, 23, 34, 0.18), transparent 360px);
  background-repeat: no-repeat;
  background-size: auto;
  background-position: center;
}

.login-dialog form {
  margin-top: 28px;
  text-align: left;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 20px 0 4px;
  padding: 4px;
  border-radius: 11px;
  background: #edf1f5;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: #647184;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 850;
}

.auth-tab.active {
  color: var(--navy);
  background: white;
  box-shadow: 0 3px 10px rgba(16, 23, 34, 0.09);
}

.uppercase-input {
  text-transform: uppercase;
}

.auth-error {
  margin: 0;
}

.logout-button {
  margin-top: 20px;
  padding: 8px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-weight: 800;
}

.login-version {
  display: block;
  margin-top: 14px;
  color: #7a8490;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.update-info-dialog {
  width: min(calc(100% - 32px), 430px);
}

.update-info-dialog .update-version {
  margin: 8px 0 16px;
  color: var(--blue-dark);
  font-weight: 900;
}

.update-info-dialog ul {
  margin: 0 0 22px;
  padding-left: 21px;
  color: #465568;
  line-height: 1.55;
}

.update-info-dialog li + li {
  margin-top: 8px;
}

.update-info-dialog .primary-button {
  width: 100%;
}

.forgot-button {
  margin-top: 13px;
  padding: 5px;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-size: 0.77rem;
  font-weight: 800;
}

.login-dialog .eyebrow {
  margin-top: 18px;
}

.login-product-name {
  margin: 8px 0 0;
  color: var(--gp-green);
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.login-logo {
  width: min(100%, 300px);
  height: auto;
  margin: -4px auto 0;
}

.login-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 128px;
  object-fit: contain;
}

.login-dialog .primary-button {
  background: linear-gradient(135deg, var(--gp-green), var(--gp-green-dark));
  box-shadow: 0 14px 28px rgba(90, 143, 45, 0.24);
}

dialog::backdrop {
  background: rgba(10, 18, 28, 0.64);
  backdrop-filter: blur(3px);
}

dialog p {
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-width: 100px;
}

.secondary-button {
  color: var(--ink);
  background: #e8edf2;
}

.danger-button {
  color: white;
  background: var(--danger);
}

.app-shell.route-mode-active {
  padding-bottom: max(118px, calc(98px + env(safe-area-inset-bottom)));
}

.app-shell.route-mode-active > section.app-route-hidden {
  display: none !important;
}

.app-shell.route-mode-active .section-collapse {
  display: none !important;
}

.app-shell.route-mode-active .collapsible-section.collapsed form,
.app-shell.route-mode-active .admin-users.collapsed > :not(.admin-users-heading),
.app-shell.route-mode-active .vehicle-panel.collapsed .vehicle-content,
.app-shell.route-mode-active .history-section.collapsed .history-content {
  display: grid !important;
}

.app-shell.route-mode-active .history-section.collapsed .history-content,
.app-shell.route-mode-active .admin-users.collapsed > :not(.admin-users-heading) {
  display: block !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 74px;
  margin: calc(-1 * max(22px, env(safe-area-inset-top))) -18px 20px;
  padding: max(18px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  background: rgba(16, 23, 34, 0.98);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(16, 23, 34, 0.22);
}

.hamburger-button,
.top-icon-button,
.close-menu-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(135, 152, 176, 0.28);
  color: #f7fbff;
  background: rgba(22, 34, 50, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.hamburger-button {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  color: rgba(247, 251, 255, 0.92);
  background: rgba(22, 34, 50, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.hamburger-button span {
  display: block;
  width: 19px;
  height: 1.7px;
  border-radius: 999px;
  background: currentColor;
}

.hamburger-button:hover,
.hamburger-button:focus-visible {
  background: rgba(34, 48, 68, 0.82);
}

.topbar-title {
  display: grid;
  justify-items: center;
  min-width: 0;
  flex: 1 1 auto;
  gap: 3px;
}

.topbar-title h1 {
  margin: 0;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(1.08rem, 3.8vw, 1.34rem);
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.topbar-title .user-button {
  min-height: 0;
  padding: 0;
  border: 0;
  color: rgba(235, 242, 250, 0.74);
  background: transparent;
  box-shadow: none;
  font-size: 0.72rem;
}

.top-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #8eb9ff;
  font-weight: 950;
}

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 11;
  background: rgba(8, 14, 22, 0.58);
  backdrop-filter: blur(2px);
}

.side-menu {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 12;
  display: flex;
  width: min(84vw, 360px);
  max-width: 100%;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 14px;
  color: #101722;
  background: #e7eff8;
  box-shadow: 22px 0 44px rgba(6, 12, 20, 0.34);
  transform: translateX(-105%);
  transition: transform 0.18s ease;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-head,
.side-brand,
.side-menu-footer {
  display: flex;
  align-items: center;
}

.side-menu-head {
  justify-content: space-between;
  gap: 10px;
}

.side-brand {
  min-width: 0;
  gap: 10px;
}

.side-logo-frame {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 23, 34, 0.12);
}

.side-logo-frame img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.side-brand strong,
.side-brand span {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-brand strong {
  font-size: 0.96rem;
  font-weight: 950;
}

.side-brand span {
  color: #637287;
  font-size: 0.76rem;
  font-weight: 800;
}

.close-menu-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #152033;
  background: rgba(255, 255, 255, 0.86);
  font-size: 1.35rem;
  line-height: 1;
}

.side-menu-list {
  display: grid;
  gap: 4px;
  min-height: 0;
  padding: 8px 0;
  overflow: auto;
}

.side-menu-list button,
.side-utility-button,
.side-logout-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: #243248;
  background: transparent;
  text-align: left;
  font-weight: 820;
}

.side-menu-list button.active {
  color: #0b5fc3;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(16, 23, 34, 0.08);
}

.side-menu-list button.nav-warning {
  color: #d6323c;
}

.side-menu-list button.nav-warning.active {
  color: #d6323c;
  background: #fff2f3;
}

.side-menu-list button:disabled {
  color: #8b98aa;
  background: rgba(255, 255, 255, 0.32);
  cursor: not-allowed;
}

.side-admin-shortcuts {
  display: grid;
  gap: 5px;
  margin: -1px 0 5px 18px;
  padding: 8px 0 8px 12px;
  border-left: 2px solid rgba(11, 95, 195, 0.18);
}

.side-admin-shortcuts[hidden] {
  display: none;
}

.side-admin-shortcuts button {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #40506a;
  background: rgba(255, 255, 255, 0.46);
  font-size: 0.86rem;
  font-weight: 850;
}

.side-admin-shortcuts button:hover,
.side-admin-shortcuts button:focus-visible,
.side-admin-shortcuts button.active {
  color: #0b5fc3;
  background: rgba(255, 255, 255, 0.9);
}

.side-menu-footer {
  margin-top: auto;
  gap: 8px;
  flex-direction: column;
}

.side-utility-button.layout-mode-button {
  display: flex;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 91, 187, 0.12);
  color: #26384e;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.side-utility-button .layout-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 24px;
  flex: 0 0 28px;
}

.side-info-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 91, 187, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.side-info-dot {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  color: #0b5fc3;
  background: #e8f3ff;
  font-size: 0.82rem;
  font-weight: 950;
}

.side-logout-button {
  color: #ffffff;
  background: #101722;
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100% - 20px, 720px);
  min-height: 78px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(8, 9, 11, 0.94);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(14px);
}

.bottom-nav-item {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 7px 4px;
  border: 0;
  border-radius: 22px;
  color: #f3f5f7;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.1;
}

.bottom-nav-item svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-item.active {
  color: #3f84ff;
  background: rgba(255, 255, 255, 0.18);
}

.bottom-nav-item[data-app-route="timeClock"].is-working {
  color: #ffffff;
  background: rgba(22, 163, 74, 0.96);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.34);
}

.bottom-nav-item[data-app-route="timeClock"].is-working svg {
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.34));
}

.bottom-nav-item.work-order-state-pending {
  color: #ffffff;
  background: rgba(200, 62, 69, 0.96);
  box-shadow: 0 10px 22px rgba(200, 62, 69, 0.32);
}

.bottom-nav-item.work-order-state-signature {
  color: #1b2433;
  background: rgba(246, 188, 35, 0.96);
  box-shadow: 0 10px 22px rgba(246, 188, 35, 0.32);
}

.bottom-nav-item.work-order-state-signed {
  color: #ffffff;
  background: rgba(34, 150, 79, 0.96);
  box-shadow: 0 10px 22px rgba(34, 150, 79, 0.3);
}

.bottom-nav-item.work-order-state-closed {
  color: #101722;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(255, 255, 255, 0.14);
}

.bottom-nav-item.active.work-order-state-pending,
.bottom-nav-item.active.work-order-state-signature,
.bottom-nav-item.active.work-order-state-signed,
.bottom-nav-item.active.work-order-state-closed {
  transform: translateY(-1px);
}

.bottom-nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-menu-open {
  overflow: hidden;
}

/* Ukryta warstwa menu lub modalu nigdy nie moze przechwytywac klikniec. */
.app-overlay[hidden],
.ei-modal[hidden],
#appRecovery[hidden] {
  display: none !important;
  pointer-events: none !important;
}

body.desktop-layout-active .app-overlay {
  pointer-events: none !important;
}

.app-recovery {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #18263a;
  background: rgba(238, 244, 250, 0.97);
  text-align: center;
}

.app-recovery-card {
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid #cbd9e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 35, 58, 0.2);
}

.app-recovery-card p {
  margin: 10px 0 20px;
  color: #5c6c80;
}

.app-recovery-card button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #1677e8;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

body.desktop-layout-active .bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 24px;
  left: 20px;
  z-index: 10;
  max-width: 440px;
  margin: auto;
  padding: 13px 18px;
  border-radius: 11px;
  color: white;
  background: var(--navy);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-version {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 2;
  padding: 4px 7px;
  border-radius: 7px;
  color: #657286;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 10px rgba(16, 23, 34, 0.08);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.app-shell.desktop-layout {
  --desktop-row-height: 10px;
  width: min(100%, 1360px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: var(--desktop-row-height);
  align-items: start;
  gap: 18px;
}

.app-shell.desktop-layout > .topbar,
.app-shell.desktop-layout > dialog,
.app-shell.desktop-layout > .app-version,
.app-shell.desktop-layout > .toast {
  grid-column: 1 / -1;
}

.app-shell.desktop-layout > .topbar {
  width: 100%;
  min-width: 0;
  margin: 0;
  grid-row-end: span var(--desktop-span, 4);
  align-self: start;
}

.app-shell.desktop-layout > section {
  width: 100%;
  min-width: 0;
  margin: 0;
  grid-row-end: span var(--desktop-span, 30);
}

.app-shell.desktop-layout .summary-card,
.app-shell.desktop-layout .panel,
.app-shell.desktop-layout .daily-note,
.app-shell.desktop-layout .deadline-alerts,
.app-shell.desktop-layout .history-section,
.app-shell.desktop-layout .admin-panel {
  height: fit-content;
}

.desktop-draggable-panel {
  cursor: grab;
}

.desktop-draggable-panel.dragging {
  opacity: 0.62;
  outline: 3px solid rgba(0, 91, 187, 0.24);
}

.desktop-fixed-panel {
  cursor: default;
  grid-column: 1;
}

@media (min-width: 980px) {
  .app-shell {
    width: min(100%, 1180px);
    padding-right: 28px;
    padding-left: 28px;
  }

  .app-shell.desktop-layout {
    width: min(100%, 1460px);
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: row dense;
    grid-auto-rows: var(--desktop-row-height);
    gap: 18px;
  }

  .app-shell.desktop-layout > section,
  .app-shell.desktop-layout > .topbar {
    grid-row-end: span var(--desktop-span, 30) !important;
  }

  .app-shell.desktop-layout > .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    grid-column: 1 / -1;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(16, 23, 34, 0.96);
    backdrop-filter: blur(14px);
  }

  .app-shell.desktop-layout .daily-note,
  .app-shell.desktop-layout .deadline-alerts,
  .app-shell.desktop-layout .summary-card {
    grid-column: 1 / 6;
  }

  .app-shell.desktop-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout #bossDashboardPanel,
  .app-shell.desktop-layout #historyPanel {
    grid-column: 6 / -1;
  }

  .app-shell.desktop-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 1 / 6;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 1 / 6;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1;
  }

  .app-shell.desktop-layout.home-dashboard-layout {
    grid-auto-flow: row;
    grid-auto-rows: auto;
  }

  .app-shell.desktop-layout.home-dashboard-layout > section,
  .app-shell.desktop-layout.home-dashboard-layout > .topbar {
    grid-row-end: auto !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout > .topbar {
    grid-row: 1;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note {
    grid-row: 2;
  }

  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-row: 2;
  }

  .app-shell.desktop-layout.home-dashboard-layout.home-has-work-orders .daily-note {
    grid-row: 3;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel {
    grid-row: 2;
  }

  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-row: 3;
  }

  .app-shell.desktop-layout.route-mode-active #historyPanel.app-route-active {
    grid-column: 2 / -1;
  }

  .app-shell.desktop-layout #workOrderPanel,
  .app-shell.desktop-layout #newReportPanel,
  .app-shell.desktop-layout #expensesPanel,
  .app-shell.desktop-layout #workHoursPanel,
  .app-shell.desktop-layout #certPanel,
  .app-shell.desktop-layout #vehiclePanel,
  .app-shell.desktop-layout #toolsPanel,
  .app-shell.desktop-layout #ppePanel,
  .app-shell.desktop-layout #trainingPanel,
  .app-shell.desktop-layout #signaturePanel {
    grid-column: 3 / 11;
  }

  .app-shell.desktop-layout #adminPanel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }

  .app-shell.desktop-layout #adminPanel > .admin-heading,
  .app-shell.desktop-layout #adminPanel > .admin-summary {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout #adminPanel > .admin-heading {
    position: sticky;
    top: 82px;
    z-index: 5;
    margin: -4px -4px 0;
    padding: 12px 14px;
    border: 1px solid rgba(0, 91, 187, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(16, 23, 34, 0.08);
  }

  .app-shell.desktop-layout #adminPanel > .admin-toolbar {
    grid-column: 1 / 5;
  }

  .app-shell.desktop-layout #adminWorkHoursPanel,
  .app-shell.desktop-layout #adminExpensesPanel {
    grid-column: span 4;
  }

  .app-shell.desktop-layout #adminWorkOrdersPanel,
  .app-shell.desktop-layout #adminFarmManagement,
  .app-shell.desktop-layout #adminCompanyPanel,
  .app-shell.desktop-layout #adminFeaturePanel,
  .app-shell.desktop-layout #adminUserManagement,
  .app-shell.desktop-layout #adminSmsPanel,
  .app-shell.desktop-layout #adminEmptyState,
  .app-shell.desktop-layout #adminEntriesList {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell.desktop-layout .admin-work-orders-list,
  .app-shell.desktop-layout .admin-entries-list,
  .app-shell.desktop-layout .entries-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 12px;
  }

  .app-shell.desktop-layout .desktop-draggable-panel {
    cursor: default;
  }
}

@media (min-width: 980px) {
  body.desktop-layout-active {
    overflow-x: hidden;
    background:
      linear-gradient(135deg, rgba(20, 121, 247, 0.055) 0, transparent 38%),
      repeating-linear-gradient(135deg, rgba(16, 23, 34, 0.012) 0 1px, transparent 1px 18px),
      #eef2f6;
  }

  body.desktop-layout-active::before {
    background-size: 360px 215px;
    opacity: 0.24;
  }

  body.desktop-layout-active .bottom-nav,
  body.desktop-layout-active .app-overlay {
    display: none !important;
  }

  .app-shell.desktop-layout {
    --desktop-sidebar-width: 252px;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0 18px 22px 0;
    position: relative;
    grid-template-columns: var(--desktop-sidebar-width) repeat(12, minmax(0, 1fr));
    grid-template-rows: 52px auto;
    grid-auto-flow: row dense;
    grid-auto-rows: var(--desktop-row-height);
    gap: 14px;
    align-items: start;
    transition: grid-template-columns 0.18s ease;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout {
    --desktop-sidebar-width: 0px;
    padding-left: 0;
  }

  .app-shell.desktop-layout.route-mode-active {
    padding-bottom: 22px;
  }

  .app-shell.desktop-layout > .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 52px;
    margin: 0 -18px 0 0;
    padding: 0 18px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    background: rgba(16, 23, 34, 0.985);
    box-shadow: 0 7px 18px rgba(16, 23, 34, 0.18);
  }

  .app-shell.desktop-layout .hamburger-button {
    width: 34px;
    height: 34px;
    gap: 2px;
    border-radius: 10px;
    background: rgba(22, 34, 50, 0.9);
    box-shadow: none;
  }

  .app-shell.desktop-layout .hamburger-button span {
    width: 16px;
    height: 1.5px;
  }

  .app-shell.desktop-layout .topbar-title {
    justify-items: start;
    gap: 0;
  }

  .app-shell.desktop-layout .topbar-title h1 {
    font-size: 1rem;
    text-align: left;
  }

  .app-shell.desktop-layout .topbar-title .user-button {
    font-size: 0.64rem;
  }

  .app-shell.desktop-layout .top-logout-icon-button {
    min-height: 32px;
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.66rem;
  }

  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] {
    position: sticky;
    top: 52px;
    z-index: 20;
    display: flex !important;
    grid-column: 1;
    grid-row: 2 / span 200;
    width: var(--desktop-sidebar-width);
    max-width: var(--desktop-sidebar-width);
    height: calc(100vh - 52px);
    min-height: 0;
    padding: 12px 10px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #ecf3fb;
    background: rgba(16, 23, 34, 0.975);
    box-shadow: 12px 0 24px rgba(16, 23, 34, 0.1);
    transform: none;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout > .side-menu {
    display: none !important;
  }

  .app-shell.desktop-layout .side-menu-head {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-shell.desktop-layout .side-logo-frame {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: none;
  }

  .app-shell.desktop-layout .side-logo-frame img {
    width: 30px;
    height: 30px;
  }

  .app-shell.desktop-layout .side-brand strong {
    color: #ffffff;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .app-shell.desktop-layout .side-brand span {
    color: #9fb0c3;
    font-size: 0.64rem;
  }

  .app-shell.desktop-layout .close-menu-button {
    display: none;
  }

  .app-shell.desktop-layout .side-menu-list {
    gap: 2px;
    padding: 4px 0;
  }

  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 8px;
    color: #cbd7e6;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 850;
  }

  .app-shell.desktop-layout .side-menu-list button:hover,
  .app-shell.desktop-layout .side-menu-list button:focus-visible,
  .app-shell.desktop-layout .side-utility-button:hover,
  .app-shell.desktop-layout .side-utility-button:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
  }

  .app-shell.desktop-layout .side-menu-list button.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1479f7, #0866d8);
    box-shadow: 0 7px 16px rgba(20, 121, 247, 0.24);
  }

  .app-shell.desktop-layout .side-menu-list button.nav-warning {
    color: #ffb4ba;
  }

  .app-shell.desktop-layout .side-menu-list button.nav-warning.active {
    color: #ffffff;
    background: #c83e45;
  }

  .app-shell.desktop-layout .side-menu-list button:disabled {
    color: #6d7b8d;
    background: rgba(255, 255, 255, 0.03);
  }

  .app-shell.desktop-layout .side-admin-shortcuts {
    margin: 2px 0 4px 9px;
    padding: 5px 0 5px 9px;
    border-left-color: rgba(20, 121, 247, 0.35);
  }

  .app-shell.desktop-layout .side-admin-shortcuts button {
    min-height: 29px;
    padding: 6px 8px;
    color: #aebdd0;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.66rem;
  }

  .app-shell.desktop-layout .side-admin-shortcuts button.active,
  .app-shell.desktop-layout .side-admin-shortcuts button:hover,
  .app-shell.desktop-layout .side-admin-shortcuts button:focus-visible {
    color: #ffffff;
    background: rgba(20, 121, 247, 0.25);
  }

  .app-shell.desktop-layout .side-menu-footer {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-shell.desktop-layout .side-utility-button.layout-mode-button,
  .app-shell.desktop-layout .side-info-button {
    border-color: rgba(255, 255, 255, 0.08);
    color: #d9e5f2;
    background: rgba(255, 255, 255, 0.05);
  }

  .app-shell.desktop-layout .side-info-dot {
    width: 22px;
    height: 22px;
    color: #ffffff;
    background: rgba(20, 121, 247, 0.85);
    font-size: 0.7rem;
  }

  .app-shell.desktop-layout .side-logout-button {
    color: #ffffff;
    background: #c83e45;
    text-align: center;
  }

  .app-shell.desktop-layout > section {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
    margin: 0;
    grid-row-end: span var(--desktop-span, 30) !important;
  }

  .app-shell.desktop-layout .daily-note,
  .app-shell.desktop-layout .deadline-alerts,
  .app-shell.desktop-layout .summary-card {
    grid-column: 2 / span 4;
    min-width: 0;
    overflow: hidden;
  }

  .app-shell.desktop-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 2 / -1;
  }

  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1;
  }

  .app-shell.desktop-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout #bossDashboardPanel,
  .app-shell.desktop-layout #historyPanel {
    grid-column: 6 / -1;
    min-width: 0;
  }

  .app-shell.desktop-layout #bossDashboardPanel {
    overflow: hidden;
  }

  .app-shell.desktop-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / span 4;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / span 4;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1;
  }

  .app-shell.desktop-layout #activeWorkOrdersPanel.boss-pending-home-slot.desktop-home-floating-slot {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .app-shell.desktop-layout #workOrderPanel,
  .app-shell.desktop-layout #newReportPanel,
  .app-shell.desktop-layout #expensesPanel,
  .app-shell.desktop-layout #workHoursPanel,
  .app-shell.desktop-layout #certPanel,
  .app-shell.desktop-layout #vehiclePanel,
  .app-shell.desktop-layout #toolsPanel,
  .app-shell.desktop-layout #ppePanel,
  .app-shell.desktop-layout #trainingPanel,
  .app-shell.desktop-layout #signaturePanel,
  .app-shell.desktop-layout #vacationPanel,
  .app-shell.desktop-layout #notebookPanel,
  .app-shell.desktop-layout #problemPanel,
  .app-shell.desktop-layout #adminPanel {
    grid-column: 2 / -1;
  }

  .app-shell.desktop-layout .daily-note-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .app-shell.desktop-layout .daily-note-actions span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .app-shell.desktop-layout .daily-note-actions button {
    width: 100%;
    min-width: 0;
    padding-right: 9px;
    padding-left: 9px;
  }

  .app-shell.desktop-layout .boss-dashboard-panel,
  .app-shell.desktop-layout .boss-dashboard-panel * {
    min-width: 0;
  }

  .app-shell.desktop-layout .boss-history-filters {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .app-shell.desktop-layout .boss-history-filters > label {
    grid-column: span 2;
  }

  .app-shell.desktop-layout .boss-history-filters > label:nth-of-type(3) {
    grid-column: span 3;
  }

  .app-shell.desktop-layout .boss-history-picker {
    grid-column: span 3;
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
  }

  .app-shell.desktop-layout .boss-history-filters > .admin-filter-actions {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .app-shell.desktop-layout .panel,
  .app-shell.desktop-layout .daily-note,
  .app-shell.desktop-layout .history-section,
  .app-shell.desktop-layout .summary-card,
  .app-shell.desktop-layout .admin-panel,
  .app-shell.desktop-layout .vehicle-panel {
    padding: 15px;
    border: 1px solid rgba(203, 216, 232, 0.92);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(16, 23, 34, 0.07);
  }

  .app-shell.desktop-layout .section-title,
  .app-shell.desktop-layout .summary-heading,
  .app-shell.desktop-layout .daily-note-heading {
    margin-bottom: 10px;
  }

  .app-shell.desktop-layout .eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
  }

  .app-shell.desktop-layout h2,
  .app-shell.desktop-layout .section-title h2 {
    font-size: 1rem;
  }

  .app-shell.desktop-layout form,
  .app-shell.desktop-layout .vehicle-form {
    gap: 10px;
  }

  .app-shell.desktop-layout input,
  .app-shell.desktop-layout select,
  .app-shell.desktop-layout textarea {
    min-height: 38px;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .app-shell.desktop-layout .primary-button,
  .app-shell.desktop-layout .secondary-button,
  .app-shell.desktop-layout .danger-button {
    min-height: 38px;
    border-radius: 8px;
    font-size: 0.78rem;
  }

  .app-shell.desktop-layout .field-row,
  .app-shell.desktop-layout .field-row.two-columns,
  .app-shell.desktop-layout .vehicle-form {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
  }

  .app-shell.desktop-layout .daily-note-text,
  .app-shell.desktop-layout .deadline-alert,
  .app-shell.desktop-layout .entry-card,
  .app-shell.desktop-layout .admin-work-order,
  .app-shell.desktop-layout .vehicle-item {
    border-radius: 9px;
    box-shadow: none;
  }

  .app-shell.desktop-layout .deadline-alerts {
    display: grid;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .app-shell.desktop-layout .deadline-alert {
    padding: 10px 12px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .app-shell.desktop-layout .user-work-orders-list,
  .app-shell.desktop-layout .admin-work-orders-list,
  .app-shell.desktop-layout .admin-entries-list,
  .app-shell.desktop-layout .entries-list {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .app-shell.desktop-layout .entry-card {
    grid-template-columns: 58px minmax(0, 1fr) minmax(118px, auto);
    gap: 10px;
    padding: 10px 12px;
  }

  .app-shell.desktop-layout #historyPanel .history-title {
    align-items: center;
  }

  .app-shell.desktop-layout #historyPanel .history-calendar {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 16px;
  }

  .app-shell.desktop-layout #historyPanel .calendar-weekdays,
  .app-shell.desktop-layout #historyPanel .calendar-grid {
    gap: 9px clamp(10px, 2.2vw, 28px);
  }

  .app-shell.desktop-layout #historyPanel .calendar-day,
  .app-shell.desktop-layout #historyPanel .calendar-cell {
    min-height: 42px;
  }

  .app-shell.desktop-layout #historyPanel .calendar-day {
    width: 42px;
    border-width: 3px;
  }

  .app-shell.desktop-layout #historyPanel .entries-list {
    gap: 10px;
  }

  .app-shell.desktop-layout #historyPanel .entry-card {
    align-items: center;
    min-height: 66px;
  }

  .app-shell.desktop-layout #historyPanel .date-tile {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .app-shell.desktop-layout #historyPanel .entry-title {
    gap: 6px;
  }

  .app-shell.desktop-layout #historyPanel .type-badge {
    max-width: 100%;
    white-space: normal;
  }

  .app-shell.desktop-layout #historyPanel .shared-badge {
    display: inline-block;
    max-width: min(100%, 720px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }

  .app-shell.desktop-layout #historyPanel .entry-main span {
    line-height: 1.25;
  }

  .app-shell.desktop-layout #historyPanel .entry-hours {
    min-width: 108px;
    justify-self: end;
  }

  .app-shell.desktop-layout #historyPanel .entry-actions {
    justify-content: flex-end;
    margin-top: 4px;
  }

  .app-shell.desktop-layout .entry-card strong,
  .app-shell.desktop-layout .admin-work-order strong,
  .app-shell.desktop-layout .vehicle-item strong {
    font-size: 0.82rem;
  }

  .app-shell.desktop-layout .entry-card span,
  .app-shell.desktop-layout .admin-work-order span,
  .app-shell.desktop-layout .vehicle-item span {
    font-size: 0.7rem;
  }

  .app-shell.desktop-layout .boss-dashboard-panel {
    max-width: none;
  }

  .app-shell.desktop-layout .boss-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell.desktop-layout .boss-history-table-wrap,
  .app-shell.desktop-layout .inventory-table-wrap {
    border-radius: 9px;
    box-shadow: none;
  }

  .app-shell.desktop-layout .boss-history-table,
  .app-shell.desktop-layout .inventory-table {
    min-width: 900px;
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout .boss-history-table th,
  .app-shell.desktop-layout .boss-history-table td,
  .app-shell.desktop-layout .inventory-table th,
  .app-shell.desktop-layout .inventory-table td {
    padding: 8px 9px;
  }

  .app-shell.desktop-layout #adminPanel {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
  }

  .app-shell.desktop-layout #adminPanel > .admin-heading,
  .app-shell.desktop-layout #adminPanel > .admin-summary {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout #adminPanel > .admin-heading {
    position: sticky;
    top: 62px;
    z-index: 4;
    margin: 0;
    padding: 11px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
  }

  .app-shell.desktop-layout #adminPanel > .admin-toolbar {
    grid-column: 1 / 4;
  }

  .app-shell.desktop-layout #adminWorkHoursPanel,
  .app-shell.desktop-layout #adminExpensesPanel {
    grid-column: span 6;
  }

  .app-shell.desktop-layout #adminWorkOrdersPanel,
  .app-shell.desktop-layout #adminFarmManagement,
  .app-shell.desktop-layout #adminUserManagement,
  .app-shell.desktop-layout #adminEmptyState,
  .app-shell.desktop-layout #adminEntriesList,
  .app-shell.desktop-layout #adminErrorsPanel,
  .app-shell.desktop-layout #adminLogsPanel,
  .app-shell.desktop-layout #adminStatisticsPanel,
  .app-shell.desktop-layout #adminBackupPanel,
  .app-shell.desktop-layout #adminSmsPanel {
    grid-column: 1 / -1;
  }

  /*
    Kazda zakladka panelu administratora jest wyswietlana osobno.
    Bez tej reguly elementy bez recznie przypisanej kolumny trafialy do
    pojedynczej z 12 kolumn i formularze mialy tylko ok. 100-130 px.
  */
  .app-shell.desktop-layout #adminPanel > :not([hidden]) {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .app-shell.desktop-layout #adminPanel > .admin-users,
  .app-shell.desktop-layout #adminPanel > .admin-entries-list,
  .app-shell.desktop-layout #adminPanel > .empty-state {
    min-width: 0;
    overflow: hidden;
  }

  .app-shell.desktop-layout #adminCompanyPanel .company-settings-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }

  .app-shell.desktop-layout #adminFeaturePanel .boss-feature-row {
    grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr) minmax(150px, 0.22fr);
  }

  .app-shell.desktop-layout #adminFeaturePanel .boss-feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    margin: 0;
  }

  .app-shell.desktop-layout #adminFeaturePanel .admin-user-actions {
    align-self: stretch;
    align-content: end;
  }

  .app-shell.desktop-layout .app-version {
    right: 12px;
    bottom: 9px;
  }
}

@media (min-width: 980px) and (max-width: 1450px) {
  .app-shell.desktop-layout {
    --desktop-sidebar-width: 232px;
    padding-right: 12px;
    gap: 12px;
  }

  .app-shell.desktop-layout > .topbar {
    margin-right: -12px;
    padding-right: 12px;
  }

  .app-shell.desktop-layout .daily-note-actions {
    grid-template-columns: 1fr;
  }

  .app-shell.desktop-layout .boss-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.desktop-layout .boss-history-filters > label,
  .app-shell.desktop-layout .boss-history-filters > label:nth-of-type(3),
  .app-shell.desktop-layout .boss-history-picker,
  .app-shell.desktop-layout .boss-history-filters > .admin-filter-actions {
    grid-column: auto;
  }

  .app-shell.desktop-layout .boss-history-picker {
    grid-template-columns: minmax(0, 1fr) minmax(126px, auto);
  }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .app-shell.desktop-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout #bossDashboardPanel,
  .app-shell.desktop-layout #historyPanel {
    grid-column: 2 / -1;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / span 4;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1;
  }

  .app-shell.desktop-layout .boss-history-picker,
  .app-shell.desktop-layout .boss-history-filters > .admin-filter-actions {
    grid-column: 1 / -1;
  }
}

body.theme-light {
  --surface: #ffffff;
  --ink: #101722;
  --muted: #5f6f83;
  --background: #eef2f6;
}

body.theme-light .summary-card {
  color: #ffffff;
  background: linear-gradient(135deg, #111925, #202d3e);
}

body.theme-light .admin-panel {
  color: #101722;
  border-color: #d8e3ef;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(16, 23, 34, 0.08);
}

body.theme-light .admin-panel .empty-state,
body.theme-light .admin-users,
body.theme-light .backup-card,
body.theme-light .problem-report-item,
body.theme-light .admin-user-row {
  color: #101722;
  border-color: #d8e3ef;
  background: #f8fbff;
}

body.theme-light .admin-heading,
body.theme-light .admin-toolbar,
body.theme-light .admin-users-heading {
  color: #101722;
}

body.theme-light .admin-toolbar label,
body.theme-light .admin-user-form label,
body.theme-light .admin-user-row span,
body.theme-light .problem-report-item small,
body.theme-light .admin-entry span,
body.theme-light .admin-summary span {
  color: #526274;
}

body.theme-light .admin-user-row span b,
body.theme-light .admin-user-name strong,
body.theme-light .admin-summary b,
body.theme-light .backup-card h4,
body.theme-light .problem-report-item p {
  color: #101722;
}

body.theme-light .statistics-card {
  border-color: #d8e3ef;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 42, 68, 0.08);
}

body.theme-light .statistics-card b,
body.theme-light .statistics-history-row b {
  color: #102033;
}

body.theme-light .statistics-card span,
body.theme-light .statistics-card small,
body.theme-light .statistics-history-row span,
body.theme-light .statistics-history-row small {
  color: #65748a;
}

body.theme-light .statistics-card span i {
  background: #eaf3ff;
  color: #1262c7;
}

body.theme-light .statistics-card.tone-good {
  background: linear-gradient(135deg, #ecfff5, #ffffff);
}

body.theme-light .statistics-card.tone-warning {
  background: linear-gradient(135deg, #fff9df, #ffffff);
}

body.theme-light .statistics-card.tone-danger {
  background: linear-gradient(135deg, #fff0f0, #ffffff);
}

body.theme-light .statistics-card.tone-info {
  background: linear-gradient(135deg, #eaf3ff, #ffffff);
}

body.theme-light .statistics-history-row {
  border-color: #d8e3ef;
  background: #ffffff;
}

body.theme-light .analytics-tabs,
body.theme-light .analytics-filter-bar,
body.theme-light .analytics-section {
  border-color: #d8e3ef;
  background: #ffffff;
}

body.theme-light .analytics-client-quick-range,
body.theme-light .client-profitability-head,
body.theme-light .client-profitability-kpis article,
body.theme-light .client-extremes article,
body.theme-light .client-insight-card,
body.theme-light .client-ranking-section {
  border-color: #d8e3ef;
}

body.theme-light .analytics-client-quick-range,
body.theme-light .client-profitability-kpis article,
body.theme-light .client-extremes article,
body.theme-light .client-insight-card,
body.theme-light .client-ranking-section {
  background: #ffffff;
}

body.theme-light .client-profitability-head {
  background:
    radial-gradient(circle at 90% 10%, rgba(20, 121, 247, 0.14), transparent 34%),
    linear-gradient(135deg, #f1f7ff, #ffffff);
}

body.theme-light .client-profitability-head h4,
body.theme-light .client-profitability-kpis b,
body.theme-light .client-extremes b,
body.theme-light .client-finance-column > b,
body.theme-light .client-hours-row > strong {
  color: #102033;
}

body.theme-light .client-margin-gauge::before {
  background: #ffffff;
}

body.theme-light .client-margin-gauge b {
  color: #102033;
}

body.theme-light .client-profitability-head > div:first-child > span,
body.theme-light .client-profitability-kpis span,
body.theme-light .client-profitability-kpis small,
body.theme-light .client-extremes span,
body.theme-light .client-finance-column > span,
body.theme-light .analytics-client-quick-range > span,
body.theme-light .client-analysis-note {
  color: #526274;
}

body.theme-light .client-hours-row > span {
  color: #24364d;
}

body.theme-light .client-finance-track,
body.theme-light .client-hours-track {
  background: #eaf1f8;
}

body.theme-light .client-analysis-note {
  background: #edf6ff;
}

body.theme-light .analytics-tab,
body.theme-light .analytics-range-button,
body.theme-light .analytics-date-fields label,
body.theme-light .analytics-section-heading span,
body.theme-light .analytics-chart-legend {
  color: #526274;
}

body.theme-light .analytics-tab.active,
body.theme-light .analytics-range-button.active {
  color: #ffffff;
}

body.theme-light .analytics-date-fields input {
  border-color: #cbd8e8;
  background: #ffffff;
  color: #101722;
}

body.theme-light .analytics-section h4,
body.theme-light .analytics-table td,
body.theme-light .analytics-bar-row {
  color: #102033;
}

body.theme-light .analytics-alert {
  border-color: #d8e3ef;
  background: #ffffff;
  color: #102033;
}

body.theme-light .analytics-alert b {
  background: #eaf3ff;
  color: #1262c7;
}

body.theme-light .analytics-alert small {
  color: #526274;
}

body.theme-light .analytics-alert.tone-warning {
  background: #fff9df;
}

body.theme-light .analytics-alert.tone-danger {
  background: #fff0f0;
}

body.theme-light .analytics-alert.tone-good {
  background: #ecfff5;
}

body.theme-light .analytics-line-chart line {
  stroke: rgba(82, 98, 116, 0.28);
}

body.theme-light .analytics-table-wrap {
  border-color: #d8e3ef;
}

body.theme-light .analytics-table th {
  background: #e9f3ff;
  color: #1f5f9f;
}

body.theme-light .analytics-table td {
  border-top-color: #d8e3ef;
}

body.theme-light .analytics-bar-track {
  background: #dfeaf7;
}

body.theme-light .admin-toolbar select,
body.theme-light .admin-user-form input {
  border-color: #cbd8e8;
  color: #101722;
  background: #ffffff;
}

body.theme-light .admin-summary div {
  border-color: #d8e3ef;
  background: #f7fbff;
}

body.theme-light .admin-user-actions button {
  border-color: #cbd8e8;
  color: #12314f;
  background: #eef6ff;
}

body.theme-light .admin-user-actions button[data-user-action="role"],
body.theme-light .admin-user-actions button[data-user-action="hours"],
body.theme-light .admin-user-actions button[data-user-action="password"],
body.theme-light .admin-user-actions button[data-user-action="login"] {
  border-color: #b8d4ff;
  color: #0756a8;
  background: #e8f3ff;
}

body.theme-light .admin-user-actions .delete-user,
body.theme-light .admin-user-actions .danger-action,
body.theme-light .admin-farm-row-actions .danger-action {
  border-color: #fecaca;
  color: #991b1b;
  background: #fee2e2;
}

body.theme-light .presence-badge.role {
  color: #0756a8;
  background: #dbeafe;
}

body.theme-light .presence-badge.offline {
  color: #526274;
  background: #e6edf5;
}

body.theme-light .presence-badge.online {
  color: #047857;
  background: #d1fae5;
}

body.theme-dark {
  --surface: #121c2a;
  --ink: #eef5ff;
  --muted: #a8b7ca;
  --background: #0f1722;
  color: #eef5ff;
  background:
    radial-gradient(circle at 50% 10%, rgba(20, 121, 247, 0.12), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px),
    #0f1722;
}

body.theme-dark::before {
  opacity: 0.14;
  filter: invert(1) grayscale(1);
}

body.theme-dark .panel,
body.theme-dark .daily-note,
body.theme-dark .history-section,
body.theme-dark .summary-card,
body.theme-dark .admin-panel,
body.theme-dark .vehicle-panel,
body.theme-dark .deadline-alerts-card,
body.theme-dark .boss-metrics div,
body.theme-dark .boss-vacation-block,
body.theme-dark .boss-expenses-section,
body.theme-dark .farm-info-box,
body.theme-dark .top-technicians-panel {
  color: #eef5ff;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(18, 28, 42, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

body.theme-dark .daily-note-text,
body.theme-dark .farm-info-text,
body.theme-dark .section-title h2,
body.theme-dark .deadline-alerts-heading h2,
body.theme-dark .boss-vacation-block h3,
body.theme-dark .boss-metrics b,
body.theme-dark .admin-user-row span b,
body.theme-dark .admin-user-name strong {
  color: #eef5ff;
}

body.theme-dark label,
body.theme-dark .summary-label,
body.theme-dark .boss-metrics span,
body.theme-dark .admin-user-row span,
body.theme-dark .admin-toolbar label,
body.theme-dark .admin-user-form label,
body.theme-dark .problem-report-item small {
  color: #a8b7ca;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .admin-toolbar select,
body.theme-dark .admin-user-form input {
  border-color: #33445c;
  color: #eef5ff;
  background: #172234;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #74849a;
}

body.theme-dark .boss-dashboard-tabs,
body.theme-dark .boss-history-table th,
body.theme-dark .inventory-table th {
  border-color: #33445c;
  color: #c6d6e8;
  background: #172234;
}

body.theme-dark .boss-history-table td,
body.theme-dark .inventory-table td {
  border-bottom-color: #2b3a4d;
  color: #d8e4f2;
}

body.theme-dark .boss-history-table-wrap,
body.theme-dark .inventory-table-wrap {
  border-color: #33445c;
  background: #111b29;
}

body.theme-dark .deadline-alert {
  border-color: #7c4a12;
  color: #fed7aa;
  background: #2a2118;
}

body.theme-dark .deadline-alerts-table .deadline-overdue td {
  background: rgba(127, 29, 29, 0.18);
}

body.theme-dark .secondary-button {
  color: #dbeafe;
  background: #24364d;
}

body.theme-dark .import-file-button,
body.theme-dark .export-button,
body.theme-dark .tool-admin-actions .secondary-button,
body.theme-dark .admin-farm-actions .secondary-button,
body.theme-dark .admin-farm-actions .import-file-button {
  color: #dbeafe;
  border-color: #3b4f6b;
  background: #24364d;
}

body.theme-dark .import-file-button:hover,
body.theme-dark .export-button:hover,
body.theme-dark .tool-admin-actions .secondary-button:hover,
body.theme-dark .admin-farm-actions .secondary-button:hover {
  color: #ffffff;
  background: #1d7cf2;
}

body.theme-dark .import-file-button:has(input:disabled),
body.theme-dark button:disabled,
body.theme-dark .secondary-button:disabled,
body.theme-dark .primary-button:disabled {
  color: #8fa2ba;
  border-color: #2d3d52;
  background: #172234;
  opacity: 1;
}

body.theme-dark .vehicle-item,
body.theme-dark .inventory-table tbody tr,
body.theme-dark .tool-list .vehicle-item {
  color: #eef5ff;
  border-color: #31445d;
  background: #101a28;
}

body.theme-dark .vehicle-item.warning,
body.theme-dark .inventory-table tbody tr.warning {
  background: #241b25;
}

body.theme-dark .vehicle-item strong,
body.theme-dark .inventory-name,
body.theme-dark .inventory-table td:first-child,
body.theme-dark .tool-list .vehicle-item strong {
  color: #f8fbff;
}

body.theme-dark .vehicle-item span,
body.theme-dark .inventory-table td,
body.theme-dark .inventory-name small,
body.theme-dark .inventory-notes,
body.theme-dark .tool-list .vehicle-item span {
  color: #c5d4e6;
}

body.theme-dark .vehicle-form,
body.theme-dark .tool-form,
body.theme-dark .work-order-bulk-tools,
body.theme-dark .vacation-team-block {
  color: #eef5ff;
  border-color: #34465f;
  background: #111b29;
}

body.theme-dark .inventory-table-wrap {
  border-color: #34465f;
  background: #111b29;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.theme-dark .inventory-table th {
  color: #dbeafe;
  border-bottom-color: #34465f;
  background: #172234;
}

body.theme-dark .inventory-table tbody tr:hover,
body.theme-dark .inventory-table tbody tr:focus {
  background: #17253a;
}

body.theme-dark #newReportPanel .pending-report-panel,
body.theme-dark #newReportPanel .travel-km-assignments,
body.theme-dark #newReportPanel .travel-cert-row,
body.theme-dark #newReportPanel .collaborators-box,
body.theme-dark #newReportPanel .selected-collaborators,
body.theme-dark #newReportPanel .collaborator-chip,
body.theme-dark #newReportPanel .include-current-user {
  color: #eef5ff;
  border-color: #33445c;
  background: #111b29;
}

body.theme-dark #newReportPanel .pending-report-card,
body.theme-dark #newReportPanel .pending-report-main {
  color: #eef5ff;
  border-color: #3c4f68;
  background: #172234;
}

body.theme-dark #newReportPanel .pending-report-main span,
body.theme-dark #newReportPanel .pending-report-main small,
body.theme-dark #newReportPanel .travel-cert-row > span,
body.theme-dark #newReportPanel .travel-cert-row label small,
body.theme-dark #newReportPanel .collaborator-chip small,
body.theme-dark #newReportPanel .form-hint,
body.theme-dark #newReportPanel .calculated-time {
  color: #b9c8dc;
}

body.theme-dark #newReportPanel .pending-report-main b,
body.theme-dark #newReportPanel .travel-cert-row b,
body.theme-dark #newReportPanel .collaborator-chip b,
body.theme-dark #newReportPanel .selected-collaborators b,
body.theme-dark #newReportPanel .include-current-user span,
body.theme-dark #newReportPanel .calculated-time strong {
  color: #ffffff;
}

body.theme-dark #newReportPanel input,
body.theme-dark #newReportPanel select,
body.theme-dark #newReportPanel textarea,
body.theme-dark #newReportPanel .collaborator-chip select {
  color: #f8fbff;
  border-color: #40536d;
  background: #172234;
}

body.theme-dark #newReportPanel .travel-cert-row.locked input {
  color: #94a3b8;
  background: #101827;
}

body.theme-dark #newReportPanel .collaborator-chip button {
  color: #ffffff;
  background: #1479f7;
}

/* V8.02 desktop theme hardening: desktop rules have higher specificity than base theme rules. */
body.theme-light .app-shell.desktop-layout .panel,
body.theme-light .app-shell.desktop-layout .daily-note,
body.theme-light .app-shell.desktop-layout .history-section,
body.theme-light .app-shell.desktop-layout .admin-panel,
body.theme-light .app-shell.desktop-layout .vehicle-panel,
body.theme-light .app-shell.desktop-layout .deadline-alerts-card,
body.theme-light .app-shell.desktop-layout .boss-dashboard-panel,
body.theme-light .app-shell.desktop-layout .boss-metrics div,
body.theme-light .app-shell.desktop-layout .boss-vacation-block,
body.theme-light .app-shell.desktop-layout .boss-expenses-section,
body.theme-light .app-shell.desktop-layout .farm-info-box,
body.theme-light .app-shell.desktop-layout .admin-users,
body.theme-light .app-shell.desktop-layout .admin-user-row,
body.theme-light .app-shell.desktop-layout .admin-farm-row,
body.theme-light .app-shell.desktop-layout .backup-card,
body.theme-light .app-shell.desktop-layout .problem-report-item,
body.theme-light .app-shell.desktop-layout .top-technicians-panel {
  color: #101722;
  border-color: #d5e0ed;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(16, 23, 34, 0.08);
}

body.theme-light .app-shell.desktop-layout .summary-card {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #101722, #202d3e);
  box-shadow: 0 20px 45px rgba(16, 23, 34, 0.22);
}

body.theme-light .app-shell.desktop-layout #adminPanel > .admin-heading,
body.theme-light .app-shell.desktop-layout .admin-toolbar,
body.theme-light .app-shell.desktop-layout .admin-summary div {
  color: #101722;
  border-color: #d5e0ed;
  background: rgba(248, 251, 255, 0.98);
}

body.theme-light .app-shell.desktop-layout .daily-note-text,
body.theme-light .app-shell.desktop-layout .farm-info-text,
body.theme-light .app-shell.desktop-layout .section-title h2,
body.theme-light .app-shell.desktop-layout .deadline-alerts-heading h2,
body.theme-light .app-shell.desktop-layout .boss-vacation-block h3,
body.theme-light .app-shell.desktop-layout .boss-metrics b,
body.theme-light .app-shell.desktop-layout .admin-summary b,
body.theme-light .app-shell.desktop-layout .admin-user-row span b,
body.theme-light .app-shell.desktop-layout .admin-user-name strong,
body.theme-light .app-shell.desktop-layout .backup-card h4,
body.theme-light .app-shell.desktop-layout .problem-report-item p,
body.theme-light .app-shell.desktop-layout .admin-farm-row strong,
body.theme-light .app-shell.desktop-layout .entry-card strong,
body.theme-light .app-shell.desktop-layout .vehicle-item strong {
  color: #101722;
}

body.theme-light .app-shell.desktop-layout label,
body.theme-light .app-shell.desktop-layout .summary-label,
body.theme-light .app-shell.desktop-layout .boss-metrics span,
body.theme-light .app-shell.desktop-layout .admin-summary span,
body.theme-light .app-shell.desktop-layout .admin-user-row span,
body.theme-light .app-shell.desktop-layout .admin-toolbar label,
body.theme-light .app-shell.desktop-layout .admin-user-form label,
body.theme-light .app-shell.desktop-layout .problem-report-item small,
body.theme-light .app-shell.desktop-layout .entry-card span,
body.theme-light .app-shell.desktop-layout .vehicle-item span {
  color: #526274;
}

body.theme-light .app-shell.desktop-layout .summary-card .summary-label,
body.theme-light .app-shell.desktop-layout .summary-card .summary-grid span {
  color: #b7c5d8;
}

body.theme-light .app-shell.desktop-layout .summary-card #monthTotal,
body.theme-light .app-shell.desktop-layout .summary-card .summary-grid b {
  color: #ffffff;
}

body.theme-light .app-shell.desktop-layout #monthPicker {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
}

body.theme-light .app-shell.desktop-layout input,
body.theme-light .app-shell.desktop-layout select,
body.theme-light .app-shell.desktop-layout textarea,
body.theme-light .app-shell.desktop-layout .admin-toolbar select,
body.theme-light .app-shell.desktop-layout .admin-user-form input {
  color: #101722;
  border-color: #c7d5e6;
  background: #ffffff;
}

body.theme-light .app-shell.desktop-layout input::placeholder,
body.theme-light .app-shell.desktop-layout textarea::placeholder {
  color: #718096;
}

body.theme-light .app-shell.desktop-layout .boss-dashboard-tabs,
body.theme-light .app-shell.desktop-layout .boss-history-table th,
body.theme-light .app-shell.desktop-layout .inventory-table th {
  color: #41536a;
  border-color: #d8e3ef;
  background: #edf5ff;
}

body.theme-light .app-shell.desktop-layout .boss-history-table td,
body.theme-light .app-shell.desktop-layout .inventory-table td {
  color: #243348;
  border-bottom-color: #dbe5f0;
}

body.theme-light .app-shell.desktop-layout .boss-history-table-wrap,
body.theme-light .app-shell.desktop-layout .inventory-table-wrap {
  border-color: #d8e3ef;
  background: #ffffff;
}

body.theme-light .app-shell.desktop-layout .secondary-button {
  color: #12314f;
  border-color: #cbd8e8;
  background: #edf5ff;
}

body.theme-light .app-shell.desktop-layout .admin-user-actions button,
body.theme-light .app-shell.desktop-layout .admin-farm-row-actions button {
  color: #0756a8;
  border-color: #b8d4ff;
  background: #e8f3ff;
}

body.theme-light .app-shell.desktop-layout .admin-user-actions .danger-action,
body.theme-light .app-shell.desktop-layout .admin-user-actions .delete-user,
body.theme-light .app-shell.desktop-layout .admin-farm-row-actions .danger-action {
  color: #ffffff;
  border-color: #991b1b;
  background: #991b1b;
}

body.theme-light .app-shell.desktop-layout .panel :where(p, span, small, b, strong, h2, h3, h4, td, th),
body.theme-light .app-shell.desktop-layout .daily-note :where(p, span, small, b, strong, h2, h3, h4, label),
body.theme-light .app-shell.desktop-layout .deadline-alerts-card :where(p, span, small, b, strong, h2, h3, h4, td, th),
body.theme-light .app-shell.desktop-layout .admin-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-light .app-shell.desktop-layout .boss-dashboard-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-light .app-shell.desktop-layout .history-section :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-light .app-shell.desktop-layout .vehicle-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th) {
  color: inherit;
}

body.theme-light .app-shell.desktop-layout .eyebrow,
body.theme-light .app-shell.desktop-layout .admin-badge,
body.theme-light .app-shell.desktop-layout .section-title .eyebrow,
body.theme-light .app-shell.desktop-layout .daily-note .eyebrow,
body.theme-light .app-shell.desktop-layout .deadline-alerts-card .eyebrow,
body.theme-light .app-shell.desktop-layout .boss-dashboard-panel .eyebrow {
  color: #1479f7;
}

body.theme-light .app-shell.desktop-layout button:disabled {
  opacity: 0.82;
}

body.theme-dark .app-shell.desktop-layout .panel,
body.theme-dark .app-shell.desktop-layout .daily-note,
body.theme-dark .app-shell.desktop-layout .history-section,
body.theme-dark .app-shell.desktop-layout .summary-card,
body.theme-dark .app-shell.desktop-layout .admin-panel,
body.theme-dark .app-shell.desktop-layout .vehicle-panel,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-card,
body.theme-dark .app-shell.desktop-layout .boss-dashboard-panel,
body.theme-dark .app-shell.desktop-layout .boss-metrics div,
body.theme-dark .app-shell.desktop-layout .boss-vacation-block,
body.theme-dark .app-shell.desktop-layout .boss-expenses-section,
body.theme-dark .app-shell.desktop-layout .farm-info-box,
body.theme-dark .app-shell.desktop-layout .admin-users,
body.theme-dark .app-shell.desktop-layout .admin-user-row,
body.theme-dark .app-shell.desktop-layout .admin-farm-row,
body.theme-dark .app-shell.desktop-layout .backup-card,
body.theme-dark .app-shell.desktop-layout .problem-report-item,
body.theme-dark .app-shell.desktop-layout .top-technicians-panel {
  color: #eef5ff;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(18, 28, 42, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

body.theme-dark .app-shell.desktop-layout #adminPanel > .admin-heading,
body.theme-dark .app-shell.desktop-layout .admin-toolbar,
body.theme-dark .app-shell.desktop-layout .admin-summary div {
  color: #eef5ff;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(18, 28, 42, 0.98);
}

body.theme-dark .app-shell.desktop-layout .daily-note-text,
body.theme-dark .app-shell.desktop-layout .farm-info-text,
body.theme-dark .app-shell.desktop-layout .section-title h2,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-heading h2,
body.theme-dark .app-shell.desktop-layout .boss-vacation-block h3,
body.theme-dark .app-shell.desktop-layout .boss-metrics b,
body.theme-dark .app-shell.desktop-layout .admin-summary b,
body.theme-dark .app-shell.desktop-layout .admin-user-row span b,
body.theme-dark .app-shell.desktop-layout .admin-user-name strong,
body.theme-dark .app-shell.desktop-layout .backup-card h4,
body.theme-dark .app-shell.desktop-layout .problem-report-item p,
body.theme-dark .app-shell.desktop-layout .admin-farm-row strong,
body.theme-dark .app-shell.desktop-layout .entry-card strong,
body.theme-dark .app-shell.desktop-layout .vehicle-item strong {
  color: #eef5ff;
}

body.theme-dark .app-shell.desktop-layout label,
body.theme-dark .app-shell.desktop-layout .summary-label,
body.theme-dark .app-shell.desktop-layout .summary-grid span,
body.theme-dark .app-shell.desktop-layout .boss-metrics span,
body.theme-dark .app-shell.desktop-layout .admin-summary span,
body.theme-dark .app-shell.desktop-layout .admin-user-row span,
body.theme-dark .app-shell.desktop-layout .admin-toolbar label,
body.theme-dark .app-shell.desktop-layout .admin-user-form label,
body.theme-dark .app-shell.desktop-layout .problem-report-item small,
body.theme-dark .app-shell.desktop-layout .entry-card span,
body.theme-dark .app-shell.desktop-layout .vehicle-item span {
  color: #a8b7ca;
}

body.theme-dark .app-shell.desktop-layout #monthTotal,
body.theme-dark .app-shell.desktop-layout .summary-grid b {
  color: #ffffff;
}

body.theme-dark .app-shell.desktop-layout #monthPicker {
  color: #eef5ff;
  border-color: #40536d;
  background: #21314a;
}

body.theme-dark .app-shell.desktop-layout input,
body.theme-dark .app-shell.desktop-layout select,
body.theme-dark .app-shell.desktop-layout textarea,
body.theme-dark .app-shell.desktop-layout .admin-toolbar select,
body.theme-dark .app-shell.desktop-layout .admin-user-form input {
  color: #eef5ff;
  border-color: #3c4f68;
  background: #172234;
}

body.theme-dark .app-shell.desktop-layout input::placeholder,
body.theme-dark .app-shell.desktop-layout textarea::placeholder {
  color: #7f8da3;
}

body.theme-dark .app-shell.desktop-layout .boss-dashboard-tabs,
body.theme-dark .app-shell.desktop-layout .boss-history-table th,
body.theme-dark .app-shell.desktop-layout .inventory-table th {
  color: #c6d6e8;
  border-color: #33445c;
  background: #172234;
}

body.theme-dark .app-shell.desktop-layout .boss-history-table td,
body.theme-dark .app-shell.desktop-layout .inventory-table td {
  color: #d8e4f2;
  border-bottom-color: #2b3a4d;
}

body.theme-dark .app-shell.desktop-layout .boss-history-table-wrap,
body.theme-dark .app-shell.desktop-layout .inventory-table-wrap {
  border-color: #33445c;
  background: #111b29;
}

body.theme-dark .app-shell.desktop-layout .secondary-button {
  color: #dbeafe;
  border-color: #3b4f6b;
  background: #24364d;
}

body.theme-dark .app-shell.desktop-layout #adminCompanyPanel .company-settings-fields,
body.theme-dark .app-shell.desktop-layout #adminCompanyPanel .company-logo-box {
  color: #eef5ff;
  border-color: #33445c;
  background: #172234;
}

body.theme-dark .app-shell.desktop-layout #adminCompanyPanel .company-logo-preview-wrap {
  border-color: #4b617e;
  background: #f8fbff;
}

body.theme-light .app-shell.desktop-layout #adminCompanyPanel .company-settings-fields,
body.theme-light .app-shell.desktop-layout #adminCompanyPanel .company-logo-box {
  color: #101722;
  border-color: #d8e3ef;
  background: #f8fbff;
}

@media (min-width: 980px) and (max-width: 1180px) {
  .app-shell.desktop-layout #adminCompanyPanel .company-settings-grid,
  .app-shell.desktop-layout #adminFeaturePanel .boss-feature-row {
    grid-template-columns: 1fr;
  }
}

body.theme-dark .app-shell.desktop-layout .admin-user-actions button,
body.theme-dark .app-shell.desktop-layout .admin-farm-row-actions button {
  color: #dbeafe;
  border-color: #3f5f92;
  background: #1f3552;
}

body.theme-dark .app-shell.desktop-layout .admin-user-actions .danger-action,
body.theme-dark .app-shell.desktop-layout .admin-user-actions .delete-user,
body.theme-dark .app-shell.desktop-layout .admin-farm-row-actions .danger-action {
  color: #fee2e2;
  border-color: #7f1d1d;
  background: #7f1d1d;
}

body.theme-dark .app-shell.desktop-layout .panel :where(p, span, small, b, strong, h2, h3, h4, td, th),
body.theme-dark .app-shell.desktop-layout .daily-note :where(p, span, small, b, strong, h2, h3, h4, label),
body.theme-dark .app-shell.desktop-layout .deadline-alerts-card :where(p, span, small, b, strong, h2, h3, h4, td, th),
body.theme-dark .app-shell.desktop-layout .admin-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-dark .app-shell.desktop-layout .boss-dashboard-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-dark .app-shell.desktop-layout .history-section :where(p, span, small, b, strong, h2, h3, h4, label, td, th),
body.theme-dark .app-shell.desktop-layout .vehicle-panel :where(p, span, small, b, strong, h2, h3, h4, label, td, th) {
  color: inherit;
}

body.theme-dark .app-shell.desktop-layout .eyebrow,
body.theme-dark .app-shell.desktop-layout .admin-badge,
body.theme-dark .app-shell.desktop-layout .section-title .eyebrow,
body.theme-dark .app-shell.desktop-layout .daily-note .eyebrow,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-card .eyebrow,
body.theme-dark .app-shell.desktop-layout .boss-dashboard-panel .eyebrow {
  color: #5aa2ff;
}

body.theme-dark .app-shell.desktop-layout button:disabled {
  opacity: 0.82;
}

/* V8.05: dark desktop form/list surfaces must not inherit light card backgrounds. */
body.theme-dark .app-shell.desktop-layout .vehicle-form,
body.theme-dark .app-shell.desktop-layout .user-cert-actions,
body.theme-dark .app-shell.desktop-layout .work-hours-rates,
body.theme-dark .app-shell.desktop-layout .expense-export-actions,
body.theme-dark .app-shell.desktop-layout .work-order-users,
body.theme-dark .app-shell.desktop-layout .work-order-guests,
body.theme-dark .app-shell.desktop-layout .work-order-selected-users,
body.theme-dark .app-shell.desktop-layout .work-order-guest,
body.theme-dark .app-shell.desktop-layout .include-current-user,
body.theme-dark .app-shell.desktop-layout .history-month-nav,
body.theme-dark .app-shell.desktop-layout .empty-state,
body.theme-dark .app-shell.desktop-layout .empty-state.compact {
  color: #eef5ff;
  border-color: #34465f;
  background: #111b29;
  box-shadow: none;
}

body.theme-dark .app-shell.desktop-layout .entry-card,
body.theme-dark .app-shell.desktop-layout .vehicle-item,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr,
body.theme-dark .app-shell.desktop-layout .boss-history-table tr {
  color: #eef5ff;
  border-color: #2f4056;
  background: #101a28;
}

body.theme-dark .app-shell.desktop-layout .entry-card,
body.theme-dark .app-shell.desktop-layout .vehicle-item {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.theme-dark .app-shell.desktop-layout .vehicle-item.warning,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning:hover,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning:focus {
  background: #241b25;
}

body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr:hover,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr:focus,
body.theme-dark .app-shell.desktop-layout .boss-history-table tr:hover,
body.theme-dark .app-shell.desktop-layout .boss-history-table tr:focus {
  background: #17253a;
  box-shadow: inset 0 0 0 2px rgba(90, 162, 255, 0.18);
}

body.theme-dark .app-shell.desktop-layout .vehicle-form label,
body.theme-dark .app-shell.desktop-layout .work-hours-rates label,
body.theme-dark .app-shell.desktop-layout .user-cert-actions label,
body.theme-dark .app-shell.desktop-layout .work-order-users legend,
body.theme-dark .app-shell.desktop-layout .work-order-guests legend,
body.theme-dark .app-shell.desktop-layout .form-hint,
body.theme-dark .app-shell.desktop-layout .empty-order-list,
body.theme-dark .app-shell.desktop-layout .empty-state p,
body.theme-dark .app-shell.desktop-layout .inventory-name small {
  color: #b8c7da;
}

body.theme-dark .app-shell.desktop-layout .empty-state h3,
body.theme-dark .app-shell.desktop-layout .selected-history-title,
body.theme-dark .app-shell.desktop-layout .vehicle-item strong,
body.theme-dark .app-shell.desktop-layout .inventory-name,
body.theme-dark .app-shell.desktop-layout .entry-card strong,
body.theme-dark .app-shell.desktop-layout .entry-hours b {
  color: #f8fbff;
}

body.theme-dark .app-shell.desktop-layout .vehicle-item span,
body.theme-dark .app-shell.desktop-layout .entry-card span,
body.theme-dark .app-shell.desktop-layout .inventory-table td,
body.theme-dark .app-shell.desktop-layout .boss-history-table td {
  color: #c9d7e8;
}

body.theme-dark .app-shell.desktop-layout .history-month-label,
body.theme-dark .app-shell.desktop-layout .month-choice,
body.theme-dark .app-shell.desktop-layout .work-order-selected-chips button {
  color: #eef5ff;
  border-color: #34465f;
  background: #172234;
}

body.theme-dark .app-shell.desktop-layout .history-month-arrow {
  color: #dbeafe;
  background: #24364d;
}

body.theme-dark .app-shell.desktop-layout .calendar-weekdays span {
  color: #c8d6e8;
}

body.theme-dark .app-shell.desktop-layout .calendar-cell.empty {
  background: transparent;
}

body.theme-dark .app-shell.desktop-layout .type-badge {
  color: #bfdbfe !important;
  background: #183763;
}

body.theme-dark .app-shell.desktop-layout .shared-badge {
  color: #bbf7d0 !important;
  background: #173c2a;
}

body.theme-dark .app-shell.desktop-layout .inventory-badge {
  color: #d9e7f7;
  border-color: #40536c;
  background: #172234;
}

body.theme-dark .app-shell.desktop-layout .inventory-badge.ok {
  color: #bbf7d0;
  border-color: #166534;
  background: #123923;
}

body.theme-dark .app-shell.desktop-layout .inventory-badge.warning {
  color: #fde68a;
  border-color: #92400e;
  background: #3b2b12;
}

body.theme-dark .app-shell.desktop-layout .inventory-badge.danger {
  color: #fecaca;
  border-color: #991b1b;
  background: #3a1518;
}

body.theme-dark .app-shell.desktop-layout .inventory-badge.warehouse {
  color: #bfdbfe;
  border-color: #1d4ed8;
  background: #142b4d;
}

body.theme-dark .app-shell.desktop-layout .edit-inline-button,
body.theme-dark .app-shell.desktop-layout .entry-actions button {
  color: #bfdbfe;
  border-color: #315f9e;
  background: #173763;
}

body.theme-dark .app-shell.desktop-layout .edit-inline-button.danger,
body.theme-dark .app-shell.desktop-layout .entry-actions .entry-delete-action {
  color: #fecaca;
  border-color: #7f1d1d;
  background: #3a1518;
}

body.theme-dark .app-shell.desktop-layout .edit-inline-button.warning-action {
  color: #fde68a;
  border-color: #92400e;
  background: #3b2b12;
}

body.theme-dark .app-shell.desktop-layout .signature-canvas,
body.theme-dark .app-shell.desktop-layout .guest-signature-canvas {
  border-color: #536782;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(225, 235, 247, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(22, 119, 242, 0.08) 31px 32px);
}

/* V8.06: readable deadline alerts in dark desktop mode. */
body.theme-dark .app-shell.desktop-layout .deadline-alerts-card {
  color: #f4f8ff;
  border-color: #344861;
  background: #101a28;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-heading h2 {
  color: #f8fbff;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-card .eyebrow {
  color: #5aa2ff;
}

body.theme-dark .app-shell.desktop-layout .deadline-table-wrap {
  border-color: #354961;
  background: #0d1623;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table {
  color: #e7f0fb;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table th {
  color: #dce9f8;
  border-bottom-color: #40546f;
  background: #18253a;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table td {
  color: #e3edf9;
  border-bottom-color: #34465f;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table .deadline-overdue td,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-overdue {
  background: #261923;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-soon {
  background: #1d1f1d;
}

body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-overdue:hover,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-overdue:focus,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-soon:hover,
body.theme-dark .app-shell.desktop-layout .deadline-alerts-table tr.deadline-soon:focus {
  background: #23334d;
}

body.theme-dark .app-shell.desktop-layout .deadline-status {
  color: #f8fbff;
  border: 1px solid #50647f;
  background: #24364d;
}

body.theme-dark .app-shell.desktop-layout .deadline-status.danger {
  color: #fecaca !important;
  border-color: #b91c1c;
  background: #5b1d24;
}

body.theme-dark .app-shell.desktop-layout .deadline-status.warning {
  color: #fde68a !important;
  border-color: #b45309;
  background: #4a3213;
}

/* V8.07: readable pending work orders in dark desktop mode. */
body.theme-dark .app-shell.desktop-layout .admin-work-order,
body.theme-dark .app-shell.desktop-layout .user-work-order {
  color: #f4f8ff;
  border-color: #4a3517;
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #201a12, #141c2a);
}

body.theme-dark .app-shell.desktop-layout .admin-work-order strong,
body.theme-dark .app-shell.desktop-layout .user-work-order strong {
  color: #fef3c7;
}

body.theme-dark .app-shell.desktop-layout .admin-work-order span,
body.theme-dark .app-shell.desktop-layout .admin-work-order small,
body.theme-dark .app-shell.desktop-layout .user-work-order span,
body.theme-dark .app-shell.desktop-layout .user-work-order small {
  color: #d9e6f6;
}

body.theme-dark .app-shell.desktop-layout .signed-work-order {
  border-color: #245c3b;
  border-left-color: #22c55e;
  background: linear-gradient(135deg, #10291d, #122235);
}

body.theme-dark .app-shell.desktop-layout .signed-work-order strong {
  color: #bbf7d0;
}

body.theme-dark .app-shell.desktop-layout .coordinator-work-order {
  border-color: #7c4a03;
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #2a1f0d, #172235);
}

body.theme-dark .app-shell.desktop-layout .coordinator-work-order strong {
  color: #fde68a;
}

body.theme-dark .app-shell.desktop-layout .user-work-order .admin-user-actions {
  gap: 10px;
}

body.theme-dark .app-shell.desktop-layout .work-order-sign-button {
  color: #ffffff;
  background: #1677f2;
}

body.theme-dark .app-shell.desktop-layout .work-order-close-button {
  color: #ffffff;
  background: #16a34a;
}

body.theme-dark .app-shell.desktop-layout .user-work-order .danger-action,
body.theme-dark .app-shell.desktop-layout .admin-work-order .danger-action {
  color: #fee2e2;
  border-color: #7f1d1d;
  background: #8f1d1d;
}

/* V8.08: readable mobile dark calendar and active work-order fields. */
body.theme-dark .history-month-nav,
body.theme-dark .history-user-filter select {
  color: #eef5ff;
  border-color: #34465f;
  background: #101a28;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.theme-dark .history-month-label {
  color: #f8fbff;
  border-color: #40536d;
  background: #172234;
  box-shadow: inset 0 0 0 1px #40536d;
}

body.theme-dark .history-month-arrow {
  color: #dbeafe;
  background: #24364d;
}

body.theme-dark .month-dialog {
  color: #eef5ff;
  border: 1px solid #34465f;
  background: #101a28;
}

body.theme-dark .month-dialog-head strong {
  color: #f8fbff;
}

body.theme-dark .month-choice {
  color: #eef5ff;
  border-color: #34465f;
  background: #172234;
}

body.theme-dark .month-choice.active {
  color: #ffffff;
  border-color: #1d7cf2;
  background: #1d7cf2;
}

body.theme-dark .history-user-filter label,
body.theme-dark .calendar-weekdays span {
  color: #dbeafe;
}

body.theme-dark .history-calendar .calendar-day,
body.theme-dark .vacation-calendar .calendar-day {
  color: #f8fbff;
  background: #142033;
  box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.1);
}

body.theme-dark .history-calendar .calendar-day.filled {
  color: #ffffff;
  background: #10291d;
}

body.theme-dark .vacation-calendar .calendar-day.vacation-selected {
  color: #ffffff;
  border-color: #c084fc;
  background: #6d28d9;
  box-shadow: 0 0 0 5px rgba(192, 132, 252, 0.22), 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.theme-dark .history-calendar .calendar-day.selected,
body.theme-dark .vacation-calendar .calendar-day.selected {
  color: #ffffff;
  background: #0b5ecb;
}

body.theme-dark .vacation-day-details {
  color: #e8f1ff;
  border-color: #304156;
  background: #111d2b;
}

body.theme-dark .vacation-day-details-header {
  color: #9db1cb;
}

body.theme-dark .vacation-day-details-header strong {
  color: #ffffff;
}

body.theme-dark .vacation-day-people span {
  color: #d9ecff;
  border-color: #2f5e91;
  background: #16263a;
}

body.theme-dark .vacation-user-days {
  color: #e8f1ff;
  border-color: #304156;
  background: #111d2b;
}

body.theme-dark .vacation-user-days-heading span {
  color: #9db1cb;
}

body.theme-dark .vacation-user-days-heading strong {
  color: #ffffff;
}

body.theme-dark .vacation-user-days-list button {
  color: #d9ecff;
  border-color: #2f5e91;
  background: #16263a;
}

body.theme-dark .expense-title-suggestions {
  border-color: #34465f;
  background: #101a28;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

body.theme-dark .expense-title-suggestions button {
  color: #eef5ff;
  background: #172234;
}

body.theme-dark .expense-title-suggestions button:hover,
body.theme-dark .expense-title-suggestions button:focus-visible {
  color: #ffffff;
  background: #1479f7;
}

body.theme-dark .expense-meta-pill {
  color: #dbeafe;
  border-color: #365577;
  background: #172234;
}

body.theme-dark .expense-vehicle-favorite-active {
  color: #facc15;
  border-color: #a16207;
  background: #2d2411;
}

body.theme-dark .expense-diet-control,
body.theme-dark .vehicle-cost-export {
  color: #eef5ff;
  border-color: #34465f;
  background: #111b29;
}

body.theme-dark .expense-diet-fields small {
  color: #b8c7da;
}

body.theme-dark .checkbox-card {
  color: #eef5ff;
}

body.theme-dark .entries-list .entry-card,
body.theme-dark .personal-note-item {
  color: #eef5ff;
  border-color: #34465f;
  background: #101a28;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.theme-dark .entries-list .entry-card strong,
body.theme-dark .entries-list .entry-hours b,
body.theme-dark .personal-note-item strong,
body.theme-dark .personal-note-item p {
  color: #f8fbff;
}

body.theme-dark .entries-list .entry-card span,
body.theme-dark .personal-note-item span {
  color: #b8c7da;
}

body.theme-dark .entries-list .vacation-entry-card,
body.theme-dark .personal-note-item.note-due {
  border-color: #1f8f52;
  background: #10291d;
}

body.theme-dark .entries-list .vacation-badge {
  color: #bbf7d0 !important;
  background: #17452c;
}

body.theme-dark .history-calendar .calendar-day:disabled,
body.theme-dark .vacation-calendar .calendar-day:disabled {
  color: #7f93ad;
  background: transparent;
}

body.theme-dark .work-order-active-details {
  color: #eef5ff;
  border-color: #34465f;
  background: #101a28;
}

body.theme-dark .work-order-active-details summary,
body.theme-dark .work-order-active-group strong {
  color: #f8fbff;
}

body.theme-dark .work-order-active-group {
  border-color: #34465f;
  background: #111b29;
}

body.theme-dark .work-order-active-task {
  color: #eef5ff;
  border-color: #2f4056;
  background: #172234;
}

body.theme-dark .work-order-active-task.readonly-task {
  background: #121c2b;
}

body.theme-dark .work-order-active-task span,
body.theme-dark .work-order-breaks-field > summary,
body.theme-dark .work-order-breaks-field > span,
body.theme-dark .active-save-state {
  color: #d7e4f5;
}

body.theme-dark .work-order-active-task.readonly-task span,
body.theme-dark .work-order-active-task.readonly-task .active-time-button {
  color: #9fb0c5;
}

body.theme-dark .work-order-active-task select,
body.theme-dark .work-order-break-row input,
body.theme-dark .work-order-break-row select,
body.theme-dark .work-order-active-extra input,
body.theme-dark .work-order-active-extra select,
body.theme-dark .active-time-button {
  color: #f8fbff;
  border-color: #40536d;
  background: #172234;
}

body.theme-dark .work-order-active-task select::placeholder,
body.theme-dark .work-order-break-row input::placeholder,
body.theme-dark .work-order-active-extra input::placeholder {
  color: #8fa3bd;
}

body.theme-dark .active-time-button.has-value {
  color: #ffffff;
  background: #24364d;
}

body.theme-dark .active-time-sheet {
  border-color: #34465f;
  background: #101a28;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

body.theme-dark .active-time-head strong {
  color: #f8fbff;
}

body.theme-dark .active-time-preview,
body.theme-dark .active-time-separator {
  color: #ffffff;
}

body.theme-dark .active-time-wheel {
  border-color: #34465f;
  background: linear-gradient(180deg, #111b29, #0d1725);
}

body.theme-dark .active-time-wheels-body::before {
  background: linear-gradient(180deg, #111b29 0%, rgba(17, 27, 41, 0) 100%);
}

body.theme-dark .active-time-wheels-body::after {
  background: linear-gradient(0deg, #0d1725 0%, rgba(13, 23, 37, 0) 100%);
}

body.theme-dark .active-time-wheel-labels {
  color: #9fb2ca;
}

body.theme-dark .active-time-selection {
  border-color: rgba(96, 165, 250, 0.9);
  background: rgba(37, 99, 235, 0.22);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.24);
}

body.theme-dark .active-time-option {
  color: #8fa3bd;
}

body.theme-dark .active-time-option.selected {
  color: #ffffff;
  background: rgba(96, 165, 250, 0.16);
}

body.theme-dark .work-order-role-hint {
  color: #93a8c4;
}

/* V8.17: final dark-mode contrast and desktop calendar fit. */
@media (min-width: 980px) {
  .app-shell.desktop-layout #historyPanel.app-route-active {
    grid-column: 2 / -1;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .history-calendar {
    width: min(100%, 1240px);
    max-width: none;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .entries-list {
    width: 100%;
  }
}

body.theme-dark .vehicle-form,
body.theme-dark .tool-form,
body.theme-dark .work-hours-rates,
body.theme-dark .user-cert-actions,
body.theme-dark .expense-export-actions,
body.theme-dark .work-order-users,
body.theme-dark .work-order-guests,
body.theme-dark .work-order-selected-users,
body.theme-dark .work-order-guest,
body.theme-dark .include-current-user,
body.theme-dark .history-user-filter,
body.theme-dark .vacation-team-block {
  color: #eef5ff;
  border-color: #34465f;
  background: #111b29;
}

body.theme-dark .vehicle-form label,
body.theme-dark .tool-form label,
body.theme-dark .work-hours-rates label,
body.theme-dark .user-cert-actions label,
body.theme-dark .work-order-users legend,
body.theme-dark .work-order-guests legend,
body.theme-dark .history-user-filter label,
body.theme-dark .form-hint,
body.theme-dark .empty-state,
body.theme-dark .empty-state p {
  color: #b8c7da;
}

body.theme-dark .vehicle-item,
body.theme-dark .inventory-table tbody tr,
body.theme-dark .tool-list .vehicle-item,
body.theme-dark .training-list .vehicle-item {
  color: #eef5ff;
  border-color: #304158;
  background: #111b29;
}

body.theme-dark .vehicle-item.warning,
body.theme-dark .inventory-table tbody tr.warning,
body.theme-dark .inventory-table tbody tr.warning:hover,
body.theme-dark .inventory-table tbody tr.warning:focus,
body.theme-dark .app-shell.desktop-layout .vehicle-item.warning,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning:hover,
body.theme-dark .app-shell.desktop-layout .inventory-table tbody tr.warning:focus {
  background: #151f2e;
  box-shadow: inset 5px 0 0 rgba(220, 38, 38, 0.88);
}

body.theme-dark .vehicle-item strong,
body.theme-dark .inventory-name,
body.theme-dark .inventory-table td:first-child,
body.theme-dark .tool-list .vehicle-item strong,
body.theme-dark .training-list .vehicle-item strong {
  color: #f8fbff;
}

body.theme-dark .vehicle-item span,
body.theme-dark .inventory-table td,
body.theme-dark .inventory-name small,
body.theme-dark .inventory-notes,
body.theme-dark .tool-list .vehicle-item span,
body.theme-dark .training-list .vehicle-item span {
  color: #cbd8ea;
}

body.theme-dark .inventory-table th,
body.theme-dark .boss-history-table th,
body.theme-dark .deadline-alerts-table th {
  color: #dbeafe;
  background: #172234;
}

body.theme-dark .inventory-table-wrap,
body.theme-dark .boss-history-table-wrap,
body.theme-dark .deadline-table-wrap {
  border-color: #34465f;
  background: #0f1826;
}

body.theme-dark .inventory-table tbody tr:hover,
body.theme-dark .inventory-table tbody tr:focus,
body.theme-dark .vehicle-item:hover,
body.theme-dark .vehicle-item:focus-within {
  background: #17253a;
}

body.theme-dark .selected-history-title,
body.theme-dark .entries-list .entry-title,
body.theme-dark .entries-list .entry-main strong,
body.theme-dark .entries-list .entry-hours b {
  color: #f8fbff;
}

body.theme-dark .entries-list .entry-main span,
body.theme-dark .entries-list .entry-actions button {
  color: #c7d6e8;
}

body.theme-dark .entries-list .entry-card {
  border-color: #34465f;
  background: #101a28;
}

body.theme-dark .entries-list .entry-card .date-tile {
  color: #ffffff;
  background: #22334c;
}

body.theme-dark .app-shell.desktop-layout .vehicle-form,
body.theme-dark .app-shell.desktop-layout .tool-form,
body.theme-dark .app-shell.desktop-layout .work-hours-rates,
body.theme-dark .app-shell.desktop-layout .user-cert-actions,
body.theme-dark .app-shell.desktop-layout .expense-export-actions,
body.theme-dark .app-shell.desktop-layout .expense-diet-control,
body.theme-dark .app-shell.desktop-layout .vehicle-cost-export,
body.theme-dark .app-shell.desktop-layout .work-order-users,
body.theme-dark .app-shell.desktop-layout .work-order-guests,
body.theme-dark .app-shell.desktop-layout .work-order-selected-users,
body.theme-dark .app-shell.desktop-layout .work-order-guest,
body.theme-dark .app-shell.desktop-layout .include-current-user,
body.theme-dark .app-shell.desktop-layout .history-user-filter,
body.theme-dark .app-shell.desktop-layout .vacation-team-block {
  color: #eef5ff;
  border-color: #34465f;
  background: #111b29;
}

@media (max-width: 480px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell {
    padding-right: 13px;
    padding-left: 13px;
  }

  .logo-frame {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .summary-card,
  .panel,
  .daily-note {
    padding: 18px;
    border-radius: 18px;
  }

  .summary-heading {
    align-items: flex-start;
    gap: 10px;
  }

  #monthPicker {
    max-width: 132px;
    padding: 10px;
    font-size: 0.8rem;
  }

  .summary-grid div {
    padding: 10px 8px;
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .field-row label:last-child {
    grid-column: 1 / -1;
  }

  .field-row.two-columns label:last-child {
    grid-column: auto;
  }

  .entry-card {
    grid-template-columns: auto 1fr;
  }

  .entry-hours {
    grid-column: 2;
    text-align: left;
  }

  .entry-actions {
    justify-content: flex-start;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-toolbar .export-button {
    min-height: 46px;
  }

  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .backup-panel-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-form {
    grid-template-columns: 1fr;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    flex-wrap: wrap;
  }

  .admin-work-order {
    flex-direction: column;
  }

  .history-month-nav {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .history-month-label {
    min-width: 0;
    flex: 1;
  }

  .history-user-filter,
  .history-user-filter label {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: clamp(4px, 1.7vw, 8px);
  }

  .calendar-weekdays span {
    font-size: clamp(0.62rem, 2.4vw, 0.72rem);
  }

  .calendar-day,
  .calendar-cell {
    min-height: 0;
  }

  .calendar-day {
    width: 100%;
    max-width: 42px;
    border-width: 2px;
    font-size: clamp(0.86rem, 4.6vw, 1.1rem);
  }

  .work-order-bulk-tools {
    grid-template-columns: 1fr;
  }

  .admin-picker-row {
    grid-template-columns: 1fr;
  }

  .collaborator-chip {
    grid-template-columns: 1fr 1fr;
  }

  .collaborator-chip b,
  .collaborator-chip small {
    grid-column: 1 / -1;
  }

  .collaborator-chip button {
    justify-self: end;
  }

  .month-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* V8.59 hotfix: stable boss home layout and dark mobile readability. */
@media (min-width: 980px) {
  .app-shell.desktop-layout.home-dashboard-layout > .topbar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note {
    grid-column: 2 / span 4 !important;
    grid-row: 2 !important;
    align-self: start !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / span 4 !important;
    grid-row: 3 !important;
    align-self: start !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel {
    grid-column: 6 / -1 !important;
    grid-row: 2 !important;
    align-self: start !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1 !important;
    grid-row: 3 !important;
    align-self: start !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-column: 2 / span 4 !important;
    grid-row: 4 !important;
  }
}

@media (min-width: 980px) and (max-width: 1320px) {
  .app-shell.desktop-layout.home-dashboard-layout {
    grid-template-columns: 230px repeat(10, minmax(0, 1fr)) !important;
    column-gap: 14px !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot,
  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-column: 2 / span 4 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1 !important;
  }
}

@media (max-width: 767px) {
  body.theme-dark .boss-dashboard-panel .boss-history-table,
  body.theme-dark .boss-dashboard-panel .boss-history-table tbody,
  body.theme-dark .boss-dashboard-panel .boss-history-table tr,
  body.theme-dark .boss-dashboard-panel .entry-card,
  body.theme-dark .boss-dashboard-panel .mobile-card,
  body.theme-dark .boss-vacation-block .boss-history-table,
  body.theme-dark .boss-vacation-block .boss-history-table tbody,
  body.theme-dark .boss-vacation-block .boss-history-table tr,
  body.theme-dark .boss-vacation-block .entry-card,
  body.theme-dark .boss-vacation-block .mobile-card {
    background: #111f2f !important;
    color: #f8fbff !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
  }

  body.theme-dark .boss-dashboard-panel .boss-history-table th,
  body.theme-dark .boss-dashboard-panel .boss-history-table td,
  body.theme-dark .boss-dashboard-panel .entry-card *,
  body.theme-dark .boss-dashboard-panel .mobile-card *,
  body.theme-dark .boss-vacation-block .boss-history-table th,
  body.theme-dark .boss-vacation-block .boss-history-table td,
  body.theme-dark .boss-vacation-block .entry-card *,
  body.theme-dark .boss-vacation-block .mobile-card * {
    color: #f8fbff !important;
  }

  body.theme-dark .boss-dashboard-panel .muted,
  body.theme-dark .boss-dashboard-panel small,
  body.theme-dark .boss-vacation-block .muted,
  body.theme-dark .boss-vacation-block small {
    color: #cbd5e1 !important;
  }
}

/* Mobile dark mode readability safety net. */
@media (max-width: 767px) {
  body.theme-dark :is(
    .daily-note,
    .deadline-alerts,
    .deadline-alert-card,
    .deadline-alert,
    .deadline-alerts-card,
    .monitor-card,
    .monitor-item,
    .summary-card,
    .boss-dashboard-panel,
    .boss-vacation-block,
    .work-order-card,
    .entry-card,
    .mobile-card,
    .calendar-entry,
    .availability-card,
    .expense-card,
    .note-card,
    .vehicle-card,
    .tool-card,
    .ppe-card,
    .training-card,
    .admin-card,
    .admin-panel,
    .form-card,
    .form-section,
    .work-order-fill,
    .active-work-order-panel
  ) {
    background: rgba(15, 27, 43, 0.96) !important;
    color: #f8fbff !important;
    border-color: rgba(148, 163, 184, 0.48) !important;
  }

  body.theme-dark :is(
    .daily-note,
    .deadline-alerts,
    .deadline-alert-card,
    .deadline-alert,
    .deadline-alerts-card,
    .monitor-card,
    .monitor-item,
    .summary-card,
    .boss-dashboard-panel,
    .boss-vacation-block,
    .work-order-card,
    .entry-card,
    .mobile-card,
    .calendar-entry,
    .availability-card,
    .expense-card,
    .note-card,
    .vehicle-card,
    .tool-card,
    .ppe-card,
    .training-card,
    .admin-card,
    .admin-panel,
    .form-card,
    .form-section,
    .work-order-fill,
    .active-work-order-panel
  ) :is(h1, h2, h3, h4, p, span, small, strong, label, div, td, th, li) {
    color: #f8fbff !important;
  }

  body.theme-dark :is(.muted, .hint, .help-text, .subtitle, .meta, .card-meta, .entry-meta, .table-note, small) {
    color: #cbd5e1 !important;
  }

  body.theme-dark :is(input, textarea, select, .select-like, .date-input, .time-select, .time-picker, .time-wheel, .time-wheel-panel) {
    background: #162236 !important;
    color: #f8fbff !important;
    border-color: #486079 !important;
  }

  body.theme-dark :is(input, textarea)::placeholder {
    color: #9fb0c6 !important;
    opacity: 1 !important;
  }

  body.theme-dark select option {
    background: #162236 !important;
    color: #f8fbff !important;
  }

  body.theme-dark :is(.deadline-alerts .mobile-card, .deadline-alerts .entry-card, .deadline-alert-card, .deadline-alert, .monitor-item, .deadline-alerts-table .deadline-overdue td) {
    background: rgba(52, 26, 34, 0.96) !important;
    color: #fff7ed !important;
    border-color: rgba(248, 113, 113, 0.55) !important;
  }

  body.theme-dark :is(.deadline-alerts .mobile-card, .deadline-alerts .entry-card, .deadline-alert-card, .deadline-alert, .monitor-item, .deadline-alerts-table .deadline-overdue td) :is(h1, h2, h3, h4, p, span, small, strong, label, div, td, th, li) {
    color: #fff7ed !important;
  }

  body.theme-dark :is(.deadline-status, .badge-danger, .chip-danger, .pill-danger, .status-danger, .overdue, .danger-pill) {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
  }

  body.theme-dark :is(.badge, .chip, .pill, .status-pill):not(.deadline-status):not(.badge-danger):not(.chip-danger):not(.pill-danger):not(.status-danger):not(.overdue):not(.danger-pill) {
    color: #f8fbff !important;
  }

  body.theme-dark :is(.btn, .button, button, .icon-button, .secondary-button):not(.primary):not(.btn-primary):not(.primary-action):not(.danger):not(.danger-button):not(.delete-button):not(.logout-btn):not(.theme-toggle) {
    background: #24364e !important;
    color: #f8fbff !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
  }

  body.theme-dark :is(.primary, .btn-primary, .primary-action, .save-button) {
    background: #1684ff !important;
    color: #ffffff !important;
  }

  body.theme-dark :is(.danger, .danger-button, .delete-button) {
    background: #991b1b !important;
    color: #ffffff !important;
  }

  body.theme-dark :is(button:disabled, .btn:disabled, .button:disabled, .disabled) {
    color: #cbd5e1 !important;
    opacity: 0.72 !important;
  }

  body.theme-dark .bottom-nav {
    background: rgba(5, 10, 18, 0.98) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
  }

  body.theme-dark .bottom-nav :is(button, .nav-item, .bottom-nav-item) {
    background: transparent !important;
    color: #f8fbff !important;
  }

  body.theme-dark .bottom-nav :is(.active, [aria-current="page"]) {
    background: rgba(59, 130, 246, 0.24) !important;
    color: #60a5fa !important;
  }
}

/* V8.73: stabilny, responsywny uklad Material Foundation. */
.app-shell > section,
.app-shell :where(form, label, div, table) {
  min-width: 0;
}

.daily-note-form,
.daily-note-form label,
.daily-note-form textarea,
.daily-note-actions {
  width: 100%;
  max-width: 100%;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout,
  .app-shell.desktop-layout.home-dashboard-layout {
    grid-template-columns: var(--desktop-sidebar-width) repeat(12, minmax(0, 1fr)) !important;
    grid-template-rows: 52px auto !important;
    grid-auto-flow: row !important;
    grid-auto-rows: auto !important;
    column-gap: 14px !important;
    row-gap: 14px !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout > .topbar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot,
  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office,
  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-column: 2 / -1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: static !important;
    align-self: start !important;
    overflow: hidden;
  }

  .app-shell.desktop-layout.home-dashboard-layout .daily-note {
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-row: 6 !important;
  }

  .app-shell.desktop-layout .daily-note-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .app-shell.desktop-layout .daily-note-actions span {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout .daily-note-actions button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .app-shell.desktop-layout .boss-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .app-shell.desktop-layout .boss-history-filters > label,
  .app-shell.desktop-layout .boss-history-filters > label:nth-of-type(3),
  .app-shell.desktop-layout .boss-history-picker,
  .app-shell.desktop-layout .boss-history-filters > .admin-filter-actions {
    grid-column: auto !important;
  }

  .app-shell.desktop-layout .boss-history-picker {
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto) !important;
  }

  .app-shell.desktop-layout .boss-history-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
}

@media (min-width: 1280px) {
  .app-shell.desktop-layout.home-dashboard-layout .daily-note,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.home-dashboard-layout #activeWorkOrdersPanel.boss-pending-home-slot,
  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-column: 2 / span 4 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel,
  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-column: 6 / -1 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #bossDashboardPanel {
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout .deadline-alerts.deadline-alerts-office {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout #summaryPanel,
  .app-shell.desktop-layout.home-dashboard-layout .summary-card {
    grid-row: 4 !important;
  }
}

@media (min-width: 1600px) {
  .app-shell.desktop-layout .boss-history-filters {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  .app-shell.desktop-layout .boss-history-filters > label {
    grid-column: span 2 !important;
  }

  .app-shell.desktop-layout .boss-history-filters > label:nth-of-type(3) {
    grid-column: span 3 !important;
  }

  .app-shell.desktop-layout .boss-history-picker {
    grid-column: span 3 !important;
  }

  .app-shell.desktop-layout .boss-history-filters > .admin-filter-actions {
    grid-column: span 2 !important;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 64px;
    gap: 6px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .hamburger-button {
    width: 40px;
    height: 40px;
  }

  .topbar-title h1 {
    font-size: clamp(0.86rem, 4.2vw, 1rem);
  }

  .topbar-title .user-button {
    max-width: 100%;
    font-size: 0.62rem;
  }

  .theme-toggle-button,
  .sound-toggle-button,
  .top-logout-icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 11px;
    font-size: 0;
  }

  .theme-toggle-button::after {
    content: "☾";
    font-size: 1rem;
  }

  .theme-toggle-button[aria-pressed="true"]::after {
    content: "☀";
  }

  .top-logout-icon-button::after {
    content: "↪";
    font-size: 1.05rem;
    font-weight: 900;
  }

  .panel,
  .daily-note,
  .history-section,
  .admin-panel,
  .summary-card {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .daily-note-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .daily-note-actions button {
    width: 100%;
    min-width: 0;
  }

  .bottom-nav {
    right: 8px;
    left: 8px;
    width: calc(100% - 16px);
    min-height: 70px;
    border-radius: 22px;
  }

  .bottom-nav-item {
    min-height: 54px;
    border-radius: 17px;
    font-size: 0.66rem;
  }
}

/* Finalne nadpisania V8.88 musza pozostac na koncu arkusza. */
.side-nav-group,
.side-admin-nav-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.side-nav-group + .side-nav-group {
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
}

.side-nav-group[hidden],
.side-admin-nav-group[hidden] {
  display: none;
}

.side-nav-group-label,
.side-admin-nav-group > p {
  margin: 0;
  padding: 3px 10px 4px;
  color: #718199;
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.side-nav-admin-group {
  margin-top: 10px !important;
  padding-top: 11px !important;
  border-top-color: rgba(59, 130, 246, 0.26) !important;
}

.side-admin-shortcuts {
  gap: 10px;
  margin: 4px 0 7px 12px;
  padding: 7px 0 7px 11px;
}

.side-admin-nav-group + .side-admin-nav-group {
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.11);
}

.side-admin-nav-group > p {
  padding-left: 8px;
  color: #7f92aa;
  font-size: 0.54rem;
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.24);
}

.admin-user-create-panel {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-create-heading,
.admin-user-panel-heading,
.admin-user-card-header {
  display: flex;
  align-items: center;
}

.admin-user-create-heading,
.admin-user-panel-heading {
  gap: 10px;
}

.admin-user-create-heading strong,
.admin-user-panel-heading h4 {
  display: block;
  margin: 0;
  color: #f8fafc;
  font-size: 0.85rem;
}

.admin-user-create-heading small,
.admin-user-panel-heading p {
  display: block;
  margin: 3px 0 0;
  color: #8fa1b8;
  font-size: 0.68rem;
}

.admin-user-create-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.25fr) minmax(180px, 1fr);
  gap: 10px;
}

.admin-user-create-fields input {
  width: 100%;
}

.admin-user-create-access .role-checkbox-grid,
.admin-user-role-panel .role-checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-user-create-submit {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.admin-user-create-submit p {
  margin: 0 auto 0 0;
  color: #8496ad;
  font-size: 0.68rem;
}

.admin-user-create-submit .primary-button {
  min-width: 230px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 12px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(15, 23, 42, 0.26);
}

.admin-user-card-header {
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.14), rgba(15, 23, 42, 0.05));
}

.admin-user-login {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 5px 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: #a9b9cc !important;
  background: rgba(15, 23, 42, 0.28);
  font-size: 0.65rem !important;
  font-weight: 800;
}

.admin-user-card-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.35fr);
  gap: 12px;
  padding: 0 14px 14px;
}

.admin-user-card-panel,
.admin-user-danger-zone {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-card-panel h4 {
  margin: 0 0 10px;
  color: #e8eef7;
  font-size: 0.75rem;
}

.admin-user-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.admin-user-facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, auto);
  gap: 10px;
}

.admin-user-facts dt {
  color: #8597ad;
  font-size: 0.66rem;
}

.admin-user-facts dd {
  margin: 0;
  color: #e6edf7;
  font-size: 0.68rem;
  font-weight: 850;
  text-align: right;
}

.admin-user-role-panel .role-checkbox-grid {
  margin-top: 12px;
}

.admin-user-role-panel .role-checkbox-grid button {
  min-height: 38px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 8px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
  font-size: 0.68rem;
  font-weight: 850;
}

.admin-user-access-panel,
.admin-user-danger-zone {
  grid-column: 1 / -1;
}

.admin-user-access-panel .admin-user-actions,
.admin-user-danger-actions {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  margin-top: 12px;
}

.admin-user-danger-zone {
  padding: 0;
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(127, 29, 29, 0.08);
}

.admin-user-danger-zone summary {
  padding: 12px 14px;
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 900;
}

.admin-user-danger-zone > p,
.admin-user-danger-actions {
  padding-right: 14px;
  padding-left: 14px;
}

.admin-user-danger-zone > p {
  margin: 0;
  padding-bottom: 4px;
  color: #a99aa0;
  font-size: 0.66rem;
}

.admin-user-danger-actions {
  padding-bottom: 14px;
}

body.theme-light .admin-user-form,
body.theme-light .admin-user-row {
  border-color: #d9e3ef;
  background: #f8fafc;
}

body.theme-light .admin-user-create-panel,
body.theme-light .admin-user-card-panel {
  border-color: #dde6f0;
  background: #ffffff;
}

body.theme-light .admin-user-create-heading strong,
body.theme-light .admin-user-panel-heading h4,
body.theme-light .admin-user-card-panel h4,
body.theme-light .admin-user-facts dd {
  color: #172033;
}

body.theme-light .admin-user-card-header {
  border-bottom-color: #dce6f1;
  background: linear-gradient(135deg, #edf5ff, #f8fbff);
}

@media (max-width: 1100px) {
  .admin-user-form,
  .admin-user-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-create-submit,
  .admin-user-access-panel,
  .admin-user-danger-zone {
    grid-column: auto;
  }

  .admin-user-create-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .admin-user-create-access .role-checkbox-grid,
  .admin-user-role-panel .role-checkbox-grid,
  .admin-user-access-panel .admin-user-actions,
  .admin-user-danger-actions {
    grid-template-columns: 1fr;
  }

  .admin-user-create-submit,
  .admin-user-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-user-create-submit .primary-button {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1101px) {
  .admin-user-create-fields {
    grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1.2fr);
  }

  .admin-user-create-fields > label:nth-child(3) {
    grid-column: 1 / -1;
  }
}

body.theme-light .boss-role-option {
  border-color: #bfdbfe;
  color: #174d8d !important;
  background: #eff6ff;
}

body.theme-light .admin-user-role-panel .role-checkbox-grid button {
  border-color: #a9cbee;
  color: #0b5fc3;
  background: #eaf3ff;
}

body.theme-light .admin-user-role-panel .role-checkbox-grid button:hover,
body.theme-light .admin-user-role-panel .role-checkbox-grid button:focus-visible {
  color: #ffffff;
  background: #1479f7;
}

/* V8.89 - etap przejsciowy UI operacyjnego: analityka Leadera i uporzadkowane moduly */
:root {
  --opsui-page-max: 1440px;
  --opsui-surface: #121c2a;
  --opsui-surface-muted: #172234;
  --opsui-surface-raised: #1b293a;
  --opsui-border: #33445c;
  --opsui-border-strong: #40536d;
  --opsui-text: #eef5ff;
  --opsui-muted: #91a3ba;
  --opsui-primary: #4f9bff;
  --opsui-primary-soft: #142b4d;
  --opsui-field: #66a93e;
  --opsui-signal: #19b5bf;
  --opsui-radius: 8px;
  --opsui-radius-small: 6px;
}

body.theme-light {
  --opsui-surface: #ffffff;
  --opsui-surface-muted: #f8fbff;
  --opsui-surface-raised: #eef2f6;
  --opsui-border: #dce4ee;
  --opsui-border-strong: #c6d3e1;
  --opsui-text: #101722;
  --opsui-muted: #627186;
  --opsui-primary: #1479f7;
  --opsui-primary-soft: #e9f3ff;
  --opsui-field: #4f8a2f;
  --opsui-signal: #0e9aa7;
}

.leader-analytics-panel {
  width: min(100%, var(--opsui-page-max));
  min-width: 0;
  margin-inline: auto;
  padding: clamp(16px, 2vw, 26px);
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: 0 16px 40px rgba(4, 12, 24, 0.16);
}

.opsui-panel-header,
.opsui-card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.opsui-panel-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--opsui-border);
}

.opsui-panel-header h2,
.opsui-card-heading h3 {
  margin: 0;
  color: var(--opsui-text);
}

.opsui-panel-header h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  letter-spacing: -0.025em;
}

.opsui-panel-header > div > p:last-child,
.opsui-card-heading p {
  margin: 5px 0 0;
  color: var(--opsui-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.leader-analytics-period {
  display: grid;
  width: min(220px, 100%);
  min-width: 0;
  flex: 0 0 min(220px, 100%);
  gap: 6px;
  color: var(--opsui-muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leader-analytics-period input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border-color: var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

.leader-available-team {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(34, 197, 94, 0.44);
  border-radius: var(--opsui-radius);
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.34), rgba(6, 78, 59, 0.14)),
    var(--opsui-surface-muted);
}

.leader-available-team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(74, 222, 128, 0.25);
}

.leader-available-team-heading h3 {
  margin: 2px 0 0;
  color: var(--opsui-text);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
}

.leader-available-team-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--opsui-muted);
  font-size: 0.78rem;
}

.leader-available-technicians-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.leader-available-technicians-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 12px;
  align-items: start;
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid #18794e;
  border-radius: var(--opsui-radius);
  color: #ecfdf5;
  background: linear-gradient(135deg, #065f46, #064e3b);
  box-shadow: 0 8px 20px rgba(6, 78, 59, 0.18);
}

.leader-available-technicians-list article i {
  grid-row: 1 / span 3;
  margin-top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.16);
}

.leader-technician-location-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leader-available-technicians-list article strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.leader-available-technicians-list article b {
  color: #f0fdf4;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.leader-available-technicians-list article small {
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 750;
}

.leader-technician-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(187, 247, 208, 0.34);
  border-radius: 999px;
  color: #dcfce7;
  background: rgba(6, 95, 70, 0.54);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leader-available-technicians-list article.is-assigned {
  border-color: #2563eb;
  background: linear-gradient(135deg, #1e3a8a, #172554);
}

.leader-available-technicians-list article.is-assigned i {
  background: #60a5fa;
  box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.16);
}

.leader-available-technicians-list article.is-vacation,
.leader-available-technicians-list article.is-available {
  border-color: var(--opsui-border-strong);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: none;
}

.leader-available-technicians-list article.is-vacation i,
.leader-available-technicians-list article.is-available i {
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.14);
}

.leader-available-technicians-list article.is-vacation b,
.leader-available-technicians-list article.is-available b {
  color: var(--opsui-text);
}

.leader-available-technicians-list article.is-vacation small,
.leader-available-technicians-list article.is-available small {
  color: var(--opsui-muted);
}

.leader-available-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--opsui-border-strong);
  border-radius: var(--opsui-radius);
  color: var(--opsui-muted);
  background: var(--opsui-surface);
  text-align: center;
}

body.theme-light .leader-available-team {
  border-color: #86d7a5;
  background:
    linear-gradient(135deg, rgba(220, 252, 231, 0.9), rgba(240, 253, 244, 0.68)),
    var(--opsui-surface-muted);
}

.leader-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.leader-kpi-grid article,
.leader-signature-score article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.leader-kpi-grid article {
  position: relative;
  overflow: hidden;
}

.leader-kpi-grid article::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--opsui-primary);
  content: "";
}

.leader-kpi-grid article:nth-child(2)::before {
  background: var(--opsui-field);
}

.leader-kpi-grid article:nth-child(3)::before {
  background: var(--opsui-signal);
}

.leader-kpi-grid article:nth-child(4)::before {
  background: #f2a93b;
}

.leader-kpi-grid span,
.leader-signature-score span {
  display: block;
  color: var(--opsui-muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.leader-kpi-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--opsui-text);
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.05;
}

.leader-kpi-grid small,
.leader-signature-score small {
  display: block;
  margin-top: 7px;
  color: var(--opsui-muted);
  font-size: 0.68rem;
}

.leader-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 12px;
}

.opsui-data-card {
  min-width: 0;
  margin: 0;
  padding: 17px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.opsui-card-heading {
  margin-bottom: 15px;
}

.opsui-card-heading h3 {
  font-size: 0.94rem;
}

.opsui-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--opsui-primary) 52%, transparent);
  border-radius: 999px;
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.opsui-status-pill.signal,
.opsui-status-pill.winner-np {
  border-color: color-mix(in srgb, var(--opsui-signal) 55%, transparent);
  color: var(--opsui-signal);
}

.opsui-status-pill.winner-oc {
  border-color: color-mix(in srgb, var(--opsui-field) 55%, transparent);
  color: var(--opsui-field);
}

.leader-ranking-list {
  display: grid;
  gap: 7px;
}

.leader-ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(70px, auto);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface);
}

.leader-ranking-position,
.leader-table-rank {
  display: inline-grid;
  place-items: center;
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
  font-weight: 900;
}

.leader-ranking-position {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  font-size: 0.67rem;
}

.leader-ranking-main {
  min-width: 0;
}

.leader-ranking-main > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leader-ranking-main strong {
  overflow: hidden;
  color: var(--opsui-text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-ranking-main span,
.leader-ranking-values span {
  color: var(--opsui-muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.leader-ranking-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--opsui-surface-raised);
}

.leader-ranking-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--opsui-primary), var(--opsui-signal));
}

.leader-ranking-values {
  text-align: right;
}

.leader-ranking-values strong {
  display: block;
  color: var(--opsui-text);
  font-size: 0.9rem;
}

.leader-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.leader-turbine-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: var(--opsui-text);
}

.leader-turbine-table th,
.leader-turbine-table td {
  padding: 10px;
  border-bottom: 1px solid var(--opsui-border);
  text-align: left;
  font-size: 0.7rem;
}

.leader-turbine-table th {
  color: var(--opsui-muted);
  background: var(--opsui-surface-raised);
  font-size: 0.61rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leader-turbine-table th:first-child {
  border-radius: 5px 0 0 5px;
}

.leader-turbine-table th:last-child {
  border-radius: 0 5px 5px 0;
}

.leader-turbine-table td:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leader-table-rank {
  width: 23px;
  height: 23px;
  border-radius: 4px;
  font-size: 0.6rem;
}

.leader-signature-competition {
  margin-top: 12px;
}

.leader-signature-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.leader-signature-score article:first-child {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  border-left: 3px solid var(--opsui-field);
}

.leader-signature-score article:last-child {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  border-left: 3px solid var(--opsui-signal);
}

.leader-signature-score strong {
  display: block;
  margin-top: 7px;
  color: var(--opsui-text);
  font-size: 1.35rem;
}

.leader-versus {
  display: grid;
  place-items: center;
  color: var(--opsui-muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.leader-signature-timeline {
  display: grid;
  gap: 6px;
}

.leader-signature-timeline article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(90px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface);
}

.leader-signature-timeline article > div:first-child {
  min-width: 0;
}

.leader-signature-timeline strong,
.leader-signature-timeline span,
.leader-signature-timeline small,
.leader-signature-timeline b {
  display: block;
}

.leader-signature-timeline strong {
  overflow: hidden;
  color: var(--opsui-text);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-signature-timeline span,
.leader-signature-timeline small {
  margin-top: 3px;
  color: var(--opsui-muted);
  font-size: 0.61rem;
}

.leader-signature-timeline b {
  margin-top: 2px;
  color: var(--opsui-text);
  font-size: 0.75rem;
}

.opsui-empty-state,
.opsui-empty-cell {
  padding: 22px;
  color: var(--opsui-muted);
  font-size: 0.74rem;
  text-align: center;
}

/* Modul CERT - czytelna selekcja zamiast rozciagnietych wierszy. */
#adminPanel {
  width: 100%;
  min-width: 0;
}

#adminPanel > .admin-heading,
#adminPanel > .admin-toolbar,
#adminPanel > .admin-summary,
#adminPanel > .admin-users,
#adminPanel > .empty-state,
#adminPanel > .admin-entries-list {
  width: min(100%, var(--opsui-page-max));
  margin-right: auto;
  margin-left: auto;
}

#adminPanel > .admin-heading,
#adminPanel > .admin-toolbar,
#adminPanel > .admin-users {
  border-radius: var(--opsui-radius);
}

#adminPanel > .admin-toolbar {
  display: block;
  padding: 16px;
  border-color: var(--opsui-border);
  background: var(--opsui-surface);
}

#adminPanel .admin-user-filter-label {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 10px;
  color: var(--opsui-muted);
}

#adminPanel .admin-user-filter-label > input[type="search"] {
  width: 100%;
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

#adminPanel .admin-user-filter-label > .admin-picker-row {
  grid-template-columns: minmax(220px, 1fr);
  margin: 0;
}

#adminPanel .admin-selected-users {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 8px;
}

#adminPanel .admin-selected-users .collaborator-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name action"
    "login action";
  min-width: 0;
  min-height: 58px;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

#adminPanel .admin-selected-users .collaborator-chip b {
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminPanel .admin-selected-users .collaborator-chip small {
  grid-area: login;
  overflow: hidden;
  color: var(--opsui-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminPanel .admin-selected-users .collaborator-chip button {
  grid-area: action;
  position: static;
  width: auto;
  min-width: 60px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #e0565b 55%, transparent);
  border-radius: 5px;
  color: #ffb4b8;
  background: rgba(153, 27, 31, 0.18);
  font-size: 0.66rem;
  font-weight: 850;
}

body.theme-light #adminPanel .admin-selected-users .collaborator-chip button {
  color: #a31d25;
  background: #fff1f2;
}

#adminPanel .admin-user-filter-label > .admin-filter-actions {
  grid-template-columns: repeat(2, minmax(150px, 220px));
  justify-content: start;
  margin: 0;
}

#adminPanel .admin-cert-range {
  grid-template-columns: repeat(2, minmax(190px, 260px));
  justify-content: start;
  margin: 0;
}

/* Polecenie pracy - szerokosc robocza i sekcje zgodne z UI operacyjnego. */
#workOrderPanel {
  width: min(100%, var(--opsui-page-max));
  margin-inline: auto;
  padding: clamp(16px, 2vw, 24px);
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
}

#workOrderPanel > .section-title {
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--opsui-border);
}

#workOrderForm {
  display: grid;
  max-width: 1320px;
  margin-inline: auto;
  gap: 12px;
}

#workOrderForm > label,
#workOrderForm .work-time-range,
#workOrderForm .farm-field,
#workOrderForm .work-order-users,
#workOrderForm .work-order-guests {
  min-width: 0;
}

#workOrderForm input,
#workOrderForm select,
#workOrderForm textarea {
  min-height: 44px;
  border-color: var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
}

#workOrderForm .work-time-range {
  gap: 12px;
}

#workOrderForm .farm-field {
  align-items: end;
}

#workOrderForm .favorite-button,
#workOrderForm .secondary-button {
  border-radius: var(--opsui-radius-small);
}

#workOrderForm .single-action-option,
#workOrderForm .work-order-users,
#workOrderForm .work-order-guests {
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

#workOrderForm .work-order-users legend,
#workOrderForm .work-order-guests legend {
  color: var(--opsui-text);
}

#workOrderForm .work-order-submit-hint {
  margin: 2px 0 -4px;
  padding: 10px 12px;
  border-left: 3px solid var(--opsui-primary);
  color: var(--opsui-muted);
  background: var(--opsui-primary-soft);
}

#workOrderForm > button[type="submit"] {
  min-height: 46px;
  border-radius: var(--opsui-radius-small);
}

/* Farmy i turbiny - zwarta siatka kart zamiast pustych pelnych wierszy. */
#adminFarmManagement {
  padding: clamp(16px, 2vw, 22px);
  border-color: var(--opsui-border);
  background: var(--opsui-surface);
}

#adminFarmManagement > .admin-users-heading {
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--opsui-border);
}

#adminFarmManagement .admin-add-farm-form {
  grid-template-columns: minmax(260px, 560px) minmax(150px, 220px);
  max-width: 800px;
  margin-bottom: 12px;
}

#adminFarmManagement .admin-farm-actions {
  display: flex;
  gap: 8px;
}

#adminFarmManagement .admin-farms-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

#adminFarmManagement .admin-farm-row {
  align-content: start;
  min-width: 0;
  padding: 15px;
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

#adminFarmManagement .admin-farm-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#adminFarmManagement .admin-farm-heading h4 {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
}

#adminFarmManagement .admin-farm-row-actions {
  justify-content: flex-end;
}

#adminFarmManagement .admin-farm-row textarea {
  min-height: 82px;
  resize: vertical;
  border-color: var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface);
}

#adminFarmManagement .admin-farm-row small {
  color: var(--opsui-muted);
}

#adminFarmManagement .admin-farm-assignment-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

#adminFarmManagement .admin-farm-assignment-card > summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

#adminFarmManagement .admin-farm-assignment-card > summary::-webkit-details-marker {
  display: none;
}

#adminFarmManagement .admin-farm-assignment-card > summary:focus-visible {
  outline: 3px solid rgba(20, 121, 247, 0.2);
  outline-offset: -3px;
}

.farm-assignment-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #0a5fb8, #1689e8);
  font-weight: 900;
}

.farm-assignment-title,
.farm-assignment-title b,
.farm-assignment-title small {
  display: block;
  min-width: 0;
}

.farm-assignment-title b {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.farm-assignment-title small {
  margin-top: 4px;
  color: var(--opsui-muted);
}

.farm-assignment-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.farm-assignment-counts em {
  padding: 6px 9px;
  border: 1px solid var(--opsui-border);
  border-radius: 999px;
  color: var(--opsui-primary);
  background: var(--opsui-surface);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.farm-assignment-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 0 14px 14px;
}

.farm-assignment-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface);
}

.farm-assignment-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.farm-assignment-panel-head span {
  color: var(--opsui-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.farm-assignment-search {
  width: 100%;
  margin-bottom: 9px;
}

.farm-assignment-options {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
}

.farm-assignment-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--opsui-border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--opsui-surface-muted);
}

.farm-assignment-option:has(input:checked) {
  border-color: var(--opsui-primary);
  background: rgba(20, 121, 247, 0.08);
}

.farm-assignment-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--opsui-primary);
}

.farm-assignment-option span,
.farm-assignment-option b,
.farm-assignment-option small {
  display: block;
  min-width: 0;
}

.farm-assignment-option b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.farm-assignment-option small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--opsui-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#adminFarmManagement .admin-farm-assignment-card > .admin-farm-row-actions {
  padding: 0 14px 14px;
}

.farm-auto-transport {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.farm-auto-transport > button {
  justify-self: start;
}

.farm-transport-warning,
.farm-transport-ok {
  margin: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
}

.farm-transport-warning {
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: #9a5b00;
  background: rgba(245, 158, 11, 0.12);
}

.farm-transport-ok {
  border: 1px solid rgba(22, 163, 74, 0.28);
  color: #047857;
  background: rgba(22, 163, 74, 0.1);
}

.farm-transport-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.farm-transport-rows article {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--opsui-border);
  border-radius: 14px;
  background: var(--opsui-surface-muted);
  padding: 10px 12px;
}

.farm-transport-rows article.is-overflow {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.1);
}

.farm-transport-rows b,
.farm-transport-rows small,
.farm-transport-rows span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.farm-transport-rows small {
  color: var(--opsui-primary);
  font-weight: 900;
}

.farm-transport-rows span {
  color: var(--opsui-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .leader-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leader-analytics-grid,
  #adminFarmManagement .admin-farms-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .leader-analytics-panel,
  #workOrderPanel,
  #adminFarmManagement {
    padding: 14px;
  }

  .opsui-panel-header,
  .opsui-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .leader-analytics-period {
    width: 100%;
    flex-basis: auto;
  }

  .leader-available-team-heading {
    align-items: flex-start;
  }

  .leader-signature-score {
    grid-template-columns: 1fr;
  }

  .leader-versus {
    min-height: 26px;
  }

  .leader-signature-timeline article {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(72px, auto));
  }

  #adminPanel .admin-user-filter-label > .admin-picker-row,
  #adminPanel .admin-cert-range,
  #adminFarmManagement .admin-add-farm-form {
    grid-template-columns: 1fr;
  }

  #adminPanel .admin-user-filter-label > .admin-filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #workOrderForm .work-time-range,
  #workOrderForm .work-order-role-grid {
    grid-template-columns: 1fr;
  }

  #adminFarmManagement .admin-farm-heading {
    flex-direction: column;
  }

  .farm-assignment-body {
    grid-template-columns: 1fr;
  }

  #adminFarmManagement .admin-farm-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  #adminFarmManagement .admin-farm-assignment-card > summary {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .farm-assignment-avatar {
    width: 42px;
    height: 42px;
  }

  .farm-assignment-counts {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  #adminFarmManagement .admin-farm-assignment-card > .admin-farm-row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .leader-analytics-panel {
    width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .leader-analytics-panel .opsui-panel-header {
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .leader-analytics-period input {
    min-height: 42px;
    padding-inline: 10px;
    font-size: 16px;
  }

  .leader-available-team-heading {
    flex-direction: row;
  }

  .leader-available-technicians-list {
    grid-template-columns: 1fr;
  }

  .leader-kpi-grid {
    grid-template-columns: 1fr;
  }

  .leader-signature-timeline article {
    grid-template-columns: 1fr 1fr;
  }

  .leader-signature-timeline article > div:first-child {
    grid-column: 1 / -1;
  }

  .leader-ranking-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .leader-ranking-values {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  #adminPanel .admin-user-filter-label > .admin-filter-actions {
    grid-template-columns: 1fr;
  }

  #adminFarmManagement .admin-farm-row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* V8.90 - jeden standard wizualny we wszystkich modulach TNWIND */
:root {
  --ops-page-width: 1440px;
  --ops-gap: clamp(10px, 1vw, 14px);
  --ops-card-padding: clamp(14px, 1.35vw, 20px);
  --ops-shadow: 0 14px 34px rgba(4, 12, 24, 0.15);
  --ops-danger: #e0565b;
  --ops-warning: #e6a637;
  --ops-success: #61ad3f;
}

body.theme-light {
  --ops-shadow: 0 12px 30px rgba(27, 45, 71, 0.08);
  --ops-danger: #c83e45;
  --ops-warning: #b7791f;
  --ops-success: #168a4a;
}

/* Wspolna szerokosc stron i spokojna hierarchia powierzchni. */
.app-shell > section.app-route-active,
.app-shell > .admin-panel.app-route-active {
  width: min(100%, var(--ops-page-width));
  min-width: 0;
  margin-right: auto;
  margin-left: auto;
}

.app-shell > :is(
  .panel,
  .history-section,
  .summary-card,
  .daily-note,
  .deadline-alerts,
  .admin-panel
) {
  min-width: 0;
}

.panel,
.history-section,
.summary-card,
.daily-note,
.deadline-alerts,
.admin-users,
.admin-toolbar,
.admin-heading,
.admin-summary {
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
}

.panel,
.history-section,
.summary-card,
.daily-note,
.deadline-alerts,
.admin-users {
  background: var(--opsui-surface);
  box-shadow: var(--ops-shadow);
}

.panel,
.history-section,
.admin-users {
  padding: var(--ops-card-padding);
}

.admin-panel {
  padding: 0;
  background: transparent;
}

.section-title,
.admin-users-heading,
.admin-heading,
.analytics-section-heading,
.vehicle-row-heading,
.deadline-alerts-heading {
  min-width: 0;
  margin-bottom: 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--opsui-border);
}

.section-title h2,
.section-title h3,
.admin-users-heading h3,
.admin-heading h2,
.analytics-section-heading h3,
.deadline-alerts-heading h3 {
  margin: 2px 0 0;
  color: var(--opsui-text);
  font-size: clamp(0.95rem, 1.15vw, 1.12rem);
  letter-spacing: -0.015em;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--opsui-primary);
  font-size: 0.61rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.form-hint,
.panel-description,
.analytics-section-heading p,
.admin-users-heading p,
.empty-state p {
  color: var(--opsui-muted);
  line-height: 1.45;
}

/* Formularze: te same pola, etykiety i sekcje w kazdej zakladce. */
.app-shell :is(.panel, .history-section, .admin-panel) form {
  min-width: 0;
}

.app-shell :is(.panel, .history-section, .admin-panel) label {
  min-width: 0;
  color: var(--opsui-muted);
  font-size: 0.69rem;
  font-weight: 850;
}

.app-shell :is(.panel, .history-section, .admin-panel) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea
) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
  font: inherit;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.app-shell :is(.panel, .history-section, .admin-panel) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea
):hover {
  border-color: color-mix(in srgb, var(--opsui-primary) 42%, var(--opsui-border-strong));
}

.app-shell :is(.panel, .history-section, .admin-panel) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea
):focus {
  border-color: var(--opsui-primary);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--opsui-primary) 18%, transparent);
}

.app-shell :is(.panel, .history-section, .admin-panel) textarea {
  min-height: 88px;
  resize: vertical;
}

.app-shell :is(.panel, .history-section, .admin-panel) :is(input, select, textarea)::placeholder {
  color: color-mix(in srgb, var(--opsui-muted) 76%, transparent);
}

.app-shell :is(.panel, .history-section, .admin-panel) :is(
  input[type="checkbox"],
  input[type="radio"]
) {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  margin: 0;
  accent-color: var(--ops-success);
}

.app-shell :is(.panel, .history-section, .admin-panel) input[type="range"] {
  width: 100%;
  min-height: 24px;
  accent-color: var(--opsui-primary);
}

.app-shell :is(.panel, .history-section, .admin-panel) fieldset,
.form-section,
.vehicle-cost-export,
.add-database-box,
.backup-card,
.company-logo-box {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.app-shell :is(.panel, .history-section, .admin-panel) legend {
  padding: 0 7px;
  color: var(--opsui-text);
  font-size: 0.72rem;
  font-weight: 900;
}

/* Przyciski: zwarta wysokosc, jeden czytelny akcent glowny. */
.primary-button,
.export-button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--opsui-primary);
  border-radius: var(--opsui-radius-small);
  color: #fff;
  background: var(--opsui-primary);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--opsui-primary) 24%, transparent);
  font-size: 0.72rem;
  font-weight: 900;
}

.primary-button:hover,
.primary-button:focus-visible,
.export-button:hover,
.export-button:focus-visible {
  border-color: color-mix(in srgb, var(--opsui-primary) 76%, #fff);
  background: color-mix(in srgb, var(--opsui-primary) 84%, #075cc4);
  transform: translateY(-1px);
}

.secondary-button,
.import-file-button,
.edit-inline-button,
.work-order-download-button,
.history-month-arrow,
.favorite-button,
.text-button {
  min-height: 38px;
  border: 1px solid var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-raised);
  box-shadow: none;
  font-size: 0.69rem;
  font-weight: 850;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.import-file-button:hover,
.import-file-button:focus-visible,
.edit-inline-button:hover,
.edit-inline-button:focus-visible,
.work-order-download-button:hover,
.work-order-download-button:focus-visible,
.history-month-arrow:hover,
.history-month-arrow:focus-visible,
.favorite-button:hover,
.favorite-button:focus-visible {
  border-color: var(--opsui-primary);
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
}

.small-button {
  min-height: 34px;
  padding: 7px 11px;
}

.danger-action,
.danger-button,
.delete-user,
.entry-delete-action {
  border-color: color-mix(in srgb, var(--ops-danger) 56%, transparent);
  color: #ffb9bd;
  background: color-mix(in srgb, var(--ops-danger) 17%, transparent);
  box-shadow: none;
}

body.theme-light :is(.danger-action, .danger-button, .delete-user, .entry-delete-action) {
  color: #a51f27;
  background: #fff1f2;
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* Tabele operacyjne: wspolny naglowek i rytm wierszy. */
.app-shell :is(.panel, .history-section, .admin-panel) table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--opsui-text);
}

.app-shell :is(.panel, .history-section, .admin-panel) thead th {
  padding: 10px 11px;
  border-top: 1px solid var(--opsui-border);
  border-bottom: 1px solid var(--opsui-border);
  color: var(--opsui-muted);
  background: var(--opsui-surface-raised);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
}

.app-shell :is(.panel, .history-section, .admin-panel) thead th:first-child {
  border-left: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small) 0 0 var(--opsui-radius-small);
}

.app-shell :is(.panel, .history-section, .admin-panel) thead th:last-child {
  border-right: 1px solid var(--opsui-border);
  border-radius: 0 var(--opsui-radius-small) var(--opsui-radius-small) 0;
}

.app-shell :is(.panel, .history-section, .admin-panel) tbody td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--opsui-border);
  color: var(--opsui-text);
  font-size: 0.7rem;
}

.app-shell :is(.panel, .history-section, .admin-panel) tbody tr {
  transition: background-color 120ms ease;
}

.app-shell :is(.panel, .history-section, .admin-panel) tbody tr:hover {
  background: color-mix(in srgb, var(--opsui-primary) 7%, transparent);
}

.boss-history-table-wrap,
.analytics-table-wrap,
.inventory-table-wrap,
.sms-settings-table-wrap,
.leader-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--opsui-radius);
}

/* Powtarzalne listy wygladaja jak w analityce Leadera. */
:is(
  .vehicle-row,
  .vehicle-item,
  .entry-card,
  .admin-entry,
  .problem-report-item,
  .client-log-item,
  .sms-queue-item,
  .pending-report-card,
  .admin-work-order,
  .vacation-user-day-row,
  .deadline-alert,
  .notebook-item
) {
  min-width: 0;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
}

:is(
  .vehicle-row,
  .vehicle-item,
  .entry-card,
  .admin-entry,
  .problem-report-item,
  .client-log-item,
  .sms-queue-item,
  .pending-report-card,
  .admin-work-order,
  .vacation-user-day-row,
  .deadline-alert,
  .notebook-item
):hover {
  border-color: color-mix(in srgb, var(--opsui-primary) 42%, var(--opsui-border));
  background: color-mix(in srgb, var(--opsui-primary) 5%, var(--opsui-surface-muted));
}

.vehicle-list,
.tool-list,
.admin-work-orders-list,
.admin-problem-reports-list,
.notebook-list,
.sms-queue-list,
.client-logs-list,
.vacation-user-days-list {
  display: grid;
  gap: 8px;
}

.date-tile,
.admin-panel-icon,
.inventory-table .inventory-name::before {
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
}

.type-badge,
.presence-badge,
.deadline-status,
.admin-badge,
.role-badge,
.expense-meta-pill {
  border: 1px solid var(--opsui-border-strong);
  border-radius: 999px;
  color: var(--opsui-muted);
  background: var(--opsui-surface-raised);
  box-shadow: none;
}

/* KPI, statystyki i podsumowania we wszystkich rolach. */
.admin-summary,
.boss-metrics,
.summary-grid,
.statistics-card-grid,
.analytics-kpis,
.client-summary-grid {
  gap: var(--ops-gap);
}

.admin-summary > div,
.boss-metrics > div,
.summary-grid > div,
.statistics-card,
.analytics-kpi-card,
.client-insight-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
}

.admin-summary > div::before,
.boss-metrics > div::before,
.summary-grid > div::before,
.statistics-card::before,
.analytics-kpi-card::before,
.client-insight-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--opsui-primary);
  content: "";
}

.admin-summary > div:nth-child(2)::before,
.boss-metrics > div:nth-child(2)::before,
.summary-grid > div:nth-child(2)::before {
  background: var(--ops-success);
}

.admin-summary > div:nth-child(3)::before,
.boss-metrics > div:nth-child(3)::before,
.summary-grid > div:nth-child(3)::before {
  background: var(--opsui-signal);
}

.admin-summary span,
.boss-metrics span,
.summary-grid span,
.statistics-card span,
.analytics-kpi-card span,
.client-insight-card span {
  color: var(--opsui-muted);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.admin-summary b,
.boss-metrics b,
.summary-grid b,
.statistics-card strong,
.analytics-kpi-card strong,
.client-insight-card strong {
  color: var(--opsui-text);
}

/* Zakladki, filtry i przelaczniki zakresow. */
.boss-dashboard-tabs,
.analytics-tabs,
.analytics-range,
.work-hours-tabs,
.history-view-toggle {
  padding: 4px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

:is(
  .boss-dashboard-tab,
  .analytics-tab,
  .analytics-range-button,
  .work-hours-tab,
  .history-view-button
) {
  min-height: 36px;
  border: 0;
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.69rem;
  font-weight: 900;
}

:is(
  .boss-dashboard-tab,
  .analytics-tab,
  .analytics-range-button,
  .work-hours-tab,
  .history-view-button
).active {
  color: #fff;
  background: var(--opsui-primary);
  box-shadow: 0 6px 15px color-mix(in srgb, var(--opsui-primary) 22%, transparent);
}

/* Kalendarze i dostepnosc. */
.history-month-nav,
.vacation-month-nav,
.history-user-filter,
.boss-history-filters,
.analytics-filter-bar,
.work-order-bulk-tools {
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.calendar-weekdays {
  color: var(--opsui-muted);
  background: var(--opsui-surface-raised);
  border-radius: var(--opsui-radius-small);
}

.calendar-day {
  min-height: 42px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: var(--opsui-primary);
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
}

.calendar-day.selected,
.calendar-day.complete {
  border-color: var(--opsui-primary);
  color: #fff;
  background: var(--opsui-primary);
}

.calendar-day.has-vacation {
  border-color: var(--ops-warning);
}

/* Moduly zasobow, ustawien i analityki. */
.vehicle-content,
.analytics-section,
.client-ranking-section,
.analytics-chart-section,
.coordinator-leader-card,
.admin-user-card-panel,
.admin-user-create-panel {
  min-width: 0;
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

.analytics-section,
.client-ranking-section,
.analytics-chart-section {
  padding: 15px;
}

.analytics-chart-bar,
.client-ranking-bar,
.analytics-progress-bar {
  overflow: hidden;
  border-radius: 3px;
  background: var(--opsui-surface-raised);
}

.analytics-chart-bar > i,
.client-ranking-bar > i,
.analytics-progress-bar > i {
  background: linear-gradient(90deg, var(--opsui-primary), var(--opsui-signal));
}

.role-checkbox-grid label,
.sms-toggle,
.coordinator-technician-row {
  min-width: 0;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
}

.role-checkbox-grid input,
.sms-toggle input,
.coordinator-technician-row input {
  width: 20px !important;
  min-height: 20px !important;
  accent-color: var(--ops-success);
}

/* Puste stany i komunikaty maja te sama forme. */
.empty-state,
.empty-order-list,
.opsui-empty-state,
.tnwind-empty-state {
  min-width: 0;
  padding: 22px;
  border: 1px dashed var(--opsui-border-strong);
  border-radius: var(--opsui-radius);
  color: var(--opsui-muted);
  background: color-mix(in srgb, var(--opsui-surface-muted) 78%, transparent);
  text-align: center;
}

.error-message:not(:empty),
.form-error:not(:empty),
.auth-error:not(:empty) {
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--ops-danger) 45%, transparent);
  border-radius: var(--opsui-radius-small);
  color: #ffb9bd;
  background: color-mix(in srgb, var(--ops-danger) 12%, transparent);
}

body.theme-light :is(.error-message:not(:empty), .form-error:not(:empty), .auth-error:not(:empty)) {
  color: #a51f27;
  background: #fff1f2;
}

/* Dialogi i podpisy zachowuja ten sam standard paneli. */
dialog,
.login-dialog,
.update-info-dialog {
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: 0 24px 70px rgba(2, 8, 23, 0.36);
}

.signature-canvas,
.guest-signature-canvas {
  border: 1px dashed var(--opsui-border-strong);
  border-radius: var(--opsui-radius);
}

/* Glowne widoki nie rozciagaja zawartosci na wielkich monitorach. */
#newReportPanel,
#signaturePanel,
#vehiclePanel,
#toolsPanel,
#ppePanel,
#trainingPanel,
#expensesPanel,
#workHoursPanel,
#certPanel,
#historyPanel,
#vacationPanel,
#notebookPanel,
#problemPanel,
#bossDashboardPanel,
#activeWorkOrdersPanel,
#leaderAnalyticsPanel {
  width: min(100%, var(--ops-page-width));
  margin-right: auto;
  margin-left: auto;
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: var(--ops-shadow);
}

#dailyNote,
#summaryPanel,
#deadlineAlerts {
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: var(--ops-shadow);
}

@media (min-width: 1181px) {
  .vehicle-form:not(.tool-form):not(.work-hours-form):not(.notebook-form),
  .tool-form,
  .work-hours-form {
    gap: 12px;
  }

  .admin-users-list,
  .vehicle-list,
  .tool-list {
    align-content: start;
  }
}

@media (max-width: 900px) {
  .panel,
  .history-section,
  .admin-users {
    padding: 14px;
  }

  .boss-history-filters,
  .analytics-filter-bar,
  .work-order-bulk-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-summary,
  .boss-metrics,
  .statistics-card-grid,
  .analytics-kpis,
  .client-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    --ops-card-padding: 12px;
  }

  .section-title,
  .admin-users-heading,
  .admin-heading,
  .analytics-section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .section-title .section-collapse,
  .admin-users-heading .section-collapse {
    width: 100%;
  }

  .admin-heading-actions {
    width: 100%;
    flex-direction: column;
  }

  .admin-heading-actions > button {
    width: 100%;
  }

  .admin-summary,
  .boss-metrics,
  .statistics-card-grid,
  .analytics-kpis,
  .client-summary-grid,
  .boss-history-filters,
  .analytics-filter-bar,
  .work-order-bulk-tools {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .export-button,
  .import-file-button {
    width: 100%;
  }

  .inline-actions,
  .vehicle-item-actions,
  .admin-farm-row-actions,
  .signature-actions,
  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .inline-actions > *,
  .vehicle-item-actions > *,
  .admin-farm-row-actions > *,
  .signature-actions > *,
  .dialog-actions > * {
    width: 100%;
  }

  .leader-turbine-table,
  .inventory-table,
  .analytics-table,
  .boss-history-table {
    min-width: 620px;
  }
}

/* V8.91 — iPhone, pulpit administratora i baza audytowa poleceń */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.app-shell {
  max-width: 100%;
  overflow-x: clip;
}

.top-action-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.top-action-button svg,
.side-utility-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.side-utility-button,
.side-logout-button {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-utility-button .side-utility-icon {
  color: #1479f7;
}

.side-logout-button {
  justify-content: center;
}

.side-logout-button .side-utility-icon {
  color: #fff;
}

.side-utility-button.layout-mode-button .side-utility-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.admin-overview-panel {
  display: grid;
  gap: 14px;
}

.admin-overview-heading,
.admin-overview-card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-overview-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--opsui-border);
}

.admin-overview-heading h2,
.admin-overview-card-heading h3 {
  margin: 2px 0 0;
  color: var(--opsui-text);
}

.admin-overview-heading h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
}

.admin-overview-heading p:last-child {
  margin: 7px 0 0;
  color: var(--opsui-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.admin-live-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ops-success) 40%, var(--opsui-border));
  border-radius: 999px;
  color: var(--ops-success);
  background: color-mix(in srgb, var(--ops-success) 10%, var(--opsui-surface-raised));
  font-size: 0.62rem;
  font-weight: 950;
  white-space: nowrap;
}

.admin-live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ops-success) 16%, transparent);
}

.admin-overview-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.admin-overview-kpi {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 102px;
  align-content: start;
  gap: 5px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  box-shadow: none;
  text-align: left;
}

.admin-overview-kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--opsui-primary);
  content: "";
}

.admin-overview-kpi.tone-good::before {
  background: var(--ops-success);
}

.admin-overview-kpi.tone-warning::before {
  background: var(--ops-warning);
}

.admin-overview-kpi.tone-danger::before {
  background: var(--ops-danger);
}

.admin-overview-kpi span,
.admin-overview-kpi small {
  overflow: hidden;
  color: var(--opsui-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-overview-kpi span {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.admin-overview-kpi strong {
  font-size: 1.6rem;
  line-height: 1;
}

.admin-overview-kpi small {
  font-size: 0.64rem;
}

.admin-overview-kpi:hover,
.admin-overview-kpi:focus-visible {
  border-color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.admin-overview-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.admin-overview-card-heading {
  align-items: center;
  margin-bottom: 13px;
}

.admin-overview-card-heading h3 {
  font-size: 0.93rem;
}

.admin-overview-card-description {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--opsui-muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.admin-overview-audit-card {
  grid-column: 1 / -1;
}

.admin-overview-audit-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.admin-overview-audit-metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: start;
  gap: 6px;
  padding: 13px 13px 12px 16px;
  overflow: hidden;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-raised);
}

.admin-overview-audit-metric::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--opsui-primary);
  content: "";
}

.admin-overview-audit-metric.tone-good::before { background: var(--ops-success); }
.admin-overview-audit-metric.tone-warning::before { background: var(--ops-warning); }
.admin-overview-audit-metric.tone-danger::before { background: var(--ops-danger); }

.admin-overview-audit-metric span,
.admin-overview-audit-metric small {
  color: var(--opsui-muted);
}

.admin-overview-audit-metric span {
  font-size: 0.59rem;
  font-weight: 950;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.admin-overview-audit-metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 1.7vw, 1.38rem);
  line-height: 1.05;
}

.admin-overview-audit-metric small {
  font-size: 0.6rem;
  line-height: 1.35;
}

.admin-overview-role-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.admin-overview-role-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: color-mix(in srgb, var(--opsui-surface-raised) 78%, transparent);
}

.admin-overview-role-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.admin-overview-role-card > header div,
.admin-overview-role-row > span:nth-child(2),
.admin-overview-role-row > strong {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-overview-role-card > header b { font-size: 0.7rem; }
.admin-overview-role-card > header small,
.admin-overview-role-card > header em {
  color: var(--opsui-muted);
  font-size: 0.58rem;
  font-style: normal;
}

.admin-overview-role-card > header em {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--opsui-primary-soft);
  white-space: nowrap;
}

.admin-overview-role-list {
  display: grid;
  gap: 6px;
}

.admin-overview-role-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--opsui-border);
  border-radius: 9px;
  background: var(--opsui-surface-muted);
}

.admin-overview-role-rank {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--opsui-primary);
  background: var(--opsui-primary-soft);
  font-size: 0.64rem;
  font-weight: 950;
}

.admin-overview-role-row b { font-size: 0.65rem; }
.admin-overview-role-row small {
  color: var(--opsui-muted);
  font-size: 0.56rem;
  line-height: 1.35;
}

.admin-overview-role-row > strong {
  justify-items: end;
  color: var(--ops-success);
  font-size: 0.72rem;
  white-space: nowrap;
}

.admin-overview-order-bars,
.admin-overview-activity {
  display: grid;
  gap: 8px;
}

.admin-overview-order-row,
.admin-overview-event {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--opsui-text);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.admin-overview-order-row {
  display: grid;
  gap: 7px;
  padding: 8px 0;
}

.admin-overview-order-row > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.7rem;
}

.admin-overview-order-row > i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--opsui-surface-raised);
}

.admin-overview-order-row > i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ops-warning);
}

.admin-overview-order-row > i em.active {
  background: var(--opsui-primary);
}

.admin-overview-order-row > i em.closed {
  background: var(--ops-success);
}

.admin-overview-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-raised);
}

.admin-overview-event > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ops-success);
}

.admin-overview-event > i.error {
  background: var(--ops-danger);
}

.admin-overview-event span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-overview-event b,
.admin-overview-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-overview-event b {
  font-size: 0.68rem;
}

.admin-overview-event small,
.admin-overview-event em {
  color: var(--opsui-muted);
  font-size: 0.59rem;
  font-style: normal;
}

.client-log-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.client-log-item,
.client-log-item > *,
.client-log-item p,
.client-log-item small,
.problem-report-item {
  min-width: 0;
  max-width: 100%;
}

.client-log-item {
  display: grid;
  width: 100%;
  overflow: hidden;
}

.client-log-item strong,
.client-log-item small,
.client-log-item p {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.client-log-item p {
  margin: 8px 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.69rem;
  line-height: 1.5;
}

.work-order-bulk-tools {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.work-order-database-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.work-order-database-summary > div {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-muted);
}

.work-order-database-summary span {
  color: var(--opsui-muted);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.work-order-database-summary b {
  color: var(--opsui-text);
  font-size: 1.18rem;
}

.work-order-database-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 15px;
  overflow: hidden;
  border-left: 4px solid var(--ops-warning);
}

.work-order-database-card.status-signed {
  border-left-color: var(--opsui-primary);
}

.work-order-database-card.status-closed {
  border-left-color: var(--ops-success);
}

.work-order-database-card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-order-database-card-head > div {
  min-width: 0;
}

.work-order-reference {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--opsui-primary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.67rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.work-order-database-card h4,
.work-order-database-card p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.work-order-database-card h4 {
  color: var(--opsui-text);
  font-size: 0.96rem;
}

.work-order-database-card-head p {
  margin-top: 4px;
  color: var(--opsui-muted);
  font-size: 0.68rem;
}

.work-order-status-badge {
  flex: 0 0 auto;
  max-width: 170px;
  padding: 6px 9px;
  border: 1px solid var(--opsui-border-strong);
  border-radius: 999px;
  color: var(--opsui-text);
  background: var(--opsui-surface-raised);
  font-size: 0.59rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.work-order-database-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.work-order-database-facts > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-raised);
}

.work-order-database-facts span,
.work-order-database-facts small {
  color: var(--opsui-muted);
  font-size: 0.59rem;
}

.work-order-database-facts span {
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-order-database-facts b {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--opsui-text);
  font-size: 0.68rem;
}

.work-order-database-people,
.work-order-database-roles {
  color: var(--opsui-muted);
  font-size: 0.67rem;
  line-height: 1.5;
}

.work-order-database-people b,
.work-order-database-roles b {
  color: var(--opsui-text);
}

.work-order-database-actions {
  align-items: stretch;
}

.work-order-audit-details {
  min-width: 0;
  border-top: 1px solid var(--opsui-border);
}

.work-order-audit-details > summary {
  padding: 12px 0 2px;
  color: var(--opsui-primary);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.work-order-audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.work-order-audit-grid > section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-raised);
}

.work-order-audit-grid h4 {
  margin: 0 0 12px;
  font-size: 0.72rem;
}

.work-order-audit-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-order-audit-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding-bottom: 13px;
}

.work-order-audit-timeline li::before {
  position: absolute;
  top: 9px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  background: var(--opsui-border-strong);
  content: "";
}

.work-order-audit-timeline li:last-child::before {
  display: none;
}

.work-order-audit-timeline li > i {
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--opsui-primary);
}

.work-order-audit-timeline li.tone-good > i,
.work-order-audit-timeline li.tone-closed > i {
  background: var(--ops-success);
}

.work-order-audit-timeline li.tone-warning > i {
  background: var(--ops-warning);
}

.work-order-audit-timeline li.tone-danger > i {
  background: var(--ops-danger);
}

.work-order-audit-timeline li > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.work-order-audit-timeline strong,
.work-order-audit-timeline span,
.work-order-audit-timeline small,
.work-order-audit-logs article > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.work-order-audit-timeline strong {
  font-size: 0.67rem;
}

.work-order-audit-timeline span,
.work-order-audit-timeline small,
.work-order-audit-logs small {
  color: var(--opsui-muted);
  font-size: 0.6rem;
}

.work-order-audit-logs {
  display: grid;
  gap: 7px;
}

.work-order-audit-logs article {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-muted);
}

.work-order-audit-logs strong {
  font-size: 0.65rem;
}

.work-order-audit-logs p {
  margin: 3px 0 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.61rem;
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 900px) {
  .admin-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview-audit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview-grid,
  .admin-overview-role-times,
  .work-order-audit-grid {
    grid-template-columns: 1fr;
  }

  .work-order-database-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-order-bulk-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-order-bulk-tools > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar {
    width: calc(100% + 36px);
    max-width: none;
    margin-right: -18px;
    margin-left: -18px;
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .topbar-title h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-toggle-button::after,
  .top-logout-icon-button::after {
    display: none;
    content: none;
  }

  .theme-toggle-button,
  .sound-toggle-button,
  .top-logout-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .top-action-button svg {
    display: block;
    width: 20px;
    height: 20px;
  }

  .admin-overview-heading,
  .admin-overview-card-heading,
  .work-order-database-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-live-badge,
  .work-order-status-badge {
    align-self: flex-start;
  }

  .admin-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview-audit-metrics {
    grid-template-columns: 1fr;
  }

  .admin-overview-role-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-overview-role-row > strong {
    grid-column: 2;
    justify-items: start;
  }

  .admin-overview-kpi {
    min-height: 94px;
    padding: 12px;
  }

  .admin-overview-kpi strong {
    font-size: 1.35rem;
  }

  .client-log-filters,
  .work-order-bulk-tools,
  .work-order-database-summary,
  .work-order-database-facts {
    grid-template-columns: 1fr;
  }

  .work-order-bulk-tools > button {
    grid-column: auto;
  }

  .work-order-database-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .work-order-database-actions > * {
    width: 100%;
    min-width: 0;
  }

  .client-log-item {
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .topbar {
    width: calc(100% + 20px);
    margin-right: -10px;
    margin-left: -10px;
  }

  .admin-overview-kpis {
    grid-template-columns: 1fr;
  }
}

/* V8.93 final cascade overrides. */
.pl-date-control {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) 44px !important;
  gap: 7px !important;
}

.pl-date-control > .pl-date-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pl-date-control > .pl-date-display {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: center !important;
}

.pl-date-control > .pl-date-picker {
  display: block !important;
  width: 44px !important;
  min-width: 44px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 1px solid var(--opsui-border) !important;
  color: var(--opsui-text) !important;
  background: var(--opsui-surface-muted) !important;
}

.work-order-incomplete-dialog {
  width: min(560px, calc(100vw - 28px)) !important;
  max-width: 560px !important;
  border: 2px solid #dc2626 !important;
  color: #450a0a !important;
  background: #fff7f7 !important;
}

body.theme-dark .work-order-incomplete-dialog {
  color: #fee2e2 !important;
  background: #2b1015 !important;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.admin-home-layout #adminOverviewPanel {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #dailyNote {
    grid-column: 2 / span 6 !important;
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-column: 8 / -1 !important;
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / -1 !important;
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #bossDashboardPanel {
    grid-column: 2 / -1 !important;
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #deadlineAlerts {
    display: none !important;
  }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .app-shell.desktop-layout.admin-home-layout #dailyNote,
  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-column: 2 / -1 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #dailyNote {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #summaryPanel,
  .app-shell.desktop-layout.admin-home-layout .summary-card {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel,
  .app-shell.desktop-layout.admin-home-layout #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.admin-home-layout #bossDashboardPanel {
    grid-row: 6 !important;
  }
}

/* V8.94 FINAL: reguly musza pozostac na koncu arkusza. */
body.theme-light #summaryPanel::after {
  display: none;
}

body.theme-dark .history-calendar .calendar-day.saturday:disabled,
body.theme-dark .history-calendar .calendar-day.saturday {
  border-color: #eab308;
  color: #fef08a;
  background: #3a3112;
}

body.theme-dark .history-calendar .calendar-day:is(.sunday, .holiday):disabled,
body.theme-dark .history-calendar .calendar-day:is(.sunday, .holiday) {
  border-color: #ef4444;
  color: #fecaca;
  background: #3a171b;
}

body.theme-dark .history-calendar .calendar-day.selected {
  color: var(--opsui-text);
  outline: 3px solid rgba(79, 155, 255, 0.46);
  outline-offset: 3px;
}

/* V8.98 FINAL: jedno pole daty otwiera kalendarz aplikacji bez ikony i zatwierdzania. */
.pl-date-control {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.pl-date-control > .pl-date-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pl-date-control > .pl-date-display {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  cursor: pointer !important;
  caret-color: transparent;
  user-select: none;
}

.pl-date-control > .pl-date-picker {
  display: none !important;
}

.pl-calendar-dialog {
  width: min(480px, calc(100vw - 24px));
  max-width: 480px;
  max-height: min(720px, calc(100dvh - 24px));
  margin: auto;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--opsui-border);
  border-radius: 20px;
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: 0 28px 80px rgba(7, 14, 25, 0.34);
  overscroll-behavior: contain;
}

.pl-calendar-dialog::backdrop {
  background: rgba(5, 12, 22, 0.68);
  backdrop-filter: blur(4px);
}

.pl-calendar-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px 52px;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.pl-calendar-header strong {
  color: var(--opsui-text);
  font-size: 1.08rem;
  text-align: center;
}

.pl-calendar-header button {
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border: 1px solid var(--opsui-border);
  border-radius: 13px;
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  font-size: 1.55rem;
  font-weight: 900;
}

.pl-calendar-header button:disabled {
  opacity: 0.36;
}

.pl-calendar-close {
  color: var(--danger) !important;
}

.pl-calendar-weekdays,
.pl-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.pl-calendar-weekdays {
  margin-bottom: 8px;
}

.pl-calendar-weekdays span {
  padding: 6px 0;
  color: var(--opsui-text-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.pl-calendar-day {
  min-width: 0;
  min-height: 50px;
  padding: 0;
  border: 1px solid var(--opsui-border);
  border-radius: 12px;
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  font-size: 1rem;
  font-weight: 900;
}

.pl-calendar-empty {
  min-width: 0;
  min-height: 50px;
}

.pl-calendar-day:hover,
.pl-calendar-day:focus-visible {
  border-color: var(--opsui-primary);
  color: var(--opsui-primary);
  outline: 3px solid rgba(20, 121, 247, 0.18);
  outline-offset: 1px;
}

.pl-calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--opsui-primary);
}

.pl-calendar-day.selected {
  border-color: var(--opsui-primary);
  color: #ffffff;
  background: var(--opsui-primary);
}

.pl-calendar-day.saturday {
  border-color: #eab308;
}

.pl-calendar-day.sunday {
  border-color: #ef4444;
}

.pl-calendar-day:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

body.theme-dark .pl-calendar-dialog {
  color: #f8fbff;
  background: #101b2a;
}

body.theme-dark .pl-calendar-header button,
body.theme-dark .pl-calendar-day {
  color: #f8fbff;
  background: #18283d;
}

@media (min-width: 700px) and (max-width: 1199px) {
  .pl-calendar-dialog {
    width: min(560px, calc(100vw - 40px));
    max-width: 560px;
    padding: 24px;
  }

  .pl-calendar-day {
    min-height: 58px;
    font-size: 1.08rem;
  }

  .pl-calendar-empty {
    min-height: 58px;
  }

  .pl-calendar-weekdays span {
    font-size: 0.9rem;
  }
}

@media (max-width: 430px) {
  .pl-calendar-dialog {
    padding: 13px;
    border-radius: 16px;
  }

  .pl-calendar-header {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    gap: 5px;
  }

  .pl-calendar-header button {
    min-width: 44px;
    min-height: 46px;
  }

  .pl-calendar-days {
    gap: 5px;
  }

  .pl-calendar-day {
    min-height: 44px;
    border-radius: 10px;
  }

  .pl-calendar-empty {
    min-height: 44px;
  }
}

/* V8.99 FINAL: pelna szerokosc tras roboczych i naglowka tabletowego. */
@media (min-width: 980px) {
  .app-shell.desktop-layout.route-mode-active > #expensesPanel.app-route-active,
  .app-shell.desktop-layout.route-mode-active > #historyPanel.app-route-active,
  .app-shell.desktop-layout.route-mode-active > #vacationPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #expensesPanel.app-route-active,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #historyPanel.app-route-active,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #vacationPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 600px) and (max-width: 1199px) {
  body:not(.desktop-layout-active) .app-shell {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  body:not(.desktop-layout-active) .app-shell > .topbar {
    box-sizing: border-box !important;
    width: 100vw !important;
    width: 100dvw !important;
    max-width: none !important;
    margin-right: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50dvw) !important;
    margin-left: calc(50% - 50vw) !important;
    margin-left: calc(50% - 50dvw) !important;
    border-radius: 0 !important;
  }
}

/* V9.00 - konto PRACOWNIK, rejestracja czasu i czytelna dostepnosc */
.fleet-subsection {
  overflow: hidden;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 16px;
  background: var(--opsui-surface-soft, rgba(148, 163, 184, 0.08));
}

.fleet-subsection > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.fleet-subsection > summary::-webkit-details-marker {
  display: none;
}

.fleet-subsection > summary::after {
  content: "+";
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #1479f7;
}

.fleet-subsection[open] > summary::after {
  content: "−";
}

.fleet-subsection > summary small {
  margin-left: auto;
  color: var(--opsui-muted, #64748b);
}

.fleet-subsection > :not(summary) {
  margin: 0 16px 16px;
}

.boss-available-workers-panel,
.employee-overview-panel,
.employee-time-panel {
  width: min(100%, var(--ops-page-width, 1480px));
  margin-inline: auto;
}

.available-workers-count,
.employee-time-live {
  display: inline-grid;
  min-width: 42px;
  min-height: 34px;
  padding: 6px 12px;
  place-items: center;
  border: 1px solid #166534;
  border-radius: 999px;
  color: #dcfce7;
  background: #14532d;
  font-weight: 900;
}

.available-workers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.available-workers-list article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #166534;
  border-radius: 14px;
  color: #ecfdf5;
  background: #064e3b;
  box-shadow: 0 10px 24px rgba(6, 78, 59, 0.2);
}

.available-workers-list article i {
  grid-row: 1 / span 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.16);
}

.available-workers-list article strong {
  font-size: 1.02rem;
}

.available-workers-list article span {
  color: #bbf7d0;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.available-workers-list article.is-inactive,
.available-workers-list article.is-vacation {
  border-color: var(--opsui-border-strong, #94a3b8);
  color: var(--opsui-text, #e2e8f0);
  background: var(--opsui-surface-muted, #172033);
  box-shadow: none;
}

.available-workers-list article.is-inactive i,
.available-workers-list article.is-vacation i {
  background: #94a3b8;
  box-shadow: 0 0 0 6px rgba(148, 163, 184, 0.14);
}

.available-workers-list article.is-inactive span,
.available-workers-list article.is-vacation span {
  color: var(--opsui-muted, #94a3b8);
}

.available-workers-list article.is-online {
  border-color: #2563eb;
  background: #172554;
}

.available-workers-list article.is-online i {
  background: #60a5fa;
  box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.16);
}

.employee-kpi-grid,
.boss-employee-hours-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.employee-kpi-grid article,
.boss-employee-hours-summary article {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-left: 5px solid #1479f7;
  border-radius: 14px;
  background: var(--opsui-surface-soft, rgba(148, 163, 184, 0.08));
}

.employee-kpi-grid article span,
.boss-employee-hours-summary article span {
  color: var(--opsui-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.employee-kpi-grid article strong,
.boss-employee-hours-summary article strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.employee-current-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #94a3b8;
  border-radius: 14px;
}

.employee-current-status.working {
  color: #ecfdf5;
  border-color: #166534;
  background: #064e3b;
}

.employee-time-clock {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(24px, 6vw, 64px);
  text-align: center;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 22px;
  background: var(--opsui-surface-soft, rgba(148, 163, 184, 0.08));
}

.employee-time-clock > strong {
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.employee-time-action {
  width: min(100%, 380px);
  min-height: 88px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 1000;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
}

.employee-time-action.start {
  background: #166534;
}

.employee-time-action.stop {
  background: #b91c1c;
}

.employee-time-live.active {
  animation: employee-live-pulse 1.5s ease-in-out infinite;
}

@keyframes employee-live-pulse {
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.16); }
}

.employee-time-today,
.employee-work-hours-view,
.boss-employee-hours {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.employee-time-today article {
  display: grid;
  gap: 5px;
  padding: 15px 18px;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 14px;
}

.boss-employee-hours-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.boss-employee-rate-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.boss-employee-rate-form > .form-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.marker-employee-time {
  background: #14b8a6;
}

.history-calendar .calendar-day.has-employee-time {
  box-shadow: inset 0 0 0 2px rgba(20, 184, 166, 0.55);
}

.employee-time-calendar-card {
  border-color: rgba(20, 184, 166, 0.58);
}

.boss-vacation-table tr[data-vacation-user] {
  cursor: pointer;
}

.app-shell.boss-home-layout #dailyNote {
  order: 99;
}

.app-shell.worker-account .bottom-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.boss-home-layout #bossAvailableWorkersPanel,
  .app-shell.desktop-layout.boss-home-layout #dailyNote,
  .app-shell.desktop-layout.employee-home-layout #employeeOverviewPanel,
  .app-shell.desktop-layout.route-mode-active > #employeeTimePanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout #bossAvailableWorkersPanel,
  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout #dailyNote,
  body.desktop-menu-collapsed .app-shell.desktop-layout.employee-home-layout #employeeOverviewPanel,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #employeeTimePanel.app-route-active {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 760px) {
  .employee-kpi-grid,
  .boss-employee-hours-summary,
  .boss-employee-rate-form {
    grid-template-columns: 1fr;
  }

  .employee-current-status {
    flex-direction: column;
  }

  .fleet-subsection > summary small {
    display: none;
  }
}

/* V9.01 - czytelny pulpit BOSS, eksport godzin i konta PRACOWNIK */
.employee-work-hours-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.employee-work-hours-toolbar label {
  display: grid;
  gap: 7px;
  font-weight: 850;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.boss-home-layout > :is(
    #bossAvailableWorkersPanel,
    #activeWorkOrdersPanel,
    #bossDashboardPanel,
    #deadlineAlerts,
    #summaryPanel,
    #dailyNote
  ) {
    grid-column: 2 / -1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    align-self: start !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #bossAvailableWorkersPanel {
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #bossDashboardPanel {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #deadlineAlerts {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #summaryPanel {
    grid-row: 6 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #dailyNote {
    grid-row: 7 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > :is(
    #bossAvailableWorkersPanel,
    #activeWorkOrdersPanel,
    #bossDashboardPanel,
    #deadlineAlerts,
    #summaryPanel,
    #dailyNote
  ) {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 760px) {
  .employee-work-hours-toolbar {
    grid-template-columns: 1fr;
  }
}

/* V9.51 - operacyjna lista Technikow Bossa: dostepni oraz na poleceniach */
.boss-available-workers-panel .section-title {
  align-items: center;
}

.available-workers-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.available-workers-list .boss-technician-card {
  min-width: 0;
  min-height: 86px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 4px 12px;
  align-content: center;
}

.available-workers-list .boss-technician-card > i {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  margin-top: 8px;
}

.boss-technician-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.available-workers-list .boss-technician-card strong,
.available-workers-list .boss-technician-card b,
.available-workers-list .boss-technician-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.available-workers-list .boss-technician-card strong {
  line-height: 1.25;
}

.available-workers-list .boss-technician-card b {
  color: #f0fdf4;
  font-size: 0.94rem;
}

.available-workers-list .boss-technician-card small {
  color: #bbf7d0;
  font-size: 0.84rem;
  font-weight: 850;
}

.available-workers-list .boss-technician-status {
  display: inline-grid;
  min-height: 28px;
  padding: 4px 9px;
  place-items: center;
  border: 1px solid rgba(187, 247, 208, 0.42);
  border-radius: 999px;
  color: #ecfdf5;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.available-workers-list .boss-technician-meta {
  grid-column: 2;
  color: #bbf7d0;
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 850;
}

.available-workers-list .boss-technician-card.is-assigned {
  border-color: #0d9488;
  background: linear-gradient(135deg, #115e59, #064e3b);
}

.available-workers-list .boss-technician-card.is-assigned > i {
  background: #5eead4;
  box-shadow: 0 0 0 6px rgba(94, 234, 212, 0.16);
}

.available-workers-list .boss-technician-card.is-assigned .boss-technician-status {
  border-color: rgba(153, 246, 228, 0.5);
  color: #ccfbf1;
}

.boss-technicians-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--opsui-border-strong, #94a3b8);
  border-radius: 14px;
  color: var(--opsui-muted, #64748b);
  text-align: center;
}

@media (min-width: 700px) and (max-width: 1179px) {
  .available-workers-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .available-workers-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .boss-available-workers-panel .section-title {
    align-items: flex-start;
  }

  .boss-available-workers-panel .section-title h2 {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }

  .available-workers-list .boss-technician-card {
    min-height: 80px;
    padding: 13px 14px;
  }
}

/* V9.02 - laczone analizy i uprawnienia dla kont z wieloma rolami */
@media (min-width: 980px) {
  .app-shell.desktop-layout.dual-analysis-home-layout > :is(
    #technicianOverviewPanel,
    #leaderAnalyticsPanel,
    #dailyNote,
    #activeWorkOrdersPanel,
    #deadlineAlerts,
    #summaryPanel
  ) {
    grid-column: 2 / -1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    align-self: start !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #technicianOverviewPanel {
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #leaderAnalyticsPanel {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #dailyNote {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #activeWorkOrdersPanel {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #deadlineAlerts {
    grid-row: 6 !important;
  }

  .app-shell.desktop-layout.dual-analysis-home-layout > #summaryPanel {
    grid-row: 7 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.dual-analysis-home-layout > :is(
    #technicianOverviewPanel,
    #leaderAnalyticsPanel,
    #dailyNote,
    #activeWorkOrdersPanel,
    #deadlineAlerts,
    #summaryPanel
  ) {
    grid-column: 1 / -1 !important;
  }
}

/* V9.03 - trwale, jednoznaczne sygnaly podpisow polecenia pracy */
body :is(
  .bottom-nav-item,
  .side-menu-list button
)[data-app-route="workOrder"].work-order-state-pending {
  color: #ffffff !important;
  border-color: #ff6673 !important;
  background: linear-gradient(135deg, #e32636 0%, #a90f20 100%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 72, 88, 0.36),
    0 10px 28px rgba(185, 28, 28, 0.55) !important;
  animation: work-order-nav-alert-pulse 1.45s ease-in-out infinite;
}

body :is(
  .bottom-nav-item,
  .side-menu-list button
)[data-app-route="workOrder"].work-order-state-signed {
  color: #ffffff !important;
  border-color: #39d98a !important;
  background: linear-gradient(135deg, #15945f 0%, #05603d 100%) !important;
  box-shadow:
    0 0 0 2px rgba(45, 212, 140, 0.3),
    0 10px 28px rgba(5, 96, 61, 0.5) !important;
}

body :is(
  .bottom-nav-item,
  .side-menu-list button
)[data-app-route="workOrder"].work-order-state-signature {
  color: #17120a !important;
  border-color: #ffd65c !important;
  background: linear-gradient(135deg, #ffd257 0%, #e8a80c 100%) !important;
  box-shadow: 0 10px 26px rgba(202, 138, 4, 0.42) !important;
}

body :is(
  .bottom-nav-item,
  .side-menu-list button
)[data-app-route="workOrder"]:is(
  .work-order-state-pending,
  .work-order-state-signed
) :is(span, svg) {
  color: #ffffff !important;
  stroke: currentColor !important;
}

@keyframes work-order-nav-alert-pulse {
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 72, 88, 0.18),
      0 12px 34px rgba(185, 28, 28, 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  body :is(
    .bottom-nav-item,
    .side-menu-list button
  )[data-app-route="workOrder"].work-order-state-pending {
    animation: none;
  }
}

/* V9.12: status Polecenia musi pozostac czytelny rowniez w trybie ciemnym. */
body.theme-dark .bottom-nav .bottom-nav-item[data-app-route="workOrder"].work-order-state-pending,
body.theme-dark .side-menu-list button[data-app-route="workOrder"].work-order-state-pending {
  color: #ffffff !important;
  border-color: #ff6673 !important;
  background: linear-gradient(135deg, #f02d3f 0%, #b31325 100%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 83, 99, 0.48),
    0 12px 30px rgba(225, 29, 50, 0.64) !important;
  opacity: 1 !important;
}

body.theme-dark .bottom-nav .bottom-nav-item[data-app-route="workOrder"].work-order-state-signature,
body.theme-dark .side-menu-list button[data-app-route="workOrder"].work-order-state-signature {
  color: #17120a !important;
  border-color: #ffe27d !important;
  background: linear-gradient(135deg, #ffdc68 0%, #f0ae12 100%) !important;
  box-shadow:
    0 0 0 2px rgba(255, 214, 92, 0.34),
    0 12px 30px rgba(240, 174, 18, 0.5) !important;
  opacity: 1 !important;
}

body.theme-dark .bottom-nav .bottom-nav-item[data-app-route="workOrder"].work-order-state-signed,
body.theme-dark .side-menu-list button[data-app-route="workOrder"].work-order-state-signed {
  color: #ffffff !important;
  border-color: #4bea9d !important;
  background: linear-gradient(135deg, #1dbd78 0%, #08784d 100%) !important;
  box-shadow:
    0 0 0 2px rgba(75, 234, 157, 0.34),
    0 12px 30px rgba(8, 120, 77, 0.58) !important;
  opacity: 1 !important;
}

body.theme-dark .bottom-nav .bottom-nav-item[data-app-route="workOrder"].work-order-state-closed,
body.theme-dark .side-menu-list button[data-app-route="workOrder"].work-order-state-closed {
  color: #101722 !important;
  border-color: #ffffff !important;
  background: linear-gradient(135deg, #ffffff 0%, #dce7f3 100%) !important;
  box-shadow: 0 10px 26px rgba(226, 232, 240, 0.26) !important;
  opacity: 1 !important;
}

body.theme-dark :is(
  .bottom-nav .bottom-nav-item,
  .side-menu-list button
)[data-app-route="workOrder"]:is(
  .work-order-state-pending,
  .work-order-state-signature,
  .work-order-state-signed,
  .work-order-state-closed
) :is(span, svg) {
  color: currentColor !important;
  stroke: currentColor !important;
}

/* V9.12: natywne pole miesiaca na iOS nie moze wychodzic poza panel. */
@media (max-width: 620px) {
  .technician-overview-panel,
  .technician-overview-heading,
  .technician-overview-heading > *,
  .technician-overview-period {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .technician-overview-period input[type="month"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

/* V9.13: podpisane Polecenie ma zawsze zielony napis i ikone. */
html body.theme-dark #bottomNav button.bottom-nav-item[data-app-route="workOrder"].work-order-state-signed,
html body.theme-dark #bottomNav button.bottom-nav-item[data-app-route="workOrder"].active.work-order-state-signed {
  color: #42f59b !important;
}

html body.theme-dark #bottomNav button.bottom-nav-item[data-app-route="workOrder"].work-order-state-signed span,
html body.theme-dark #bottomNav button.bottom-nav-item[data-app-route="workOrder"].work-order-state-signed svg {
  color: #42f59b !important;
  stroke: #42f59b !important;
}

/* V9.14: panel analizy Technika nie moze poszerzac ekranu na telefonie. */
@media (max-width: 620px) {
  #technicianOverviewPanel.technician-overview-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }

  #technicianOverviewPanel.technician-overview-panel > *,
  #technicianOverviewPanel .technician-overview-heading,
  #technicianOverviewPanel .technician-overview-heading > *,
  #technicianOverviewPanel .technician-overview-heading > div,
  #technicianOverviewPanel .technician-overview-period,
  #technicianOverviewPanel .technician-priority-alert,
  #technicianOverviewPanel .technician-priority-alert > div {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #technicianOverviewPanel .technician-overview-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  #technicianOverviewPanel .technician-overview-period input[type="month"] {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #technicianOverviewPanel .technician-priority-alert {
    box-sizing: border-box;
    align-items: flex-start;
  }

  #technicianOverviewPanel .technician-priority-alert strong,
  #technicianOverviewPanel .technician-priority-alert p {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

/* V9.15: stabilna kontrolka miesiaca dla Safari iOS. */
.technician-overview-month-field {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--opsui-border-strong);
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-text);
  background: var(--opsui-surface-muted);
  font-size: 0.88rem;
  font-weight: 850;
  letter-spacing: normal;
  text-transform: none;
}

.technician-overview-month-field:focus-within {
  border-color: var(--opsui-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--opsui-primary) 18%, transparent);
}

.technician-overview-month-field > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0 12px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

#technicianOverviewMonth {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
}

@media (max-width: 620px) {
  #technicianOverviewPanel.technician-overview-panel,
  #technicianOverviewPanel.technician-overview-panel > *,
  #technicianOverviewPanel .technician-overview-heading,
  #technicianOverviewPanel .technician-overview-heading > *,
  #technicianOverviewPanel .technician-overview-period,
  #technicianOverviewPanel .technician-priority-alert {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #technicianOverviewPanel .technician-overview-heading,
  #technicianOverviewPanel .technician-overview-period {
    grid-template-columns: minmax(0, 1fr);
  }

  #technicianOverviewPanel .technician-overview-month-field {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch;
  }

  #technicianOverviewPanel .technician-priority-alert > div {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 0;
  }
}

/* V9.16: monity z Notatnika sa pierwszym blokiem pulpitu Technika na komputerze. */
@media (min-width: 980px) {
  .app-shell.desktop-layout.technician-home-layout > #deadlineAlerts {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    align-self: start !important;
  }

  .app-shell.desktop-layout.technician-home-layout > #technicianOverviewPanel {
    grid-column: 2 / -1 !important;
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.technician-home-layout.dual-analysis-home-layout > #leaderAnalyticsPanel {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.technician-home-layout.dual-analysis-home-layout > #dailyNote {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.technician-home-layout.dual-analysis-home-layout > #activeWorkOrdersPanel {
    grid-row: 6 !important;
  }

  .app-shell.desktop-layout.technician-home-layout.dual-analysis-home-layout > #summaryPanel {
    grid-row: 7 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.technician-home-layout > :is(
    #deadlineAlerts,
    #technicianOverviewPanel,
    #leaderAnalyticsPanel,
    #dailyNote,
    #activeWorkOrdersPanel,
    #summaryPanel
  ) {
    grid-column: 1 / -1 !important;
  }
}

/* V9.17: selektor mocniejszy od ogolnej reguly grid-row:auto pulpitu. */
@media (min-width: 980px) {
  .app-shell.desktop-layout.home-route-layout.technician-home-layout:not(.home-dashboard-layout) >
    #deadlineAlerts.app-route-active {
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.home-route-layout.technician-home-layout:not(.home-dashboard-layout) >
    #technicianOverviewPanel.app-route-active {
    grid-row: 3 !important;
  }
}

/* V9.18 — skalowalny panel kont administratora */
.admin-user-create-disclosure {
  margin-bottom: 14px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.2);
}

.admin-user-create-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 12px 15px;
  color: #eaf2ff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.admin-user-create-disclosure > summary::-webkit-details-marker {
  display: none;
}

.admin-user-create-disclosure > summary::after {
  content: "Rozwiń";
  margin-left: auto;
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 900;
}

.admin-user-create-disclosure[open] > summary::after {
  content: "Zwiń";
}

.admin-user-create-disclosure > summary strong,
.admin-user-create-disclosure > summary small {
  display: block;
}

.admin-user-create-disclosure > summary strong {
  font-size: 0.82rem;
}

.admin-user-create-disclosure > summary small {
  margin-top: 3px;
  color: #8fa1b8;
  font-size: 0.67rem;
}

.admin-user-create-disclosure .admin-user-form {
  margin: 0 12px 12px;
}

.admin-account-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.24);
}

.admin-account-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-account-toolbar label > span {
  color: #8fa1b8;
  font-size: 0.66rem;
  font-weight: 850;
}

.admin-account-toolbar input,
.admin-account-toolbar select {
  width: 100%;
  min-width: 0;
}

.admin-account-toolbar .secondary-button {
  min-height: 43px;
  white-space: nowrap;
}

.admin-account-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 9px;
  color: #8fa1b8;
  font-size: 0.68rem;
}

.admin-account-list-summary p {
  margin: 0;
}

.admin-account-list-summary strong {
  color: #eaf2ff;
  font-size: 0.88rem;
}

.admin-users-list {
  gap: 8px;
}

.admin-user-row {
  gap: 0;
  border-radius: 13px;
}

.admin-user-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 72px;
  padding: 10px 12px;
  border-bottom: 0;
}

.admin-user-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.18);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.admin-user-card-header .admin-user-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-user-card-header .admin-user-name > strong {
  flex: 0 0 100%;
  overflow: hidden;
  color: #f8fafc;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-card-header .admin-user-name > small {
  flex: 0 0 100%;
  overflow: hidden;
  color: #8fa1b8;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.admin-user-quick-actions button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: 9px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.16);
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.admin-user-card-grid {
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.12);
}

.admin-user-card-grid[hidden] {
  display: none !important;
}

.admin-users-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 2px 2px;
  color: #8fa1b8;
  font-size: 0.68rem;
}

.admin-users-pagination > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-users-pagination b {
  color: #dbeafe;
  font-size: 0.68rem;
}

.admin-accounts-empty {
  margin: 0;
}

.sms-gateway-card {
  display: block;
  padding: 0;
  overflow: hidden;
}

.sms-gateway-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 15px 16px;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}

.sms-gateway-summary::-webkit-details-marker {
  display: none;
}

.sms-gateway-summary > span:first-child {
  min-width: 0;
}

.sms-gateway-summary .eyebrow,
.sms-gateway-summary strong,
.sms-gateway-summary small {
  display: block;
}

.sms-gateway-summary strong {
  margin-top: 3px;
  font-size: 0.92rem;
}

.sms-gateway-summary small {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.68rem;
}

.sms-gateway-summary-action {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #bdd4ef;
  border-radius: 9px;
  color: #0b5fc3;
  background: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
}

.sms-gateway-summary-action::after {
  content: " +";
}

.sms-gateway-card[open] .sms-gateway-summary-action::after {
  content: " −";
}

.sms-gateway-content {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid #d8e5f5;
}

.sms-gateway-content > .form-hint {
  margin-top: 14px;
}

body.theme-light .admin-user-create-disclosure,
body.theme-light .admin-account-toolbar {
  border-color: #d9e3ef;
  background: #f8fafc;
}

body.theme-light .admin-user-create-disclosure > summary,
body.theme-light .admin-account-list-summary strong,
body.theme-light .admin-users-pagination b,
body.theme-light .admin-user-card-header .admin-user-name > strong {
  color: #172033;
}

body.theme-light .admin-user-avatar {
  border-color: #bfdbfe;
  color: #175aa6;
  background: #eaf3ff;
}

body.theme-light .admin-user-quick-actions button {
  border-color: #b8d1ec;
  color: #0b5fc3;
  background: #edf5ff;
}

body.theme-light .admin-user-card-grid {
  border-top-color: #dce6f1;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .admin-account-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 0.6fr);
  }

  .admin-account-search {
    grid-column: 1 / -1;
  }

  .admin-account-toolbar .secondary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .admin-account-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-account-search,
  .admin-account-toolbar .secondary-button {
    grid-column: auto;
  }

  .admin-account-list-summary,
  .admin-users-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-user-card-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-user-quick-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .admin-user-quick-actions button {
    flex: 1 1 0;
  }

  .admin-users-pagination > div {
    width: 100%;
    justify-content: space-between;
  }

  .sms-gateway-summary {
    align-items: flex-start;
  }
}

/* V9.19 — adresowane notatki i kopiowanie numeru polecenia */
.notebook-form #notebookRecipient {
  width: 100%;
}

.notebook-form #notebookRecipientLabel[hidden] {
  display: none !important;
}

.personal-note-item.note-incoming {
  border-left: 4px solid #1479f7;
  background: #f2f8ff;
}

.personal-note-item.note-outgoing {
  border-left: 4px solid #5a8f2d;
  background: #f7fbf2;
}

.personal-note-item.note-due {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.personal-note-direction {
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid #cbdcf0;
  border-radius: 999px;
  color: #315b88;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
}

.note-incoming .personal-note-direction {
  border-color: #bfdbfe;
  color: #0b5fc3;
  background: #e9f3ff;
}

.note-outgoing .personal-note-direction {
  border-color: #cce5b7;
  color: #467522;
  background: #eff8e8;
}

.work-order-copy-reference {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: auto minmax(0, auto);
  gap: 2px 9px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid #b9d3ee;
  border-radius: 10px;
  color: #0b5fc3;
  background: #edf6ff;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.work-order-copy-reference:hover,
.work-order-copy-reference:focus-visible {
  border-color: #1479f7;
  background: #dcebff;
  transform: translateY(-1px);
}

.work-order-copy-reference.copied {
  border-color: #64a334;
  color: #3f6d1f;
  background: #eff8e8;
}

.work-order-copy-reference > span {
  grid-row: 1;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.07em;
}

.work-order-copy-reference > b {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.work-order-copy-reference > small {
  grid-column: 1;
  grid-row: 2;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 750;
}

.work-order-copy-reference.compact {
  margin: 3px 0 5px;
  padding: 7px 10px;
}

body.theme-dark .personal-note-item.note-incoming {
  border-color: #2b8cff;
  background: rgba(18, 55, 91, 0.76);
}

body.theme-dark .personal-note-item.note-outgoing {
  border-color: #75a84d;
  background: rgba(42, 67, 26, 0.72);
}

body.theme-dark .personal-note-direction {
  border-color: rgba(148, 163, 184, 0.42);
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.46);
}

body.theme-dark .work-order-copy-reference {
  border-color: #365b83;
  color: #dbeafe;
  background: #152b43;
}

body.theme-dark .work-order-copy-reference > span,
body.theme-dark .work-order-copy-reference > small {
  color: #9eb7d2;
}

body.theme-dark .work-order-copy-reference:hover,
body.theme-dark .work-order-copy-reference:focus-visible {
  border-color: #4b9cff;
  background: #183b60;
}

body.theme-dark .work-order-copy-reference.copied {
  border-color: #75a84d;
  color: #e4f6d7;
  background: #29431d;
}

@media (max-width: 560px) {
  .work-order-copy-reference {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* V9.20 — polecenia Bossa w responsywnej siatce */
@media (min-width: 980px) {
  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel,
  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 2 / -1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel,
  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel.boss-pending-home-slot {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout.boss-home-layout #userWorkOrdersList {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
  }

  .app-shell.desktop-layout.boss-home-layout #userWorkOrdersList > .user-work-order {
    min-width: 0;
    width: 100%;
    align-self: start;
  }

  .app-shell.desktop-layout.boss-home-layout #userWorkOrdersList > .user-work-order.work-order-card-expanded {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout.boss-home-layout .user-work-order-info,
  .app-shell.desktop-layout.boss-home-layout .user-work-order-info > span,
  .app-shell.desktop-layout.boss-home-layout .user-work-order-info > strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 1440px) {
  .app-shell.desktop-layout.boss-home-layout #userWorkOrdersList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* V9.56 - podpisy zespolu i trzykolumnowa zakladka polecen pracy */
.available-workers-list .boss-technician-card.is-signature-pending,
#leaderOperationsPanel .leader-technician-location.is-signature-pending {
  border-color: #facc15;
  color: #fffbeb;
  background: linear-gradient(135deg, #854d0e, #713f12);
  box-shadow: 0 12px 28px rgba(133, 77, 14, 0.3);
}

.available-workers-list .boss-technician-card.is-signature-pending > i,
#leaderOperationsPanel .leader-technician-location.is-signature-pending > i {
  background: #fde047;
  box-shadow: 0 0 0 6px rgba(253, 224, 71, 0.2);
}

.available-workers-list .boss-technician-card.is-signature-pending .boss-technician-status,
#leaderOperationsPanel .leader-technician-location.is-signature-pending .leader-technician-status {
  border-color: rgba(254, 240, 138, 0.72);
  color: #422006;
  background: #fde68a;
}

.available-workers-list .boss-technician-card.is-signature-pending b,
.available-workers-list .boss-technician-card.is-signature-pending small,
#leaderOperationsPanel .leader-technician-location.is-signature-pending b,
#leaderOperationsPanel .leader-technician-location.is-signature-pending small {
  color: #fef3c7;
}

.team-signature-cta {
  grid-column: 2;
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 12px;
  border: 1px solid #fef08a;
  border-radius: 10px;
  color: #422006;
  background: #fde047;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.team-signature-cta:hover,
.team-signature-cta:focus-visible {
  background: #fef08a;
  outline: 3px solid rgba(250, 204, 21, 0.28);
  outline-offset: 2px;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.route-mode-active > #activeWorkOrdersPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #activeWorkOrdersPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout.route-mode-active #activeWorkOrdersPanel.app-route-active #userWorkOrdersList {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px;
    align-items: start;
  }

  .app-shell.desktop-layout.route-mode-active #activeWorkOrdersPanel.app-route-active #userWorkOrdersList > .user-work-order {
    width: 100%;
    min-width: 0;
    align-self: start;
  }

  .app-shell.desktop-layout.route-mode-active #activeWorkOrdersPanel.app-route-active #userWorkOrdersList > .user-work-order.work-order-card-expanded {
    grid-column: 1 / -1;
  }

  .app-shell.desktop-layout.route-mode-active #activeWorkOrdersPanel.app-route-active .user-work-order-info,
  .app-shell.desktop-layout.route-mode-active #activeWorkOrdersPanel.app-route-active .user-work-order-info > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* V9.21 — monity z Notatnika zawsze na gorze strony glownej */
.deadline-note-alert {
  border-left: 4px solid #1479f7;
  background: #eaf4ff;
}

body.theme-dark .deadline-note-alert {
  border-color: #4b9cff;
  color: #eaf2ff;
  background: rgba(18, 55, 91, 0.92);
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.home-route-layout:not(.home-dashboard-layout) > #deadlineAlerts {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.home-route-layout:not(.home-dashboard-layout) > #deadlineAlerts {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #deadlineAlerts {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #bossAvailableWorkersPanel {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #bossDashboardPanel {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #summaryPanel {
    grid-row: 6 !important;
  }

  .app-shell.desktop-layout.boss-home-layout > #dailyNote {
    grid-row: 7 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > #deadlineAlerts {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout:not(.admin-home-layout):not(.boss-home-layout) > #deadlineAlerts {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout:not(.admin-home-layout):not(.boss-home-layout) > #dailyNote {
    grid-row: 3 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout:not(.admin-home-layout):not(.boss-home-layout) > #activeWorkOrdersPanel {
    grid-row: 4 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout:not(.admin-home-layout):not(.boss-home-layout) > #bossDashboardPanel {
    grid-row: 5 !important;
  }

  .app-shell.desktop-layout.home-dashboard-layout:not(.admin-home-layout):not(.boss-home-layout) > #summaryPanel {
    grid-row: 6 !important;
  }
}

/* V9.22 — osobne centrum przegladow dla Bossa i Office */
#reviewsPanel {
  width: min(100%, var(--ops-page-width));
  margin-right: auto;
  margin-left: auto;
  border-color: var(--opsui-border);
  border-radius: var(--opsui-radius);
  color: var(--opsui-text);
  background: var(--opsui-surface);
  box-shadow: var(--ops-shadow);
}

.reviews-panel-heading,
.review-alert-column-heading,
.review-alert-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reviews-panel-heading {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--opsui-border);
}

.reviews-panel-heading h2,
.reviews-panel-heading p,
.review-alert-column-heading h3,
.review-alert-column-heading p {
  margin: 0;
}

.reviews-panel-heading > div > p:last-child {
  margin-top: 5px;
  color: var(--opsui-muted);
}

.reviews-alert-total,
.review-column-count {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--opsui-border);
  border-radius: 999px;
  color: var(--opsui-muted);
  background: var(--opsui-surface-muted);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.reviews-alert-total.has-alerts,
.review-column-count.has-alerts {
  border-color: color-mix(in srgb, var(--ops-danger) 45%, transparent);
  color: #fff;
  background: var(--ops-danger);
}

.reviews-alert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.review-alert-column {
  display: flex;
  min-width: 0;
  min-height: 360px;
  padding: 14px;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.review-alert-column-heading {
  min-height: 52px;
  align-items: flex-start;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--opsui-border);
}

.review-alert-column-heading h3 {
  margin-top: 3px;
  font-size: 1rem;
}

.review-alert-column-list {
  display: grid;
  gap: 9px;
  align-content: start;
  flex: 1 1 auto;
}

.review-alert-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-left-width: 4px;
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface);
  box-shadow: 0 7px 17px rgba(4, 12, 24, 0.08);
}

.review-alert-card.danger {
  border-left-color: var(--ops-danger);
  background: color-mix(in srgb, var(--ops-danger) 8%, var(--opsui-surface));
}

.review-alert-card.warning {
  border-left-color: var(--ops-warning);
  background: color-mix(in srgb, var(--ops-warning) 8%, var(--opsui-surface));
}

.review-alert-card-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-alert-card-copy strong,
.review-alert-card-copy span {
  overflow-wrap: anywhere;
}

.review-alert-card-copy strong {
  font-size: 0.88rem;
}

.review-alert-card-copy span,
.review-alert-card-status small {
  color: var(--opsui-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.review-alert-card-status {
  align-items: flex-end;
}

.review-alert-card-status small {
  max-width: 50%;
}

.review-alert-card-status .deadline-status {
  flex: 0 0 auto;
}

.review-column-empty {
  display: grid;
  min-height: 170px;
  padding: 22px 12px;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed color-mix(in srgb, var(--ops-success) 45%, var(--opsui-border));
  border-radius: var(--opsui-radius-small);
  color: var(--opsui-muted);
  background: color-mix(in srgb, var(--ops-success) 6%, var(--opsui-surface));
  text-align: center;
}

.review-column-empty > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ops-success);
  font-weight: 950;
}

.review-column-empty strong {
  color: var(--opsui-text);
  font-size: 0.82rem;
}

.review-column-empty small {
  font-size: 0.7rem;
}

.review-column-action {
  width: 100%;
  margin-top: auto;
}

.side-menu-list button.nav-critical-alert {
  position: relative;
  color: #fff !important;
  background: #b4232c !important;
  box-shadow: 0 0 0 0 rgba(220, 38, 49, 0.62);
  animation: reviews-nav-critical-pulse 1.05s ease-in-out infinite;
}

.side-menu-list button.nav-critical-alert::after {
  content: attr(data-alert-count);
  display: inline-grid;
  float: right;
  min-width: 22px;
  height: 22px;
  margin: -2px 0 -2px 8px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  color: #9f1720;
  background: #fff;
  font-size: 0.68rem;
  font-weight: 950;
}

@keyframes reviews-nav-critical-pulse {
  0%,
  100% {
    color: #fff;
    background: #b4232c;
    box-shadow: 0 0 0 0 rgba(220, 38, 49, 0.58);
  }
  50% {
    color: #7f1118;
    background: #ffd7da;
    box-shadow: 0 0 0 5px rgba(220, 38, 49, 0.12);
  }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.route-mode-active > #reviewsPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #reviewsPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 1240px) {
  .reviews-alert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .reviews-panel-heading {
    align-items: flex-start;
  }

  .reviews-alert-grid {
    grid-template-columns: 1fr;
  }

  .review-alert-column {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-menu-list button.nav-critical-alert {
    animation: none;
  }
}

/* V9.23 — czytelne monity w mobilnym trybie ciemnym */
@media (max-width: 767px) {
  body.theme-dark #deadlineAlerts {
    color: #eef6ff !important;
    background: #0d1a29 !important;
    border-color: #33475f !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-card {
    padding: 14px !important;
    color: #eef6ff !important;
    background: #101e2e !important;
    border-color: #3b506a !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-heading {
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom-color: #33475f;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-heading .eyebrow {
    color: #77b7ff !important;
    font-size: 0.61rem;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-heading h2 {
    color: #f8fbff !important;
    font-size: 1.02rem;
    line-height: 1.25;
  }

  body.theme-dark #deadlineAlerts .presence-badge {
    color: #dbeafe !important;
    background: #17345a !important;
    border-color: #3f6795 !important;
  }

  body.theme-dark #deadlineAlerts .deadline-table-wrap {
    overflow: visible;
    border: 0 !important;
    background: transparent !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    border-spacing: 0;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table thead {
    display: none;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table tbody {
    display: grid;
    width: 100%;
    gap: 10px;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table tr {
    display: grid;
    width: 100%;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid #38516d !important;
    border-left: 4px solid #4b9cff !important;
    border-radius: 13px;
    color: #eef6ff !important;
    background: #11263d !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table tr.deadline-overdue {
    border-color: #703b47 !important;
    border-left-color: #ef6670 !important;
    background: #2a1820 !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td,
  body.theme-dark #deadlineAlerts .deadline-alerts-table .deadline-overdue td {
    display: block;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    color: #d9e7f7 !important;
    background: transparent !important;
    font-size: 0.78rem !important;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(1) {
    color: #7db9ff !important;
    font-size: 0.66rem !important;
    font-weight: 950;
    letter-spacing: 0.09em;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(2) {
    color: #f8fbff !important;
    font-size: 0.8rem !important;
    font-weight: 850;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(3) {
    color: #e8f1fc !important;
    font-size: 0.86rem !important;
    font-weight: 800;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(4) {
    color: #aebfd3 !important;
    font-size: 0.72rem !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(5) {
    padding-top: 5px !important;
  }

  body.theme-dark #deadlineAlerts .deadline-status.warning,
  body.theme-dark #reviewsPanel .deadline-status.warning {
    color: #ffdf8a !important;
    background: #493511 !important;
    border-color: #8e681d !important;
  }

  body.theme-dark #deadlineAlerts .deadline-status.danger,
  body.theme-dark #reviewsPanel .deadline-status.danger {
    color: #ffd5d8 !important;
    background: #751f29 !important;
    border-color: #c34a55 !important;
  }

  body.theme-dark #deadlineAlerts .deadline-status {
    min-height: 25px;
    padding: 4px 9px;
    font-size: 0.68rem !important;
    line-height: 1.2;
  }

  body.theme-dark #deadlineAlerts > .deadline-note-alert {
    padding: 12px 13px !important;
    border: 1px solid #3f6288 !important;
    border-left: 4px solid #4b9cff !important;
    color: #eaf3ff !important;
    background: #112b47 !important;
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  body.theme-dark #deadlineAlerts > .deadline-note-alert :is(b, strong, span) {
    color: inherit !important;
  }

  body.theme-dark #reviewsPanel {
    color: #eef6ff;
    background: #0e1a29;
    border-color: #33475f;
  }

  body.theme-dark #reviewsPanel .reviews-panel-heading {
    border-bottom-color: #33475f;
  }

  body.theme-dark #reviewsPanel .reviews-panel-heading h2,
  body.theme-dark #reviewsPanel .review-alert-column-heading h3,
  body.theme-dark #reviewsPanel .review-alert-card-copy strong {
    color: #f8fbff;
  }

  body.theme-dark #reviewsPanel .reviews-panel-heading p,
  body.theme-dark #reviewsPanel .review-alert-card-copy span,
  body.theme-dark #reviewsPanel .review-alert-card-status small {
    color: #b9c9db;
  }

  body.theme-dark #reviewsPanel .review-alert-column {
    color: #eaf3ff;
    background: #111f30;
    border-color: #334a64;
  }

  body.theme-dark #reviewsPanel .review-alert-column-heading {
    border-bottom-color: #334a64;
  }

  body.theme-dark #reviewsPanel .review-alert-card {
    color: #eaf3ff;
    background: #142438;
    border-color: #3a506b;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  }

  body.theme-dark #reviewsPanel .review-alert-card.warning {
    border-left-color: #e6a637;
    background: #2b2416;
  }

  body.theme-dark #reviewsPanel .review-alert-card.danger {
    border-left-color: #e0565b;
    background: #2d1a21;
  }

  body.theme-dark #reviewsPanel .review-column-empty {
    color: #b9c9db;
    background: #12271f;
    border-color: #2f6f50;
  }
}

/* V9.24 — potwierdzanie notatek przez Bossa, Leadera i Office */
.personal-note-workflow {
  display: inline-flex !important;
  width: fit-content;
  min-height: 27px;
  margin: 0 !important;
  padding: 5px 9px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.67rem !important;
  font-weight: 950 !important;
}

.personal-note-workflow.pending {
  border-color: #f4c36a;
  color: #8a4b05;
  background: #fff3cf;
}

.personal-note-workflow.confirmed {
  border-color: #8fcf9f;
  color: #166534;
  background: #e5f8ea;
}

.personal-note-item.note-acknowledged {
  border-left-color: #22a35a;
  box-shadow: inset 0 0 0 1px rgba(34, 163, 90, 0.12);
}

.personal-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-acknowledge-button {
  color: #fff;
  background: #168a4a;
  box-shadow: 0 7px 16px rgba(22, 138, 74, 0.2);
}

.note-acknowledge-button:hover,
.note-acknowledge-button:focus-visible {
  background: #11733d;
}

.deadline-note-alert {
  display: grid;
  gap: 10px;
}

.deadline-note-alert .note-acknowledge-button {
  width: fit-content;
}

body.theme-dark .personal-note-workflow.pending {
  border-color: #8e681d;
  color: #ffdf8a;
  background: #493511;
}

body.theme-dark .personal-note-workflow.confirmed {
  border-color: #2f8c59;
  color: #b9f6ce;
  background: #163c29;
}

body.theme-dark .personal-note-item.note-acknowledged {
  border-color: #2f9b60;
  background: rgba(19, 61, 40, 0.78);
}

@media (max-width: 520px) {
  .personal-note-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .personal-note-actions .note-acknowledge-button {
    grid-column: 1 / -1;
  }

  .personal-note-actions button {
    width: 100%;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(6) {
    padding-top: 4px !important;
  }

  body.theme-dark #deadlineAlerts .deadline-alerts-table td:nth-child(6) .note-acknowledge-button,
  body.theme-dark #deadlineAlerts > .deadline-note-alert .note-acknowledge-button {
    width: 100%;
  }
}

@media (max-width: 767px) {
  body.theme-dark .note-acknowledge-button {
    color: #fff !important;
    background: #168a4a !important;
    border-color: #35a766 !important;
  }
}

/* V9.25 — obowiązkowe zamknięcie miesiąca przez Technika */
.monthly-technician-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  margin: auto;
  padding: 30px;
  overflow: hidden;
  color: #123b25;
  background:
    radial-gradient(circle at 100% 0, rgba(43, 174, 93, 0.17), transparent 42%),
    #f1fff6;
  border: 2px solid #36a965;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(4, 37, 20, 0.42);
}

.monthly-technician-dialog::backdrop {
  background: rgba(4, 15, 10, 0.78);
  backdrop-filter: blur(4px);
}

.monthly-technician-dialog .eyebrow {
  margin: 0 0 8px;
  color: #177442;
  letter-spacing: 0.13em;
}

.monthly-technician-dialog h3 {
  margin: 0;
  color: #0d3520;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.12;
}

.monthly-technician-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  color: #fff;
  background: #168a4a;
  border: 5px solid #c9f7d9;
  border-radius: 50%;
  font-size: 1.7rem;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(22, 138, 74, 0.24);
}

.monthly-technician-message {
  margin: 18px 0;
  color: #204a32;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.55;
}

.monthly-technician-certificate {
  display: grid;
  gap: 5px;
  margin: 0 0 16px;
  padding: 16px 18px;
  color: #16432a;
  background: #dcf9e6;
  border: 1px solid #9addb2;
  border-radius: 15px;
}

.monthly-technician-certificate span {
  font-size: 0.92rem;
  font-weight: 700;
}

.monthly-technician-certificate strong {
  color: #0b6d38;
  font-size: 1.45rem;
  line-height: 1.15;
}

.monthly-technician-countdown {
  margin: 0;
  padding: 13px 16px;
  color: #29523a;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #b8e8c9;
  border-radius: 13px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.monthly-technician-confirm {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  color: #fff;
  background: #168a4a;
  border: 1px solid #0f753d;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(22, 138, 74, 0.24);
}

.monthly-technician-confirm:hover:not(:disabled) {
  background: #11783f;
}

.monthly-technician-confirm:focus-visible {
  outline: 3px solid #f4bf32;
  outline-offset: 3px;
}

.monthly-technician-confirm[hidden] {
  display: none !important;
}

body.theme-dark .monthly-technician-dialog {
  color: #eafff1;
  background:
    radial-gradient(circle at 100% 0, rgba(45, 189, 101, 0.2), transparent 42%),
    #10291c;
  border-color: #45bc75;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.66);
}

body.theme-dark .monthly-technician-dialog .eyebrow {
  color: #7ee3a4;
}

body.theme-dark .monthly-technician-dialog h3,
body.theme-dark .monthly-technician-message {
  color: #effff4;
}

body.theme-dark .monthly-technician-certificate {
  color: #dfffea;
  background: #19452d;
  border-color: #39875a;
}

body.theme-dark .monthly-technician-certificate strong {
  color: #8bf0ad;
}

body.theme-dark .monthly-technician-countdown {
  color: #d9f9e5;
  background: #122f20;
  border-color: #326d49;
}

@media (max-width: 520px) {
  .monthly-technician-dialog {
    width: calc(100vw - 24px);
    padding: 24px 20px;
    border-radius: 20px;
  }

  .monthly-technician-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
  }

  .monthly-technician-dialog h3 {
    font-size: 1.65rem;
  }

  .monthly-technician-message {
    font-size: 1rem;
  }

  .monthly-technician-certificate strong {
    font-size: 1.3rem;
  }
}
/* V9.26 - O-T-A: Odprawa, TAKE5, Analiza po pracy */
.toa-panel {
  width: 100%;
  min-width: 0;
}

.toa-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.toa-heading h2 {
  margin: 3px 0 5px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: .14em;
}

.toa-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.toa-live-badge {
  flex: none;
  padding: 9px 13px;
  border: 1px solid rgba(31, 189, 105, .45);
  border-radius: 999px;
  background: rgba(31, 189, 105, .12);
  color: #16884d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.toa-filters {
  display: grid;
  grid-template-columns: minmax(145px, .7fr) minmax(145px, .7fr) minmax(240px, 1.3fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 10px;
}

.toa-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toa-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.toa-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  background: var(--surface);
}

.toa-table th,
.toa-table td {
  padding: 13px 11px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.toa-table th:last-child,
.toa-table td:last-child {
  border-right: 0;
}

.toa-table tbody tr:last-child td {
  border-bottom: 0;
}

.toa-table th {
  background: color-mix(in srgb, var(--surface) 88%, #2684ff 12%);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.toa-table td:first-child b,
.toa-table td:first-child small {
  display: block;
}

.toa-table td:first-child small {
  margin-top: 4px;
  color: var(--muted);
}

.toa-document-button {
  display: grid;
  width: 100%;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

button.toa-document-button {
  cursor: pointer;
}

.toa-document-button b {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.toa-document-button span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.toa-document-button.ready {
  border-color: rgba(31, 189, 105, .48);
  background: rgba(31, 189, 105, .1);
}

.toa-document-button.ready span {
  color: #16884d;
}

.toa-document-button.pending {
  opacity: .58;
}

.toa-order-cell {
  display: grid;
  gap: 8px;
}

.toa-complete-package-button {
  display: grid;
  width: 100%;
  min-height: 46px;
  align-content: center;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--ops-success, #20b968) 65%, transparent);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #087a43, #16a561);
  box-shadow: 0 8px 18px rgba(8, 122, 67, .18);
  text-align: left;
  cursor: pointer;
}

.toa-complete-package-button b {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .035em;
}

.toa-complete-package-button span {
  color: rgba(255, 255, 255, .84);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.3;
}

.toa-complete-package-button:hover,
.toa-complete-package-button:focus-visible {
  background: linear-gradient(135deg, #076d3c, #118c53);
  transform: translateY(-1px);
}

.toa-complete-package-button:disabled {
  cursor: wait;
  opacity: .64;
  transform: none;
}

.toa-delete-order-button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #ef5962;
  border-radius: 10px;
  background: color-mix(in srgb, #d52c36 14%, var(--surface));
  color: #c9232d;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
  cursor: pointer;
}

.toa-delete-order-button:hover,
.toa-delete-order-button:focus-visible {
  background: #c9232d;
  color: #fff;
}

.toa-delete-order-button:disabled {
  cursor: wait;
  opacity: .6;
}

.toa-work-order-gate {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 16px;
  border: 2px solid #e29a24;
  border-radius: 14px;
  background: rgba(255, 174, 43, .12);
}

.toa-gate-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #e29a24;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.toa-work-order-gate strong,
.toa-work-order-gate p {
  display: block;
  margin: 0;
}

.toa-work-order-gate p {
  margin-top: 4px;
  color: var(--muted);
}

dialog.toa-dialog {
  width: min(1080px, calc(100vw - 30px));
  max-height: calc(100dvh - 30px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .36);
}

dialog.toa-dialog::backdrop {
  background: rgba(3, 9, 18, .78);
  backdrop-filter: blur(5px);
}

.toa-dialog form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.toa-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.toa-dialog-head h3 {
  margin: 3px 0 4px;
  font-size: clamp(23px, 3vw, 34px);
}

.toa-dialog-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.toa-step {
  display: grid;
  gap: 18px;
}

.toa-step[hidden] {
  display: none !important;
}

.toa-step > h4 {
  margin: 10px 0 0;
  font-size: clamp(22px, 4vw, 38px);
  text-align: center;
}

.toa-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.toa-choice {
  min-height: 110px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-size: 32px;
  font-weight: 950;
  cursor: pointer;
}

.toa-choice.yes {
  background: #14874a;
}

.toa-choice.no {
  background: #26374b;
}

.toa-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toa-guidance-grid article {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, #2386ff 8%);
}

.toa-guidance-grid article:last-child {
  grid-column: 1 / -1;
}

.toa-guidance-grid strong {
  color: #16884d;
}

.toa-guidance-grid p {
  margin: 7px 0 0;
  line-height: 1.55;
}

.toa-wide-button {
  width: 100%;
  min-height: 56px;
  font-size: 15px;
  font-weight: 900;
}

.toa-apo-close-bar {
  position: sticky;
  z-index: 8;
  bottom: -24px;
  display: grid;
  gap: 8px;
  margin: 4px -24px -24px;
  padding: 14px 24px 24px;
  border-top: 1px solid color-mix(in srgb, #16884d 42%, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, #16884d 6%);
  box-shadow: 0 -14px 30px rgba(3, 18, 11, .18);
}

.toa-apo-close-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.toa-apo-close-button,
.toa-apo-close-button.primary-button {
  min-height: 66px;
  border: 1px solid #42d883;
  border-radius: 15px;
  background: linear-gradient(135deg, #16884d, #0d6638);
  color: #fff;
  box-shadow: 0 12px 28px rgba(22, 136, 77, .34);
  font-size: clamp(17px, 2.2vw, 22px);
  letter-spacing: .04em;
}

.toa-apo-close-button:hover,
.toa-apo-close-button:focus-visible {
  background: linear-gradient(135deg, #1da55c, #117443);
  transform: translateY(-1px);
}

.toa-apo-close-button.danger-button {
  border-color: #ff7777;
  background: linear-gradient(135deg, #d52c36, #9f1821);
  box-shadow: 0 12px 28px rgba(185, 25, 35, .36);
}

.toa-system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.toa-system-grid fieldset {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toa-system-grid legend {
  padding: 0 7px;
  color: #16884d;
  font-size: 12px;
  font-weight: 900;
}

.toa-system-grid label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 94%, #2386ff 6%);
  cursor: pointer;
}

.toa-system-grid input {
  width: 20px;
  height: 20px;
  accent-color: #16884d;
}

.toa-comment-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toa-comment-block > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toa-comment-block > div > span,
.toa-numbered-field legend span {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #16884d;
  color: #fff;
  font-weight: 900;
}

.toa-comment-block h4 {
  margin: 0;
}

.toa-comment-block textarea {
  grid-column: 1 / -1;
}

.toa-none-button {
  min-width: 90px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: #16884d;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.toa-take5-warning {
  padding: 15px;
  border: 2px solid #cc7b10;
  border-radius: 13px;
  background: rgba(255, 164, 33, .14);
  color: #a75b00;
  font-weight: 950;
  text-align: center;
}

/* V9.31 — profesjonalny formularz polecenia i kokpit operacyjny */
.work-order-heading-copy {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--opsui-muted, #7890aa);
  font-size: 0.78rem;
  line-height: 1.45;
}

#workOrderPanel > .section-title h2 {
  margin: 3px 0 0;
  color: var(--opsui-text, #f8fbff);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

.work-order-primary-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--opsui-border, #31445b);
  border-radius: var(--opsui-radius, 14px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--opsui-primary, #2386ff) 8%, transparent), transparent 42%),
    var(--opsui-surface-muted, #152236);
}

.work-order-block-title {
  display: flex;
  grid-column: 1 / -1;
  gap: 11px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--opsui-border, #31445b);
}

.work-order-block-title > span,
#workOrderForm fieldset > legend > span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #2386ff, #1266cb);
  box-shadow: 0 8px 18px rgba(35, 134, 255, 0.24);
  font-size: 0.72rem;
  font-weight: 950;
}

.work-order-block-title > div {
  display: grid;
  gap: 2px;
}

.work-order-block-title b {
  color: var(--opsui-text, #f8fbff);
  font-size: 0.94rem;
}

.work-order-block-title small {
  color: var(--opsui-muted, #8da2ba);
  font-size: 0.7rem;
  font-weight: 750;
}

.work-order-primary-grid .work-order-date-range,
.work-order-primary-grid .work-order-hour-range {
  grid-column: span 6;
}

.work-order-primary-grid .work-order-location-field,
.work-order-primary-grid .work-order-type-field {
  grid-column: span 8;
}

.work-order-primary-grid .work-order-turbine-field,
.work-order-primary-grid .single-action-option {
  grid-column: span 4;
}

.work-order-primary-grid label,
#workOrderForm .work-order-partner-box label,
#workOrderForm .work-order-role-grid label {
  color: var(--opsui-muted, #aebfd2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

#workOrderForm .work-order-users,
#workOrderForm .work-order-guests {
  padding: 17px;
  box-shadow: 0 10px 26px rgba(3, 12, 24, 0.08);
}

#workOrderForm fieldset > legend {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 0 9px 0 0;
  font-size: 0.82rem;
}

#workOrderForm fieldset > legend > span {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

#workOrderForm > button[type="submit"] {
  min-height: 52px;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 28px rgba(35, 134, 255, 0.24);
}

.analytics-table-subline {
  display: block;
  margin-top: 3px;
  color: var(--opsui-muted, #8fa4bc);
  font-size: 0.66rem;
  font-weight: 750;
}

.analytics-rank {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--opsui-primary, #2386ff) 35%, transparent);
  border-radius: 9px;
  color: #8fc2ff;
  background: color-mix(in srgb, var(--opsui-primary, #2386ff) 14%, transparent);
  font-size: 0.72rem;
  font-weight: 950;
}

.analytics-percent-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #7fe2ad;
  background: rgba(33, 200, 117, 0.14);
  font-size: 0.7rem;
  font-weight: 950;
  white-space: nowrap;
}

.analytics-percent-pill.is-danger {
  color: #ffb7bc;
  background: rgba(239, 68, 68, 0.16);
}

.analytics-money-bars .analytics-bar-row {
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 2fr) minmax(155px, auto);
}

.analytics-money-bars .analytics-bar-row > b {
  text-align: right;
  white-space: nowrap;
}

.analytics-money-bars .analytics-bar-row > b small {
  display: inline-flex;
  margin-left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #9fc4ff;
  background: rgba(35, 134, 255, 0.14);
  font-size: 0.64rem;
}

.analytics-client-technicians .analytics-section-heading > div {
  display: grid;
  gap: 3px;
}

.analytics-client-technicians .analytics-section-heading > div small {
  color: var(--opsui-muted, #8fa4bc);
  font-size: 0.67rem;
}

.analytics-client-technician-search {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(114, 177, 255, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: #b9c7d9;
  font-size: 0.72rem;
  font-weight: 900;
}

.analytics-client-technician-search input {
  min-height: 40px;
  border: 1px solid rgba(114, 177, 255, 0.26);
  border-radius: 9px;
  color: #f8fbff;
  background: rgba(8, 20, 34, 0.78);
}

.analytics-client-technician-grid {
  max-height: 390px;
  padding-right: 5px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.analytics-client-technician-grid label {
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.analytics-client-technician-grid label:hover {
  border-color: rgba(114, 177, 255, 0.32);
  background: rgba(35, 134, 255, 0.1);
}

.bottom-nav-analytics.active {
  color: #75c9ff;
  background: rgba(35, 134, 255, 0.2);
}

body.theme-light .analytics-client-technician-search {
  border-color: #d8e3ef;
  color: #52657a;
  background: #f6f9fc;
}

body.theme-light .analytics-client-technician-search input {
  border-color: #cbd9e7;
  color: #172334;
  background: #fff;
}

body.theme-light .analytics-table-subline {
  color: #65788d;
}

body.theme-light .analytics-rank {
  color: #1266cb;
  background: #eaf3ff;
}

body.theme-light .analytics-money-bars .analytics-bar-row > b small {
  color: #1266cb;
  background: #eaf3ff;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.route-mode-active > #workOrderPanel.app-route-active,
  .app-shell.desktop-layout.route-mode-active > #activeWorkOrdersPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #workOrderPanel.app-route-active,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #activeWorkOrdersPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }

  #workOrderForm {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.85fr);
    gap: 16px;
  }

  #workOrderForm > #workOrderRequesterLabel,
  #workOrderForm > .work-order-primary-grid,
  #workOrderForm > .work-order-submit-hint,
  #workOrderForm > .error-message,
  #workOrderForm > button[type="submit"] {
    grid-column: 1 / -1;
  }

  #workOrderForm > .work-order-users {
    grid-column: 1;
  }

  #workOrderForm > .work-order-guests {
    grid-column: 2;
    align-self: stretch;
  }

  #adminStatisticsPanel .statistics-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  #adminStatisticsPanel .analytics-section.full {
    grid-column: 1 / -1;
  }
}

@media (max-width: 979px) {
  .work-order-primary-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .work-order-primary-grid > * {
    grid-column: 1 !important;
  }
}

@media (max-width: 680px) {
  .work-order-heading-copy {
    display: none;
  }

  .work-order-primary-grid .work-time-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-client-technician-search {
    grid-template-columns: 1fr;
  }

  .analytics-client-technician-grid {
    grid-template-columns: 1fr;
    max-height: 340px;
  }

  .analytics-money-bars .analytics-bar-row {
    grid-template-columns: 1fr auto;
  }

  .analytics-money-bars .analytics-bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.toa-numbered-field {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toa-numbered-field legend {
  display: flex;
  gap: 10px;
  align-items: center;
  width: calc(100% - 12px);
  margin: 0 6px 8px;
  padding: 0 4px;
}

.toa-numbered-field label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 9px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 94%, #2386ff 6%);
  cursor: pointer;
}

.toa-numbered-field input {
  width: 20px;
  height: 20px;
  accent-color: #16884d;
}

.toa-question {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toa-question legend {
  width: 100%;
  padding: 0 7px;
  font-size: 16px;
  font-weight: 900;
}

.toa-question label {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 90px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 900;
}

.toa-question input {
  width: 20px;
  height: 20px;
  accent-color: #16884d;
}

.toa-question textarea {
  grid-column: 1 / -1;
}

body.theme-dark .toa-live-badge,
body.theme-dark .toa-document-button.ready,
body.theme-dark .toa-guidance-grid strong,
body.theme-dark .toa-system-grid legend {
  color: #62e89e;
}

body.theme-dark .toa-document-button {
  background: #0f1b2b;
}

body.theme-dark .toa-delete-order-button {
  color: #ff969c;
}

body.theme-dark .toa-table th {
  background: #14243a;
  color: #c3d3e7;
}

body.theme-dark .toa-table,
body.theme-dark .toa-table-wrap {
  background: #0f1b2b;
}

body.theme-dark .toa-take5-warning {
  color: #ffd38c;
}

@media (max-width: 900px) {
  .toa-filters {
    grid-template-columns: 1fr 1fr;
  }

  .toa-filters label:nth-child(3),
  .toa-filters button:last-child {
    grid-column: 1 / -1;
  }

  .toa-table-wrap {
    overflow: visible;
    border: 0;
  }

  .toa-table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .toa-table thead {
    display: none;
  }

  .toa-table tbody,
  .toa-table tr,
  .toa-table td {
    display: block;
    width: 100%;
  }

  .toa-table tr {
    display: grid;
    gap: 9px;
    margin-bottom: 14px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
  }

  .toa-table td {
    display: grid;
    grid-template-columns: minmax(105px, .55fr) 1fr;
    gap: 9px;
    align-items: center;
    padding: 0;
    border: 0;
  }

  .toa-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  .toa-system-grid {
    grid-template-columns: 1fr;
  }

  .toa-guidance-grid {
    grid-template-columns: 1fr;
  }

  .toa-guidance-grid article:last-child {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .toa-heading,
  .toa-dialog-head {
    display: grid;
  }

  .toa-live-badge {
    justify-self: start;
  }

  .toa-filters {
    grid-template-columns: 1fr;
  }

  .toa-filters label,
  .toa-filters label:nth-child(3),
  .toa-filters button,
  .toa-filters button:last-child {
    grid-column: 1;
  }

  .toa-work-order-gate {
    grid-template-columns: auto 1fr;
  }

  .toa-work-order-gate button {
    grid-column: 1 / -1;
  }

  dialog.toa-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .toa-dialog form {
    padding: 16px;
  }

  .toa-choice-row {
    grid-template-columns: 1fr;
  }

  .toa-choice {
    min-height: 82px;
  }

  .toa-comment-block,
  .toa-question {
    grid-template-columns: 1fr;
  }

  .toa-comment-block > div,
  .toa-comment-block textarea,
  .toa-question textarea {
    grid-column: 1;
  }

  .toa-none-button {
    width: 100%;
  }

  .toa-table td {
    grid-template-columns: 1fr;
  }
}

/* V9.57 - ZESPOL DZISIAJ: 6 kolumn desktop, 2/1 mobile */
@media (min-width: 980px) {
  .app-shell.desktop-layout #availableWorkersList.available-workers-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
  }

  .app-shell.desktop-layout #availableWorkersList .boss-technician-card {
    min-height: 94px;
    padding: 11px 12px;
    gap: 4px 9px;
  }

  .app-shell.desktop-layout #availableWorkersList .boss-technician-card-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .app-shell.desktop-layout #availableWorkersList .boss-technician-card strong {
    overflow: visible;
    font-size: 0.84rem;
    line-height: 1.18;
    white-space: normal;
  }

  .app-shell.desktop-layout #availableWorkersList .boss-technician-status {
    justify-self: start;
    min-height: 23px;
    padding: 3px 7px;
    font-size: 0.58rem;
  }

  .app-shell.desktop-layout #availableWorkersList .boss-technician-card b,
  .app-shell.desktop-layout #availableWorkersList .boss-technician-card small {
    font-size: 0.72rem;
  }
}

@media (min-width: 520px) and (max-width: 979px) {
  #availableWorkersList.available-workers-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 519px) {
  #availableWorkersList.available-workers-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

#availableWorkersList .boss-technician-card.is-signature-pending .team-signature-cta,
#leaderAvailableTechniciansList .leader-technician-location.is-signature-pending .team-signature-cta {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  padding: 8px 10px;
  line-height: 1.18;
  white-space: normal;
}

/* V9.59 - znacznik panelu przerw po wszystkich starszych regulach. */
.work-order-active-extra .work-order-breaks-field > summary::before,
.work-order-active-extra .work-order-breaks-field[open] > summary::before {
  content: none;
  display: none;
}

.work-order-active-extra .work-order-breaks-field > summary::marker {
  content: "";
  font-size: 0;
}

/* Stan kalendarza musi wygrywac z globalnym motywem przyciskow. */
body.theme-dark #vacationPanel button.calendar-day {
  border-color: #4a5f79 !important;
  background: #172438 !important;
  color: #f8fbff !important;
}

body.theme-dark #vacationPanel button.calendar-day.saturday {
  border-color: #d99a18 !important;
  background: #302711 !important;
  color: #fde68a !important;
}

body.theme-dark #vacationPanel button.calendar-day.holiday {
  border-color: #be4057 !important;
  background: #341923 !important;
  color: #fecdd3 !important;
}

body.theme-dark #vacationPanel button.vacation-day.vacation-selected {
  border-color: #fb7185 !important;
  background: #be123c !important;
  color: #ffffff !important;
}

body.theme-dark #vacationPanel button.vacation-day.vacation-team-highlight {
  border-color: #60a5fa !important;
  background: #142f58 !important;
  color: #bfdbfe !important;
}

body.theme-dark #vacationPanel button.vacation-day.vacation-selected.vacation-team-highlight {
  border-color: #ffffff !important;
  background: #be123c !important;
  color: #ffffff !important;
}

body.theme-dark #vacationPanel button.vacation-person-card.is-active {
  border-color: #3b82f6 !important;
  background: #142f58 !important;
  color: #dbeafe !important;
}

/* V9.32 - finalne nadpisanie skali i szerokosci wersji komputerowej. */
@media (min-width: 980px) {
  :root {
    --ops-page-width: 1800px;
  }

  .app-shell.desktop-layout {
    --desktop-sidebar-width: clamp(232px, 13vw, 288px);
    gap: clamp(16px, 1.15vw, 24px);
    padding-right: clamp(18px, 1.45vw, 34px);
  }

  .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout .panel,
  .app-shell.desktop-layout .daily-note,
  .app-shell.desktop-layout .history-section,
  .app-shell.desktop-layout .summary-card,
  .app-shell.desktop-layout .admin-panel,
  .app-shell.desktop-layout .vehicle-panel {
    padding: clamp(18px, 1.35vw, 26px);
    border-radius: 15px;
  }

  .app-shell.desktop-layout .side-menu {
    padding: 16px 12px 18px;
  }

  .app-shell.desktop-layout .side-logo-frame {
    width: 42px;
    height: 42px;
  }

  .app-shell.desktop-layout .side-logo-frame img {
    width: 34px;
    height: 34px;
  }

  .app-shell.desktop-layout .side-brand strong {
    font-size: 0.82rem;
  }

  .app-shell.desktop-layout .side-brand span {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout .side-menu-list {
    gap: 3px;
  }

  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .app-shell.desktop-layout .side-admin-shortcuts button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.74rem;
  }

  .app-shell.desktop-layout :is(input, select, textarea, button) {
    font-size: 0.84rem;
  }

  .app-shell.desktop-layout :is(label, td, p, .form-hint) {
    font-size: 0.82rem;
  }

  .app-shell.desktop-layout th,
  .app-shell.desktop-layout small {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout h2,
  .app-shell.desktop-layout .section-title h2 {
    font-size: 1.18rem;
  }

  .app-shell.desktop-layout .eyebrow {
    font-size: 0.72rem;
  }

  .app-shell.desktop-layout .toa-heading h2 {
    font-size: clamp(28px, 2vw, 38px);
  }

  .app-shell.desktop-layout .toa-filters {
    grid-template-columns: minmax(170px, 0.7fr) minmax(170px, 0.7fr) minmax(300px, 1.5fr) auto auto;
    gap: 14px;
  }

  .app-shell.desktop-layout .toa-table {
    min-width: 1120px;
  }

  .app-shell.desktop-layout .toa-table th,
  .app-shell.desktop-layout .toa-table td {
    padding: 15px 13px;
  }

  .app-shell.desktop-layout .toa-document-button {
    min-height: 64px;
  }
}

@media (min-width: 1600px) {
  .app-shell.desktop-layout .toa-table th {
    font-size: 0.76rem;
  }

  .app-shell.desktop-layout .toa-table td,
  .app-shell.desktop-layout .toa-document-button {
    font-size: 0.86rem;
  }
}
/* Elektro Install V1 — operacyjny pulpit dnia */
.ei-operations-panel {
  --ei-blue: #1574e8;
  --ei-blue-dark: #0b4c9c;
  --ei-cyan: #45a6f6;
  --ei-ink: #14243a;
  --ei-muted: #66758a;
  --ei-soft: #f4f8fd;
  --ei-line: #dce6f2;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  overflow: visible;
  padding: clamp(18px, 2vw, 30px) !important;
  border: 1px solid rgba(44, 118, 202, 0.13);
  background:
    radial-gradient(circle at 92% 0%, rgba(69, 166, 246, 0.13), transparent 27%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 18px 50px rgba(18, 54, 94, 0.09);
}

.ei-ops-header,
.ei-section-head,
.ei-plan-state,
.ei-project-main,
.ei-priority-banner,
.ei-request-row,
.ei-quick-actions button,
.ei-alert-list button {
  display: flex;
  align-items: center;
}

.ei-ops-header {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.ei-ops-header h2 {
  margin: 3px 0 4px;
  color: var(--ei-ink);
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
  letter-spacing: -0.035em;
}

.ei-ops-date {
  margin: 0;
  color: var(--ei-muted);
  font-weight: 650;
}

.ei-plan-state {
  min-width: min(100%, 420px);
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid #cfe1f6;
  border-radius: 14px;
  background: #f4f9ff;
}

.ei-plan-state > div { flex: 1; }
.ei-plan-state strong,
.ei-plan-state small { display: block; }
.ei-plan-state strong { color: #164e8d; font-size: .86rem; }
.ei-plan-state small { margin-top: 2px; color: #718198; font-size: .7rem; }

.ei-live-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #1ca66a;
  box-shadow: 0 0 0 5px rgba(28, 166, 106, .12);
}

.ei-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}

.ei-metric-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ei-line);
  border-radius: 15px;
  background: #fff;
}

.ei-metric-card .ei-metric-icon {
  grid-row: 1 / 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #226cb9;
  background: #eaf4ff;
  font-size: .8rem;
  font-weight: 900;
}

.ei-metric-card div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ei-metric-card b { color: var(--ei-ink); font-size: 1.32rem; letter-spacing: -.035em; }
.ei-metric-card div span { overflow: hidden; color: #40516a; font-size: .76rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.ei-metric-card small { color: #7b899b; font-size: .68rem; font-weight: 650; }
.ei-metric-primary { border-color: #8dc3fa; background: linear-gradient(145deg, #edf7ff, #fff); }
.ei-metric-primary .ei-metric-icon { color: #fff; background: linear-gradient(145deg, #1479f7, #4eaaf7); box-shadow: 0 8px 18px rgba(20, 121, 247, .22); }
.ei-metric-warning .ei-metric-icon { color: #9a5a00; background: #fff2d8; }

.ei-priority-banner {
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #f0d296;
  border-left: 4px solid #e49a13;
  border-radius: 13px;
  background: linear-gradient(90deg, #fffaf0, #fffdf9);
}

.ei-priority-banner > div { flex: 1; }
.ei-priority-banner strong { color: #573b0c; font-size: .88rem; }
.ei-priority-banner p { margin: 4px 0 0; color: #786441; font-size: .72rem; line-height: 1.45; }
.ei-priority-mark { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; color: #925b00; background: #ffe8b8; font-size: .62rem; font-weight: 900; letter-spacing: .08em; }

.ei-priority-banner[data-priority="urgent"] {
  border-color: #f5a3a8;
  border-left-color: #dc3545;
  background: linear-gradient(90deg, #fff3f4, #fffafa);
}
.ei-priority-banner[data-priority="urgent"] strong { color: #8f1721; }
.ei-priority-banner[data-priority="urgent"] p { color: #7d3b41; }
.ei-priority-banner[data-priority="urgent"] .ei-priority-mark { color: #fff; background: #dc3545; }
.ei-priority-banner[data-priority="important"] { border-left-color: #e49a13; }
.ei-priority-banner[data-priority="normal"] {
  border-color: #b8d7f6;
  border-left-color: #2185e8;
  background: linear-gradient(90deg, #f2f8ff, #fbfdff);
}
.ei-priority-banner[data-priority="normal"] strong { color: #174f82; }
.ei-priority-banner[data-priority="normal"] p { color: #496a88; }
.ei-priority-banner[data-priority="normal"] .ei-priority-mark { color: #0d64b5; background: #dceeff; }
.ei-priority-banner button:disabled { cursor: default; opacity: .72; box-shadow: none; }

.ei-ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
  gap: 14px;
  margin-top: 14px;
}

.ei-side-stack { display: grid; gap: 14px; align-content: start; }
.ei-workspace-card { min-width: 0; padding: 17px; border: 1px solid var(--ei-line); border-radius: 15px; background: rgba(255, 255, 255, .92); }
.ei-section-head { justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ei-section-head h3 { margin: 2px 0 0; color: var(--ei-ink); font-size: 1rem; }
.ei-section-head .eyebrow { margin: 0; color: #3881ce; }
.ei-section-head .text-button { border: 0; color: #2478cf; background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.ei-count-badge { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #a85f00; background: #fff0d4; font-size: .72rem; font-weight: 900; }

.ei-project-list { display: grid; gap: 8px; }
.ei-project-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.8fr) minmax(110px, .65fr) minmax(150px, .85fr) 30px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e4ebf4;
  border-left: 3px solid #55a6ed;
  border-radius: 12px;
  background: #fff;
  transition: transform .16s ease, box-shadow .16s ease;
}
.ei-project-row:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(28, 72, 119, .08); }
.ei-project-row[data-tone="priority"] { border-left-color: #e99b12; }
.ei-project-row[data-tone="warning"] { border-left-color: #efbf44; }
.ei-project-row[data-tone="neutral"] { border-left-color: #8a98a8; }
.ei-project-main { min-width: 0; gap: 10px; }
.ei-project-main > div { min-width: 0; }
.ei-project-main strong,
.ei-project-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-project-main strong { color: #172b46; font-size: .79rem; }
.ei-project-main small { margin-top: 3px; color: #738198; font-size: .65rem; }
.ei-project-code { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 10px; color: #1d6fc4; background: #eaf4ff; font-size: .7rem; font-weight: 900; }
.ei-project-staff { display: grid; grid-template-columns: auto 1fr; gap: 0 5px; align-items: baseline; }
.ei-project-staff b { color: #1b3554; font-size: .78rem; }
.ei-project-staff span { color: #8290a3; font-size: .62rem; }
.ei-project-staff i { grid-column: 1 / -1; display: block; height: 4px; margin-top: 5px; overflow: hidden; border-radius: 9px; background: #e8eef5; }
.ei-project-staff u { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d8be5, #69b8f6); text-decoration: none; }
.ei-project-assets { display: flex; flex-wrap: wrap; gap: 5px; }
.ei-project-assets span { padding: 4px 6px; border-radius: 6px; color: #48617d; background: #f0f5fa; font-size: .61rem; font-weight: 750; }
.ei-row-action { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #d9e7f6; border-radius: 8px; color: #2679ca; background: #f6faff; font-size: 1.15rem; cursor: pointer; }

.ei-alert-list { display: grid; }
.ei-alert-list button { width: 100%; gap: 9px; padding: 10px 2px; border: 0; border-bottom: 1px solid #edf1f6; text-align: left; background: transparent; cursor: pointer; }
.ei-alert-list button:last-child { border-bottom: 0; }
.ei-alert-list button > span:nth-child(2) { min-width: 0; flex: 1; }
.ei-alert-list b,
.ei-alert-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-alert-list b { color: #203650; font-size: .72rem; }
.ei-alert-list small { margin-top: 2px; color: #758397; font-size: .62rem; }
.ei-alert-list em { color: #916019; font-size: .6rem; font-style: normal; font-weight: 850; }
.ei-alert-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #4f9eee; box-shadow: 0 0 0 4px rgba(79, 158, 238, .12); }
.ei-alert-dot.warning { background: #e5a11b; box-shadow: 0 0 0 4px rgba(229, 161, 27, .12); }
.ei-alert-dot.danger { background: #dd4b50; box-shadow: 0 0 0 4px rgba(221, 75, 80, .12); }

.ei-warehouse-card { background: linear-gradient(145deg, #f7fbff, #fff); }
.ei-request-row { gap: 10px; padding: 10px 0; border-top: 1px solid #e7edf4; }
.ei-request-row > div { min-width: 0; flex: 1; }
.ei-request-row b,
.ei-request-row small { display: block; }
.ei-request-row b { color: #243b56; font-size: .7rem; }
.ei-request-row small { margin-top: 2px; color: #78869a; font-size: .61rem; }
.ei-request-row em { padding: 4px 6px; border-radius: 6px; color: #296da8; background: #e8f4ff; font-size: .56rem; font-style: normal; font-weight: 850; }
.ei-request-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #1f75d1, #55aaf1); font-size: .62rem; font-weight: 900; }

.ei-contacts-card { background: linear-gradient(145deg, #fff, #f7fbff); }
.ei-contact-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid #e8eef5; color: inherit; text-decoration: none; }
.ei-contact-row > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; color: #1768b7; background: #e5f2ff; font-size: .58rem; font-weight: 900; }
.ei-contact-row > div { min-width: 0; flex: 1; }
.ei-contact-row b,
.ei-contact-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-contact-row b { color: #213752; font-size: .69rem; }
.ei-contact-row small { margin-top: 2px; color: #7b889b; font-size: .59rem; }
.ei-contact-row em { color: #1772c8; font-size: .62rem; font-style: normal; font-weight: 850; white-space: nowrap; }

.ei-quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ei-quick-actions button { min-width: 0; gap: 9px; padding: 11px; border: 1px solid #d9e5f1; border-radius: 12px; text-align: left; background: #fff; cursor: pointer; }
.ei-quick-actions button > span { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 9px; color: #1c75ce; background: #e9f4ff; font-size: .75rem; font-weight: 900; }
.ei-quick-actions b,
.ei-quick-actions small { display: block; }
.ei-quick-actions b { color: #213752; font-size: .69rem; }
.ei-quick-actions small { margin-top: 2px; color: #8390a2; font-size: .58rem; }

.ei-modal { position: fixed; z-index: 10010; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(7, 20, 36, .62); backdrop-filter: blur(6px); }
.ei-modal[hidden] { display: none; }
.ei-modal-card { width: min(100%, 540px); overflow: hidden; border: 1px solid rgba(255, 255, 255, .2); border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
.ei-modal-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 19px 21px; border-bottom: 1px solid #e5ecf4; background: linear-gradient(145deg, #f5faff, #fff); }
.ei-modal-card h2 { margin: 3px 0 0; color: #162b46; font-size: 1.1rem; }
.ei-modal-card header button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: #68768a; background: #edf2f7; font-size: 1.2rem; cursor: pointer; }
.ei-modal-card form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 21px; }
.ei-modal-card label { display: grid; gap: 6px; color: #42546d; font-size: .72rem; font-weight: 800; }
.ei-modal-card label:nth-child(3),
.ei-modal-actions { grid-column: 1 / -1; }
.ei-modal-card :is(select, textarea) { width: 100%; border: 1px solid #ccd9e7; border-radius: 10px; color: #172a42; background: #fff; }
.ei-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; }

body.theme-dark .ei-operations-panel {
  --ei-ink: #edf5ff;
  --ei-muted: #9eafc4;
  --ei-line: #334154;
  background: radial-gradient(circle at 92% 0%, rgba(44, 133, 224, .16), transparent 26%), linear-gradient(180deg, #172231, #141e2b);
}
body.theme-dark .ei-plan-state,
body.theme-dark .ei-metric-card,
body.theme-dark .ei-workspace-card,
body.theme-dark .ei-project-row,
body.theme-dark .ei-quick-actions button { border-color: #33445a; background: #1b2838; }
body.theme-dark .ei-plan-state { background: #172a40; }
body.theme-dark .ei-project-main strong,
body.theme-dark .ei-project-staff b,
body.theme-dark .ei-section-head h3,
body.theme-dark .ei-metric-card b,
body.theme-dark .ei-quick-actions b,
body.theme-dark .ei-alert-list b,
body.theme-dark .ei-request-row b { color: #edf5ff; }
body.theme-dark .ei-priority-banner { border-color: #7c5a1f; background: #302713; }
body.theme-dark .ei-priority-banner strong { color: #ffe1a7; }
body.theme-dark .ei-priority-banner p { color: #d1b77f; }
body.theme-dark .ei-alert-list button,
body.theme-dark .ei-request-row { border-color: #2d3c50; }

.ei-immutable-note {
  margin: 0 0 12px;
  color: #66778c;
  font-size: 12px;
  line-height: 1.45;
}

.ei-warehouse-request-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
}

.ei-warehouse-request {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fff;
}

.ei-warehouse-request.is-archived { opacity: .7; }
.ei-warehouse-request .ei-request-avatar { width: 42px; height: 42px; }
.ei-warehouse-request-copy { min-width: 0; }
.ei-warehouse-request-copy b { display: block; color: #132238; }
.ei-warehouse-request-copy small { display: block; margin-top: 4px; color: #687a90; line-height: 1.4; }
.ei-warehouse-request-state { display: grid; justify-items: end; gap: 7px; }
.ei-warehouse-request-state em { font-style: normal; font-size: 11px; font-weight: 900; color: #1d65b8; text-transform: uppercase; }
.ei-warehouse-request-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ei-warehouse-request-actions button { min-height: 34px; padding: 7px 10px; border: 0; border-radius: 9px; background: #126dd8; color: #fff; font-weight: 800; cursor: pointer; }
.ei-warehouse-request-actions button[data-warehouse-action="archive"] { background: #34465b; }

body.theme-dark .ei-immutable-note,
body.theme-dark .ei-warehouse-request-copy small { color: #9fb0c4; }
body.theme-dark .ei-warehouse-request { border-color: #2d3c50; background: #172536; }
body.theme-dark .ei-warehouse-request-copy b { color: #edf5ff; }

@media (max-width: 560px) {
  .ei-warehouse-request { grid-template-columns: 38px minmax(0, 1fr); }
  .ei-warehouse-request-state { grid-column: 1 / -1; justify-items: stretch; }
  .ei-warehouse-request-actions { justify-content: stretch; }
  .ei-warehouse-request-actions button { flex: 1; }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout .ei-operations-panel { grid-column: 2 / -1 !important; }
  body.desktop-menu-collapsed .app-shell.desktop-layout .ei-operations-panel { grid-column: 1 / -1 !important; }
  .app-shell.desktop-layout.home-route-layout #eiOperationsPanel { order: -100; }
}

@media (max-width: 1180px) {
  .ei-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ei-ops-layout { grid-template-columns: 1fr; }
  .ei-side-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .ei-operations-panel { padding: 15px !important; border-radius: 16px !important; }
  .ei-ops-header { align-items: flex-start; flex-direction: column; }
  .ei-plan-state { width: 100%; min-width: 0; flex-wrap: wrap; }
  .ei-plan-state .small-button { width: 100%; }
  .ei-metric-grid { gap: 8px; }
  .ei-metric-card { grid-template-columns: 35px 1fr; padding: 12px; }
  .ei-metric-card .ei-metric-icon { width: 35px; height: 35px; }
  .ei-metric-card div { display: grid; gap: 0; }
  .ei-metric-card b { font-size: 1.05rem; }
  .ei-metric-card div span { font-size: .65rem; }
  .ei-priority-banner { align-items: flex-start; flex-wrap: wrap; }
  .ei-priority-mark { order: 0; }
  .ei-priority-banner > div { flex-basis: calc(100% - 96px); }
  .ei-priority-banner button { width: 100%; }
  .ei-side-stack { grid-template-columns: 1fr; }
  .ei-project-row { grid-template-columns: 1fr auto; }
  .ei-project-staff { grid-column: 1 / -1; }
  .ei-project-assets { grid-column: 1; }
  .ei-row-action { grid-column: 2; grid-row: 1; }
  .ei-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ei-modal-card form { grid-template-columns: 1fr; }
  .ei-modal-card label:nth-child(3), .ei-modal-actions { grid-column: 1; }
}

@media (max-width: 430px) {
  .ei-metric-grid { grid-template-columns: 1fr; }
  .ei-metric-card { grid-template-columns: 38px 1fr auto; align-items: center; }
  .ei-metric-card .ei-metric-icon { grid-row: auto; }
  .ei-metric-card small { text-align: right; }
  .ei-priority-banner > div { flex-basis: 100%; }
  .ei-quick-actions { grid-template-columns: 1fr; }
}

/* Dopasowanie szerokiego znaku Elektro Install do gotowych ramek V9.60. */
.side-logo-frame {
  width: 142px !important;
  height: 34px !important;
  flex: 0 0 142px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.side-logo-frame img {
  width: 142px !important;
  height: 34px !important;
  object-fit: contain !important;
}
.side-brand .vacation-intro-copy { display: none; }
.login-logo {
  width: min(84vw, 320px) !important;
  height: 68px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.login-logo img {
  width: 100% !important;
  height: 68px !important;
  object-fit: contain !important;
}

/* V0.03 - ekran logowania zgodny z identyfikacją Elektro Install. */
#loginDialog {
  width: min(calc(100% - 28px), 460px);
  padding: 0 32px 26px;
  overflow: hidden;
  border: 1px solid rgba(126, 177, 232, .42);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(4, 29, 55, .42);
}

#loginDialog::backdrop {
  background-color: #0a2d50;
  background-image:
    radial-gradient(circle at 78% 18%, rgba(111, 178, 234, .42), transparent 34%),
    radial-gradient(circle at 12% 82%, rgba(30, 116, 190, .34), transparent 36%),
    linear-gradient(135deg, rgba(7, 39, 70, .97), rgba(20, 88, 145, .90));
  background-repeat: no-repeat;
  background-size: cover;
}

#loginDialog .login-logo {
  display: grid;
  width: calc(100% + 64px) !important;
  height: 128px !important;
  place-items: center;
  margin: 0 -32px !important;
  padding: 26px 38px 22px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 82% 15%, rgba(134, 200, 255, .36), transparent 28%),
    linear-gradient(135deg, #082f57 0%, #0c5f9f 58%, #75afe7 100%) !important;
}

#loginDialog .login-logo img {
  width: min(100%, 340px) !important;
  height: 74px !important;
  filter: drop-shadow(0 8px 18px rgba(1, 24, 48, .28));
}

#loginDialog .login-intro {
  margin-top: 24px;
  text-align: left;
}

#loginDialog .login-product-name {
  margin: 0;
  color: #6da7e5 !important;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .2em !important;
}

#loginDialog .login-intro h2 {
  margin: 7px 0 5px;
  color: #092c4f;
  font-size: clamp(1.32rem, 5vw, 1.72rem);
  line-height: 1.12;
  text-align: left;
}

#loginDialog .login-intro > p:last-child {
  margin: 0;
  color: #657b91;
  font-size: .78rem;
  line-height: 1.45;
}

#loginDialog form {
  margin-top: 22px;
}

#loginDialog form > label:not(.remember-password) {
  color: #183956;
  font-size: .72rem;
  font-weight: 850;
}

#loginDialog form > label:not(.remember-password) input {
  min-height: 48px;
  margin-top: 7px;
  border: 1px solid #c7d9ea;
  border-radius: 11px;
  color: #112e49;
  background: #f5f9fd;
  box-shadow: inset 0 1px 2px rgba(5, 43, 76, .04);
}

#loginDialog form > label:not(.remember-password) input:focus {
  border-color: #65a8e8;
  outline: 3px solid rgba(101, 168, 232, .18);
  background: #ffffff;
}

#loginDialog .remember-password {
  color: #526b82;
  font-size: .7rem;
}

#loginDialog .remember-password input {
  accent-color: #1478c8;
}

#loginDialog .primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #0b4e89, #147fcf 58%, #71ace6);
  box-shadow: 0 14px 28px rgba(20, 121, 199, .25);
}

#loginDialog .primary-button:hover,
#loginDialog .primary-button:focus-visible {
  background: linear-gradient(135deg, #083e70, #0f6eb9 58%, #5c9fdf);
  transform: translateY(-1px);
}

#loginDialog .login-version {
  margin-top: 16px;
  color: #7890a5;
  letter-spacing: .1em;
}

/* V0.03 - role działowe w układzie organizacyjnym Elektro Install. */
.role-department-grid,
.admin-user-create-access .role-department-grid,
.admin-user-role-panel .role-department-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* V0.03 - wnioski urlopowe oraz najważniejsze badania i uprawnienia. */
.training-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.training-quick-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--opsui-border);
  border-top: 4px solid #1689e8;
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface-muted);
}

.training-quick-card[data-tone="warning"] { border-top-color: #eab308; }
.training-quick-card[data-tone="expired"],
.training-quick-card[data-tone="missing"] { border-top-color: #ef4444; }
.training-quick-card[data-tone="valid"] { border-top-color: #16a34a; }
.training-quick-card[data-tone="other"] { border-top-color: #64748b; }

.training-quick-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #0756a3, #1689e8);
  font-size: 1.1rem;
  font-weight: 950;
}

.training-quick-card > div,
.training-quick-card b,
.training-quick-card small,
.training-quick-card em {
  display: block;
  min-width: 0;
}

.training-quick-card b {
  color: var(--opsui-text);
  font-size: 0.98rem;
}

.training-quick-card small {
  min-height: 34px;
  margin-top: 4px;
  color: var(--opsui-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.training-quick-card em {
  margin-top: 8px;
  color: var(--opsui-text);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
}

.training-quick-card > button {
  grid-column: 1 / -1;
  min-height: 40px;
  border: 1px solid var(--opsui-primary);
  border-radius: 10px;
  color: var(--opsui-primary);
  background: var(--opsui-surface);
  font-weight: 900;
}

.vacation-legend .legend-pending i,
.vacation-legend-dot.pending,
.vacation-day-signals .vacation-day-signal.pending {
  border-color: #d97706;
  background: #f59e0b;
}

#vacationPanel .vacation-calendar .vacation-day.vacation-pending {
  border: 2px dashed #d97706;
  background: rgba(245, 158, 11, 0.12);
}

.vacation-requests-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius);
  background: var(--opsui-surface);
}

.vacation-requests-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.vacation-request-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1.4fr) minmax(140px, auto) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--opsui-border);
  border-left: 5px solid #f59e0b;
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-muted);
}

.vacation-request-row[data-status="approved"] { border-left-color: #16a34a; }
.vacation-request-row[data-status="rejected"],
.vacation-request-row[data-status="cancelled"] { border-left-color: #ef4444; }

.vacation-request-date,
.vacation-request-date b,
.vacation-request-date small,
.vacation-request-person,
.vacation-request-person b,
.vacation-request-person small {
  display: block;
  min-width: 0;
}

.vacation-request-row small {
  margin-top: 3px;
  color: var(--opsui-muted);
  font-size: 0.72rem;
}

.vacation-request-row > em {
  padding: 6px 9px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.vacation-request-row[data-status="approved"] > em {
  color: #166534;
  background: #dcfce7;
}

.vacation-request-row[data-status="rejected"] > em,
.vacation-request-row[data-status="cancelled"] > em {
  color: #991b1b;
  background: #fee2e2;
}

.vacation-request-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.vacation-request-archive {
  margin-top: 10px;
  border: 1px solid var(--opsui-border);
  border-radius: var(--opsui-radius-small);
  background: var(--opsui-surface-muted);
  overflow: hidden;
}

.vacation-request-archive > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--opsui-text);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}

.vacation-request-archive > summary b {
  min-width: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--opsui-muted);
  background: var(--opsui-surface);
  text-align: center;
}

.vacation-request-archive-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.vacation-request-archive-list .vacation-request-row {
  opacity: 0.82;
  background: var(--opsui-surface);
}

@media (max-width: 1180px) {
  .training-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vacation-request-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .training-quick-grid,
  .vacation-request-row {
    grid-template-columns: 1fr;
  }

  .vacation-request-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.role-checkbox-grid label[data-role-card],
.boss-role-option[data-role-card] {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 76px;
  align-items: start;
  padding: 13px;
  border: 1px solid #cfdeec;
  border-radius: 12px;
  color: #143759 !important;
  background: rgba(255, 255, 255, .92);
  text-transform: none;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.role-checkbox-grid label[data-role-card]:hover,
.boss-role-option[data-role-card]:hover {
  border-color: #76ade5;
  box-shadow: 0 9px 24px rgba(36, 105, 168, .12);
  transform: translateY(-1px);
}

.role-checkbox-grid label[data-role-card]:has(input:checked),
.boss-role-option[data-role-card]:has(input:checked) {
  border-color: #65a4e5;
  background: linear-gradient(135deg, #eef7ff, #ffffff);
  box-shadow: inset 4px 0 #75ade7, 0 8px 22px rgba(35, 111, 180, .12);
}

.role-checkbox-grid label[data-role-card] input,
.boss-role-option[data-role-card] input {
  width: 18px !important;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #1478c8;
}

.role-checkbox-grid label[data-role-card] span,
.boss-role-option[data-role-card] span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.role-checkbox-grid label[data-role-card] b,
.boss-role-option[data-role-card] b {
  color: #74a8e3;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.role-checkbox-grid label[data-role-card] small,
.boss-role-option[data-role-card] small {
  color: #647a90;
  font-size: .67rem;
  font-weight: 650;
  line-height: 1.38;
}

.boss-role-option[data-role-card] {
  width: 100%;
  margin-top: 10px;
}

.role-department-grid > button {
  grid-column: 1 / -1;
}

body.theme-dark .role-checkbox-grid label[data-role-card],
body.theme-dark .boss-role-option[data-role-card] {
  border-color: #314d68;
  color: #e7f2fc !important;
  background: #152a3e;
}

body.theme-dark .role-checkbox-grid label[data-role-card]:has(input:checked),
body.theme-dark .boss-role-option[data-role-card]:has(input:checked) {
  border-color: #69a8e6;
  background: linear-gradient(135deg, #173a59, #14283b);
}

body.theme-dark .role-checkbox-grid label[data-role-card] small,
body.theme-dark .boss-role-option[data-role-card] small {
  color: #adc0d2;
}

.guide-department-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-color: #d4e2ef;
  background:
    linear-gradient(135deg, rgba(232, 245, 255, .78), rgba(255, 255, 255, .96));
}

.guide-department-card > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 5px;
  color: white;
  background: #79ade8;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: none;
}

.guide-department-card small {
  display: block;
  margin-bottom: 4px;
  color: #6b89a5;
  font-size: .66rem;
  font-weight: 800;
}

.guide-department-card h3 {
  margin: 0;
  color: #73a7e5;
  font-size: 1rem;
}

.guide-department-card p {
  margin: 7px 0 0;
}

.guide-personal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-personal-workflow {
  overflow: hidden;
  border: 1px solid #d5e2ee;
  border-radius: 15px;
  background: #ffffff;
}

.guide-personal-workflow > header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #eaf5ff, #f9fcff);
}

.guide-personal-workflow > header > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: #79ade8;
  font-weight: 950;
}

.guide-personal-workflow header small {
  color: #718ba3;
  font-size: .62rem;
  font-weight: 800;
}

.guide-personal-workflow h3 {
  margin: 2px 0 0;
  color: #174a77;
  font-size: .9rem;
}

.guide-personal-workflow ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 6px 16px 14px;
  list-style: none;
}

.guide-personal-workflow li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}

.guide-personal-workflow li:last-child { border-bottom: 0; }
.guide-personal-workflow li b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #1769ae;
  background: #e5f2ff;
  font-size: .7rem;
}
.guide-personal-workflow li p { margin: 3px 0 0; line-height: 1.42; }

body.theme-dark .guide-department-card,
body.theme-dark .guide-personal-workflow {
  border-color: #2f465e;
  background: #142639;
}
body.theme-dark .guide-personal-workflow > header { background: linear-gradient(135deg, #173956, #172b40); }
body.theme-dark .guide-personal-workflow li { border-bottom-color: #293f55; }
body.theme-dark .guide-personal-workflow h3 { color: #a9d2fa; }

@media (max-width: 700px) {
  #loginDialog { padding-right: 22px; padding-left: 22px; }
  #loginDialog .login-logo { width: calc(100% + 44px) !important; margin-right: -22px !important; margin-left: -22px !important; padding-right: 24px; padding-left: 24px; }
  .role-department-grid,
  .admin-user-create-access .role-department-grid,
  .admin-user-role-panel .role-department-grid,
  .guide-personal-grid { grid-template-columns: 1fr; }
}

/* V0.04 - jedna rola na konto i szybkie przypisanie zasobów do budowy. */
.single-role-grid input[type="radio"] {
  accent-color: #1479f7;
}

.single-role-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d8e5f2;
  border-radius: 16px;
  background: #f7fbff;
}

.single-role-editor label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #16314d;
}

.single-role-editor select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #b9cde1;
  border-radius: 11px;
  background: #fff;
  color: #102b46;
  font: inherit;
}

.single-role-editor p {
  margin: 0;
  color: #5d7186;
  font-size: .86rem;
}

.admin-farm-assignment-card.is-new-farm {
  border-color: #1479f7;
  box-shadow: 0 0 0 3px rgba(20, 121, 247, .12), 0 18px 42px rgba(15, 63, 108, .12);
}

.admin-farm-assignment-card.is-new-farm > summary {
  background: linear-gradient(135deg, #edf7ff, #fff);
}

body.theme-dark .single-role-editor {
  border-color: #2f465e;
  background: #142639;
}

body.theme-dark .single-role-editor label { color: #d7ebff; }
body.theme-dark .single-role-editor select {
  border-color: #3b5570;
  background: #0f2031;
  color: #eef7ff;
}
body.theme-dark .single-role-editor p { color: #9eb5ca; }

/* Elektro Install V0.07 - poprawki ciezkiego sprzetu, podwykonawcow i panelu Pracownika. */

/* Elektro Install V0.08 - uproszczony panel roli Pracownik. */
.technician-vacation-range-form,
.technician-sick-leave-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(140px, 0.45fr));
  gap: 14px;
  align-items: end;
  border: 1px solid rgba(67, 145, 245, 0.24);
  border-radius: 22px;
  background: rgba(67, 145, 245, 0.08);
  padding: 16px;
  margin: 14px 0 18px;
}

.technician-sick-leave-form {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.07);
}

.technician-vacation-range-form h3,
.technician-sick-leave-form h3 {
  margin: 4px 0;
}

.technician-vacation-range-form .error-message,
.technician-sick-leave-form .error-message,
.technician-sick-leave-form .full-width {
  grid-column: 1 / -1;
}

body:not(.theme-dark) .technician-vacation-range-form {
  background: #f7fbff;
}

body:not(.theme-dark) .technician-sick-leave-form {
  background: #fff8f8;
}

#vacationPanel .vacation-calendar .vacation-day.technician-vacation-range {
  border-color: #4391f5;
  background: linear-gradient(135deg, rgba(67, 145, 245, 0.18), rgba(67, 145, 245, 0.08));
  color: var(--text-strong, #071327);
  box-shadow: inset 0 0 0 1px rgba(67, 145, 245, 0.35);
}

#vacationPanel .vacation-calendar .vacation-day.technician-vacation-range-start,
#vacationPanel .vacation-calendar .vacation-day.technician-vacation-range-end {
  background: linear-gradient(135deg, #4391f5, #1677f2);
  color: #fff;
  border-color: #1677f2;
}

body.theme-dark #vacationPanel .vacation-calendar .vacation-day.technician-vacation-range {
  background: linear-gradient(135deg, rgba(67, 145, 245, 0.34), rgba(67, 145, 245, 0.16));
  border-color: rgba(67, 145, 245, 0.85);
  color: #f8fbff;
}

body.theme-dark #vacationPanel .vacation-calendar .vacation-day.technician-vacation-range-start,
body.theme-dark #vacationPanel .vacation-calendar .vacation-day.technician-vacation-range-end {
  background: linear-gradient(135deg, #4391f5, #1677f2);
  border-color: #73adff;
  color: #fff;
}

.technician-simple-panel {
  max-width: 980px;
  margin-inline: auto;
}

.technician-simple-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.technician-simple-header h2 {
  margin: 4px 0 4px;
}

.technician-simple-badge {
  border: 1px solid rgba(67, 145, 245, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--accent-blue, #4391f5);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.technician-day-content,
.technician-warehouse-panel {
  display: grid;
  gap: 16px;
}

.technician-earnings-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(67, 145, 245, 0.22);
  border-radius: 24px;
  background: rgba(67, 145, 245, 0.08);
  padding: 18px;
  margin-bottom: 16px;
}

.technician-summary-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.technician-summary-top h3 {
  margin: 4px 0 0;
}

.technician-summary-top label {
  min-width: 190px;
}

.technician-summary-grid,
.technician-summary-docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.technician-summary-card,
.technician-doc-card,
.technician-sick-leave-row {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(67, 145, 245, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.technician-summary-card span,
.technician-doc-card span {
  color: var(--accent-blue, #4391f5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.technician-summary-card b,
.technician-doc-card b {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.technician-summary-card small,
.technician-doc-card small,
.technician-sick-leave-row small {
  color: var(--text-muted, #66758a);
}

.technician-summary-card.tone-money {
  border-color: rgba(22, 163, 74, 0.32);
  background: rgba(22, 163, 74, 0.08);
}

.technician-summary-card.technician-earnings-secret {
  width: 100%;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.technician-earnings-secret .technician-earnings-value { display: none; }
.technician-earnings-secret.is-revealed .technician-earnings-mask { display: none; }
.technician-earnings-secret.is-revealed .technician-earnings-value { display: inline; }
.technician-earnings-secret:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.34);
  outline-offset: 2px;
}

.technician-doc-card.tone-good {
  border-color: rgba(22, 163, 74, 0.28);
}

.technician-doc-card.tone-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.technician-doc-card.tone-danger {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.09);
}

.technician-sick-leave-list {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: 24px;
  padding: 16px;
  margin: 12px 0 18px;
}

.technician-sick-leave-row {
  grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1fr) auto;
  align-items: center;
}

.technician-sick-leave-list.office-view .technician-sick-leave-row {
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.8fr) minmax(0, 1fr) auto;
}

.technician-sick-leave-row em {
  justify-self: end;
  border-radius: 999px;
  background: rgba(67, 145, 245, 0.12);
  color: var(--accent-blue, #4391f5);
  padding: 7px 10px;
  font-style: normal;
  font-weight: 900;
  font-size: 0.78rem;
}

.technician-site-card,
.technician-empty-day,
.technician-request-history {
  border: 1px solid rgba(67, 145, 245, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
}

.technician-site-main {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.technician-site-main > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1479f7, #75aaf4);
  color: white;
  font-weight: 900;
}

.technician-site-main small,
.technician-site-detail b,
.technician-message-list b {
  color: var(--accent-blue, #4391f5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.technician-site-main strong {
  display: block;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  line-height: 1.04;
}

.technician-site-main p {
  margin: 8px 0 0;
}

.technician-site-detail {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  background: rgba(67, 145, 245, 0.08);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.technician-work-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(67, 145, 245, 0.22);
  border-radius: 22px;
  background: rgba(67, 145, 245, 0.08);
  padding: 16px;
}

.technician-work-status-card.is-working {
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(22, 163, 74, 0.1);
}

.technician-work-status-card.is-stopped {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.technician-work-status-card span,
.technician-work-status-card b,
.technician-work-status-card small {
  display: block;
}

.technician-work-status-card span {
  color: var(--accent-blue, #4391f5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
}

.technician-work-status-card b {
  margin-top: 4px;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
}

.technician-work-status-card small {
  margin-top: 4px;
  color: var(--text-muted, #66758a);
}

.technician-work-status-card button {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #1479f7, #4391f5);
  color: white;
  padding: 12px 16px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.technician-work-status-card.is-working button {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.technician-work-status-card.is-stopped button {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}

.technician-route-guide {
  border: 1px solid rgba(67, 145, 245, 0.2);
  border-radius: 22px;
  background: rgba(67, 145, 245, 0.07);
  padding: 16px 18px;
}

.technician-route-guide b {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-blue, #4391f5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 900;
}

.technician-route-guide ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted, #66758a);
  line-height: 1.45;
}

.technician-route-guide li + li {
  margin-top: 4px;
}

.technician-message-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.technician-message-list li {
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.technician-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.technician-action-grid button {
  min-height: 64px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #1479f7, #4391f5);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.technician-action-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  background: rgba(148, 163, 184, 0.22);
}

.technician-warehouse-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 1px solid rgba(67, 145, 245, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
}

.technician-warehouse-farm-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.technician-warehouse-farm-field label {
  min-width: 0;
}

.technician-warehouse-farm-field button {
  grid-column: auto;
  min-height: 46px;
  white-space: nowrap;
}

.technician-warehouse-farm-field button.is-active {
  border-color: rgba(245, 158, 11, 0.42);
  color: #9a5b00;
  background: rgba(245, 158, 11, 0.13);
}

.technician-warehouse-form .full-width,
.technician-warehouse-form .error-message {
  grid-column: 1 / -1;
}

.technician-warehouse-form > button[type="submit"] {
  grid-column: 1 / -1;
}

.bottom-nav-simple-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: currentColor;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

/* V0.12: duze, czytelne sterowanie dolne dla konta Pracownika. */
.app-shell.technician-account.route-mode-active {
  padding-bottom: max(142px, calc(122px + env(safe-area-inset-bottom)));
}

.app-shell.technician-account .bottom-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 96px;
  padding: 9px;
  border-radius: 30px;
}

.app-shell.technician-account .bottom-nav-item {
  gap: 5px;
  min-height: 78px;
  padding: 10px 6px;
  border-radius: 22px;
  font-size: 0.82rem;
  font-weight: 900;
}

.app-shell.technician-account [data-app-route="alerts"] {
  display: none !important;
}

.app-shell.technician-account .bottom-nav-item svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.25;
}

.app-shell.technician-account .bottom-nav-item > span:last-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.05;
}

.app-shell.technician-account .bottom-nav-simple-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.9rem;
}

body.theme-dark .app-shell.technician-account .bottom-nav-item[data-app-route="timeClock"].is-working {
  color: #ffffff !important;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  box-shadow:
    0 0 0 2px rgba(74, 222, 128, 0.36),
    0 12px 28px rgba(22, 163, 74, 0.48) !important;
}

@media (max-width: 380px) {
  .app-shell.technician-account .bottom-nav {
    right: 6px;
    left: 6px;
    width: calc(100% - 12px);
  }

  .app-shell.technician-account .bottom-nav-item {
    min-height: 74px;
    font-size: 0.82rem;
  }
}

body:not(.theme-dark) .technician-site-card,
body:not(.theme-dark) .technician-empty-day,
body:not(.theme-dark) .technician-request-history,
body:not(.theme-dark) .technician-warehouse-form,
body:not(.theme-dark) .technician-summary-card,
body:not(.theme-dark) .technician-doc-card,
body:not(.theme-dark) .technician-sick-leave-row {
  background: #fff;
}

@media (max-width: 720px) {
  .technician-simple-header,
  .technician-action-grid,
  .technician-vacation-range-form,
  .technician-sick-leave-form,
  .technician-warehouse-form,
  .technician-summary-top,
  .technician-summary-grid,
  .technician-summary-docs,
  .technician-sick-leave-row,
  .technician-work-status-card {
    grid-template-columns: 1fr;
  }

  .technician-simple-header {
    display: grid;
  }

  .technician-summary-top {
    display: grid;
  }

  .technician-action-grid {
    display: grid;
  }

  .technician-work-status-card {
    display: grid;
  }

  .technician-work-status-card button {
    width: 100%;
  }

  .technician-sick-leave-row em {
    justify-self: start;
  }
}
.heavy-equipment-panel .section-title small,
.subcontractors-panel .section-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
}

.heavy-equipment-form,
.subcontractor-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.heavy-equipment-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}

.heavy-equipment-item,
.subcontractor-item {
  border-left: 4px solid #2563eb;
}

.heavy-equipment-item[data-urgency="urgent"],
.heavy-equipment-item[data-urgency="late"],
.subcontractor-item[data-status="blocked"] {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), transparent 40%);
}

.heavy-equipment-item[data-urgency="planned"],
.subcontractor-item[data-status="planned"] {
  border-left-color: #f59e0b;
}

.subcontractor-item[data-status="active"] {
  border-left-color: #10b981;
}

.subcontractor-company-heading,
.subcontractor-people-heading,
.warehouse-withdrawals-header,
.warehouse-withdrawal-farm > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.subcontractor-company-heading > div,
.subcontractor-person-row summary > span { display: grid; gap: 3px; }
.subcontractor-company-heading small,
.subcontractor-person-row small { color: var(--muted, #64748b); }
.subcontractor-people-block { grid-column: 1 / -1; margin-top: 12px; border-top: 1px solid #dbe5f0; padding-top: 12px; }
.subcontractor-people-heading span { min-width: 30px; padding: 4px 10px; border-radius: 999px; background: #e8f2ff; text-align: center; font-weight: 800; }
.subcontractor-people-list { display: grid; gap: 8px; margin-top: 10px; }
.subcontractor-person-row { border: 1px solid #d6e0ec; border-radius: 12px; background: #fff; }
.subcontractor-person-row summary,
.subcontractor-add-person > summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 800; }
.subcontractor-person-row summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subcontractor-person-row summary em { font-style: normal; color: #36516f; white-space: nowrap; }
.subcontractor-add-person { margin-top: 10px; border: 1px dashed #1f7fe5; border-radius: 12px; background: #f5f9ff; }
.subcontractor-person-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border-top: 1px solid #dbe5f0; }
.subcontractor-person-form label { display: grid; gap: 5px; font-weight: 700; }
.subcontractor-person-form .wide { grid-column: span 2; }
.subcontractor-person-actions { display: flex; align-items: end; gap: 8px; }

.warehouse-withdrawals-panel { display: grid; gap: 18px; }
.warehouse-withdrawals-header small { display: block; max-width: 780px; margin-top: 5px; color: #5e7085; }
.warehouse-withdrawals-toolbar { display: grid; grid-template-columns: 170px minmax(220px, 1fr) minmax(280px, 2fr) auto auto auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid #d5e0ed; border-radius: 14px; background: #f7faff; }
.warehouse-withdrawals-toolbar label,
.warehouse-withdrawal-form label { display: grid; gap: 5px; font-weight: 800; }
.warehouse-withdrawal-form { display: grid; grid-template-columns: 150px minmax(200px, 1fr) minmax(200px, 1fr) minmax(240px, 1.5fr) 110px 110px; gap: 10px; align-items: end; padding: 16px; border-radius: 14px; background: #eef6ff; border: 1px solid #a9cdf5; }
.warehouse-withdrawal-form .wide { grid-column: span 4; }
.warehouse-withdrawal-list { display: grid; gap: 14px; }
.warehouse-withdrawal-farm { border: 1px solid #d5e0ed; border-radius: 14px; overflow: hidden; background: #fff; }
.warehouse-withdrawal-farm > header { padding: 14px 16px; background: #eef5fd; }
.warehouse-withdrawal-farm > header h3 { margin: 2px 0 0; }
.warehouse-withdrawal-day { padding: 14px 16px; border-top: 1px solid #e2e8f0; }
.warehouse-withdrawal-day h4 { margin: 0 0 8px; }
.warehouse-withdrawal-day table { width: 100%; border-collapse: collapse; }
.warehouse-withdrawal-day th,
.warehouse-withdrawal-day td { padding: 9px 10px; border-bottom: 1px solid #e5ebf2; text-align: left; vertical-align: top; }
.warehouse-withdrawal-day th { color: #52657a; font-size: .76rem; letter-spacing: .05em; }
.warehouse-withdrawal-day td small { display: block; color: #64748b; }

@media (max-width: 1100px) {
  .warehouse-withdrawals-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-withdrawal-search { grid-column: 1 / -1; }
  .warehouse-withdrawal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-withdrawal-form .wide { grid-column: 1 / -1; }
  .subcontractor-person-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .warehouse-withdrawals-header,
  .warehouse-withdrawal-farm > header,
  .subcontractor-company-heading,
  .subcontractor-person-row summary { align-items: flex-start; flex-direction: column; }
  .warehouse-withdrawals-toolbar,
  .warehouse-withdrawal-form,
  .subcontractor-person-form { grid-template-columns: 1fr; }
  .warehouse-withdrawals-toolbar > *,
  .warehouse-withdrawal-form .wide,
  .subcontractor-person-form .wide { grid-column: 1; }
  .warehouse-withdrawal-day { padding: 12px; }
  .warehouse-withdrawal-day .inventory-table-wrap { overflow-x: auto; }
  .warehouse-withdrawal-day table { min-width: 720px; }
}

.heavy-equipment-history {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.heavy-equipment-history small {
  color: var(--muted, #64748b);
  line-height: 1.35;
}

/* V0.13: osobna, czytelna Karta pracy Pracownika. */
.technician-work-card-panel {
  width: min(100%, var(--ops-page-width, 1480px));
  margin-inline: auto;
}

.technician-work-card-title {
  align-items: end;
}

.technician-work-card-title small {
  display: block;
  margin-top: 5px;
  color: var(--opsui-muted, #64748b);
}

.technician-work-card-month-nav {
  display: grid;
  grid-template-columns: 52px minmax(170px, 220px) 52px;
  gap: 9px;
  align-items: end;
}

.technician-work-card-month-nav > button {
  min-width: 52px;
  min-height: 52px;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 15px;
  color: var(--opsui-text, #0f172a);
  background: var(--opsui-surface, #ffffff);
  font-size: 1.8rem;
  font-weight: 900;
}

.technician-work-card-month-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.technician-work-card-month-control > span {
  color: var(--opsui-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.technician-work-card-month-control > strong {
  display: block;
  color: var(--opsui-text, #0f172a);
  font-size: 1rem;
  line-height: 1.2;
  text-transform: capitalize;
}

.technician-work-card-month-control > input {
  width: 100%;
  min-width: 0;
}

.technician-work-card-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.technician-work-card-summary article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid rgba(22, 163, 74, 0.34);
  border-left: 5px solid #16a34a;
  border-radius: 18px;
  background: rgba(22, 163, 74, 0.08);
}

.technician-work-card-summary span {
  color: var(--opsui-muted, #64748b);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.technician-work-card-summary strong {
  font-size: clamp(1.65rem, 4vw, 2.4rem);
}

.technician-work-card-calendar-wrap {
  padding: clamp(12px, 2.5vw, 22px);
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 22px;
  background: var(--opsui-surface-soft, rgba(148, 163, 184, 0.08));
}

.technician-work-card-weekdays,
.technician-work-card-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.technician-work-card-weekdays {
  margin-bottom: 8px;
}

.technician-work-card-weekdays span {
  padding: 8px 3px;
  color: var(--opsui-muted, #64748b);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.technician-work-card-day {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 15px;
  color: var(--opsui-text, #0f172a);
  background: var(--opsui-surface, #ffffff);
}

.technician-work-card-day b {
  font-size: 1rem;
}

.technician-work-card-day small {
  overflow: hidden;
  color: var(--opsui-muted, #64748b);
  font-size: clamp(0.66rem, 1.6vw, 0.82rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technician-work-card-day.is-empty {
  visibility: hidden;
}

.technician-work-card-day.is-weekend:not(.has-work) {
  background: rgba(148, 163, 184, 0.1);
}

.technician-work-card-day.has-work {
  border-color: rgba(22, 163, 74, 0.62);
  color: #14532d;
  background: rgba(34, 197, 94, 0.14);
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.technician-work-card-day.has-work small {
  color: #166534;
}

.technician-work-card-day.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.technician-work-card-day.is-today {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.technician-work-card-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--opsui-border, #cbd5e1);
  border-radius: 18px;
}

.technician-work-card-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.technician-work-card-table th,
.technician-work-card-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--opsui-border, #cbd5e1);
  text-align: left;
}

.technician-work-card-table th {
  color: var(--opsui-muted, #64748b);
  background: var(--opsui-surface-soft, rgba(148, 163, 184, 0.08));
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.technician-work-card-table tbody tr:last-child td {
  border-bottom: 0;
}

.technician-work-card-table td strong,
.technician-work-card-table td small {
  display: block;
}

.technician-work-card-table td small {
  margin-top: 3px;
  color: var(--opsui-muted, #64748b);
}

.technician-work-card-table tr.is-active td {
  background: rgba(34, 197, 94, 0.08);
}

.technician-work-card-empty {
  padding: 28px !important;
  color: var(--opsui-muted, #64748b);
  text-align: center !important;
}

body.theme-dark .technician-work-card-day.has-work {
  color: #dcfce7;
  background: rgba(22, 163, 74, 0.24);
}

body.theme-dark .technician-work-card-day.has-work small {
  color: #bbf7d0;
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.route-mode-active > #technicianWorkCardPanel.app-route-active {
    grid-column: 2 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > #technicianWorkCardPanel.app-route-active {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 720px) {
  .technician-work-card-title,
  .technician-work-card-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .technician-work-card-month-nav {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    width: 100%;
  }

  .technician-work-card-month-nav > button {
    min-width: 48px;
    min-height: 48px;
  }

  .technician-work-card-weekdays,
  .technician-work-card-calendar {
    gap: 4px;
  }

  .technician-work-card-day {
    min-height: 58px;
    padding: 6px;
    border-radius: 10px;
  }

  .technician-work-card-day b {
    font-size: 0.86rem;
  }

  .technician-work-card-day small {
    font-size: 0.58rem;
  }
}

/* V0.15: kontakty i wpis przebiegu dla Pracownika. */
#technicianDayPanel .technician-action-grid { display: none !important; }

.technician-contact-form,
.technician-vehicle-report-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #d8e5f2;
  border-radius: 15px;
  background: #f7fbff;
}

/* V0.16: czytelne grupy osob i firm przypisanych do budow. */
.boss-available-workers-panel .section-title small {
  display: block;
  margin-top: 5px;
  color: var(--opsui-muted, #64748b);
  font-size: .76rem;
}

.available-workers-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.boss-team-group {
  --team-main: #1e40af;
  --team-border: #60a5fa;
  --team-dot: #93c5fd;
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--team-border) 58%, transparent);
  border-left: 6px solid var(--team-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--team-main) 7%, var(--opsui-surface, #fff));
}

.boss-team-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.boss-team-group > header div {
  display: grid;
  gap: 2px;
}

.boss-team-group > header span {
  color: var(--team-main);
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.boss-team-group > header strong {
  color: var(--opsui-text, #172033);
  font-size: 1rem;
}

.boss-team-group > header > b {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--team-main);
  background: color-mix(in srgb, var(--team-border) 18%, transparent);
  font-size: .68rem;
  white-space: nowrap;
}

.boss-team-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.boss-team-group.is-unassigned {
  --team-main: #065f46;
  --team-border: #22c55e;
  --team-dot: #4ade80;
}

.boss-team-group.team-color-1 { --team-main: #92400e; --team-border: #f59e0b; --team-dot: #fbbf24; }
.boss-team-group.team-color-2 { --team-main: #5b21b6; --team-border: #a78bfa; --team-dot: #c4b5fd; }
.boss-team-group.team-color-3 { --team-main: #9f1239; --team-border: #fb7185; --team-dot: #fda4af; }
.boss-team-group.team-color-4 { --team-main: #334155; --team-border: #94a3b8; --team-dot: #cbd5e1; }
.boss-team-group.team-color-5 { --team-main: #3730a3; --team-border: #818cf8; --team-dot: #a5b4fc; }

.available-workers-list .boss-technician-card,
.available-workers-list .boss-team-subcontractor-card {
  min-width: 0;
  margin: 0;
}

.available-workers-list .boss-technician-card {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.available-workers-list .boss-technician-card:hover,
.available-workers-list .boss-technician-card:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  outline: 3px solid color-mix(in srgb, var(--team-border) 35%, transparent);
  outline-offset: 2px;
}

.available-workers-list .boss-technician-card.is-project,
.available-workers-list .boss-team-subcontractor-card {
  border-color: var(--team-border);
  color: #fff;
  background: linear-gradient(135deg, var(--team-main), color-mix(in srgb, var(--team-main) 72%, #111827));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--team-main) 25%, transparent);
}

.available-workers-list .boss-technician-card.is-project > i {
  background: var(--team-dot);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--team-dot) 19%, transparent);
}

.available-workers-list .boss-technician-card.is-project :is(.boss-technician-meta, small, b),
.available-workers-list .boss-team-subcontractor-card :is(small, b) {
  color: #f8fafc;
}

.available-workers-list .boss-technician-card.is-project .boss-technician-status {
  border-color: color-mix(in srgb, var(--team-dot) 62%, white);
  color: #fff;
}

.boss-team-vacation-note {
  grid-column: 2;
  width: fit-content;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #7c2d12 !important;
  background: #ffedd5;
  font-size: .68rem !important;
  font-weight: 950 !important;
  letter-spacing: .03em;
}

.available-workers-list .boss-team-subcontractor-card {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
}

.boss-team-company-mark {
  grid-row: 1 / span 3;
  align-self: start;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 8px;
  color: #fff !important;
  background: rgba(255, 255, 255, .14);
  font-size: .56rem !important;
}

.available-workers-list .boss-team-subcontractor-card strong,
.available-workers-list .boss-team-subcontractor-card b,
.available-workers-list .boss-team-subcontractor-card small {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.available-workers-list .boss-team-subcontractor-card b {
  font-size: .78rem;
}

.available-workers-list .boss-team-subcontractor-card small {
  font-size: .68rem;
}

.boss-team-assignment-modal-card form {
  grid-template-columns: 1fr;
}

.boss-team-assignment-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #f7faff;
}

.boss-team-assignment-person strong { color: #172a42; }
.boss-team-assignment-person span { color: #176fc5; font-size: .7rem; font-weight: 950; }
.boss-team-assignment-modal-card label small { color: #6b7a8d; font-size: .66rem; line-height: 1.4; }
.boss-team-assignment-modal-card .error-message,
.boss-team-assignment-modal-card .ei-modal-actions { grid-column: 1; }

.boss-team-equipment-modal-card { width: min(720px, calc(100vw - 28px)); }
.boss-team-equipment-modal-card form { gap: 14px; }
.boss-team-equipment-modal-card .boss-team-assignment-person > div { display: grid; gap: 3px; }
.boss-team-equipment-modal-card .boss-team-assignment-person small { color: #176fc5; font-size: .65rem; font-weight: 950; letter-spacing: .08em; }
.boss-team-equipment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.boss-team-equipment-fields label { min-width: 0; }
.boss-team-equipment-fields .boss-team-equipment-note { grid-column: 1 / -1; }

@media (max-width: 680px) {
  .boss-team-equipment-fields { grid-template-columns: 1fr; }
  .boss-team-equipment-fields .boss-team-equipment-note { grid-column: 1; }
  .boss-team-equipment-modal-card .boss-team-assignment-person { align-items: flex-start; flex-direction: column; }
}

body.theme-dark .boss-team-group {
  background: color-mix(in srgb, var(--team-main) 14%, #121c29);
}
body.theme-dark .boss-team-group > header strong { color: #edf5ff; }
body.theme-dark .boss-team-assignment-person { border-color: #33465c; background: #172536; }
body.theme-dark .boss-team-assignment-person strong { color: #edf5ff; }
body.theme-dark .boss-team-equipment-modal-card .boss-team-assignment-person small { color: #69afff; }

/* V0.17: budowy na gorze menu, jawne przypisania i planowane przeniesienia ekip. */
.side-menu-list button.side-farms-priority {
  border: 1px solid rgba(56, 189, 248, .5);
  color: #fff;
  background: linear-gradient(135deg, #1677e8, #0e5fc2);
  box-shadow: 0 8px 18px rgba(20, 121, 247, .22);
}

.side-menu-list button.side-farms-priority::before {
  content: "B";
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  place-items: center;
  border-radius: 7px;
  color: #0e5fc2;
  background: #fff;
  font-size: .7rem;
  font-weight: 950;
}

.farm-assignment-option.is-person-option {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  cursor: default;
}

.farm-assignment-option.is-person-option > label {
  display: contents;
  cursor: pointer;
}

.farm-assignment-option.is-person-option .farm-person-copy small {
  white-space: normal;
}

.farm-person-current-site,
.farm-person-transfer-badge {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #0f5da9 !important;
  background: #e3f1ff;
  font-size: .64rem !important;
  font-weight: 950 !important;
  line-height: 1.25;
}

.farm-person-current-site.is-here {
  color: #166534 !important;
  background: #dcfce7;
}

.farm-person-current-site.is-free {
  color: #0f6b48 !important;
  background: #d1fae5;
}

.farm-person-transfer-badge {
  color: #92400e !important;
  background: #fef3c7;
}

.farm-person-transfer-button {
  min-width: 84px;
  padding: 7px 9px !important;
  white-space: nowrap;
}

.team-transfer-modal-card form {
  grid-template-columns: 1fr;
}

.team-transfer-person,
.team-transfer-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team-transfer-person > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #f7faff;
}

.team-transfer-person small { color: #6b7a8d; font-size: .64rem; font-weight: 950; }
.team-transfer-person strong { color: #172a42; }
.team-transfer-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.team-transfer-modal-card label small { color: #6b7a8d; font-size: .68rem; line-height: 1.45; }
.team-transfer-modal-card .error-message,
.team-transfer-modal-card .ei-modal-actions { grid-column: 1; }

.team-transfer-notice-list {
  display: grid;
  gap: 9px;
}

.team-transfer-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid #d6e3f1;
  border-left: 5px solid #1d7ff2;
  border-radius: 13px;
  background: #f8fbff;
}

.team-transfer-notice.is-active { border-left-color: #16a269; background: #f0fdf7; }
.team-transfer-notice-date { min-width: 108px; color: #0f5da9; font-weight: 950; }
.team-transfer-notice-copy { display: grid; gap: 4px; }
.team-transfer-notice-copy strong { color: #15253b; }
.team-transfer-notice-copy span { color: #566a82; font-size: .78rem; }
.team-transfer-notice-copy small { color: #7c4c00; }
.team-transfer-direction {
  padding: 6px 9px;
  border-radius: 999px;
  color: #0f5da9;
  background: #e3f1ff;
  font-size: .66rem;
  font-weight: 950;
  white-space: nowrap;
}

.team-transfer-notice-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.boss-team-transfer-note {
  grid-column: 2;
  width: fit-content;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #713f12 !important;
  background: #fef3c7;
  font-size: .66rem !important;
  font-weight: 950 !important;
}

.vehicle-repair-modal-card form { grid-template-columns: 1fr; }
.vehicle-repair-source {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  background: #f7faff;
}
.vehicle-repair-source span { color: #60738b; font-size: .74rem; }
.vehicle-repair-source p { margin: 5px 0 0; color: #172a42; font-weight: 800; }
.vehicle-repair-modal-card .error-message,
.vehicle-repair-modal-card .ei-modal-actions { grid-column: 1; }

.vehicle-report-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vehicle-repair-status {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: .63rem;
  font-weight: 950;
  white-space: nowrap;
}
.vehicle-repair-status.status-scheduled { color: #075985; background: #e0f2fe; }
.vehicle-repair-status.status-completed { color: #166534; background: #dcfce7; }
.vehicle-repair-status.status-dismissed { color: #475569; background: #e2e8f0; }

.vehicle-repair-appointment {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 9px 11px;
  border-left: 4px solid #0284c7;
  border-radius: 9px;
  color: #0c4a6e;
  background: #f0f9ff;
}
.vehicle-repair-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }

.vehicle-departure-block-option {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px !important;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  color: #7f1d1d !important;
  background: #fff1f2;
}
.vehicle-departure-block-option input { width: 19px; height: 19px; margin-top: 2px; accent-color: #dc2626; }
.vehicle-departure-block-option span { display: grid; gap: 4px; }
.vehicle-departure-block-option small { color: #9f1239; line-height: 1.45; }
.vehicle-departure-block-state {
  padding: 10px 12px;
  border-radius: 10px;
  color: #7f1d1d;
  background: #fee2e2;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.45;
}
.vehicle-report-departure-block {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #fff;
  background: #b91c1c;
  font-size: .69rem;
  font-weight: 950;
}
.vehicle-departure-block-banner {
  display: grid;
  gap: 4px;
  margin: 7px 0;
  padding: 11px 13px;
  border: 2px solid #dc2626;
  border-radius: 11px;
  color: #7f1d1d;
  background: #fff1f2;
}
.vehicle-departure-block-banner b { color: #b91c1c; }
.vehicle-departure-block-banner small { color: #9f1239; }
.farm-assignment-option.is-vehicle-blocked { cursor: not-allowed; opacity: .82; border-color: #fecaca; background: #fff1f2; }
.farm-assignment-option .farm-vehicle-blocked-label { color: #b91c1c; font-weight: 950; white-space: normal; }

/* V0.17 UI: zwarte sekcje i tabele czytelne przy powiekszeniu 100%. */
#bossAvailableWorkersPanel .available-workers-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
}

#bossAvailableWorkersPanel .boss-team-group {
  min-height: 0 !important;
  align-content: start !important;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 13px;
}

#bossAvailableWorkersPanel .boss-team-group-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
  gap: 8px !important;
  align-items: start !important;
}

#bossAvailableWorkersPanel .boss-technician-card,
#bossAvailableWorkersPanel .boss-team-subcontractor-card {
  min-height: 62px !important;
  padding: 9px 11px !important;
  gap: 2px 9px !important;
  border-radius: 11px !important;
  box-shadow: 0 5px 12px color-mix(in srgb, var(--team-main) 16%, transparent) !important;
}

#bossAvailableWorkersPanel .boss-technician-card > i {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--team-dot) 18%, transparent);
}

#bossAvailableWorkersPanel .boss-technician-card strong { font-size: .78rem; }
#bossAvailableWorkersPanel .boss-technician-status { min-height: 21px; padding: 3px 6px; font-size: .56rem; }
#bossAvailableWorkersPanel .boss-technician-meta { font-size: .66rem; }
#bossAvailableWorkersPanel .boss-team-group > header strong { font-size: .9rem; }

@media (min-width: 900px) {
  .app-shell :is(.panel, .history-section, .admin-panel) thead th { padding: 7px 9px; }
  .app-shell :is(.panel, .history-section, .admin-panel) tbody td { padding: 7px 9px; font-size: .68rem; }
  #vehicleList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  #vehicleList > .vehicle-item {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 5px 12px;
    padding: 14px;
  }
  #vehicleList > .vehicle-item > :is(strong, .vehicle-report-history, .vehicle-item-actions) { grid-column: 1 / -1; }
  #vehicleList .vehicle-report-history { margin-top: 5px; }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.boss-home-layout > #teamTransferNoticePanel {
    grid-column: 2 / -1 !important;
    grid-row: 3 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel { grid-row: 4 !important; }
  .app-shell.desktop-layout.boss-home-layout > #bossDashboardPanel { grid-row: 5 !important; }
  .app-shell.desktop-layout.boss-home-layout > #deadlineAlerts { grid-row: 6 !important; }
  .app-shell.desktop-layout.boss-home-layout > #summaryPanel { grid-row: 7 !important; }
  .app-shell.desktop-layout.boss-home-layout > #dailyNote { grid-row: 8 !important; }
  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > #teamTransferNoticePanel { grid-column: 1 / -1 !important; }
}

body.theme-dark .team-transfer-person > div,
body.theme-dark .team-transfer-notice { border-color: #33465c; background: #172536; }
body.theme-dark .team-transfer-person strong,
body.theme-dark .team-transfer-notice-copy strong { color: #edf5ff; }

@media (max-width: 720px) {
  .farm-assignment-option.is-person-option { grid-template-columns: 22px minmax(0, 1fr); }
  .farm-person-transfer-button { grid-column: 2; justify-self: start; }
  .team-transfer-person,
  .team-transfer-date-grid { grid-template-columns: 1fr; }
  .team-transfer-notice { grid-template-columns: 1fr; }
  .team-transfer-direction { justify-self: start; }
}

@media (max-width: 1080px) {
  .boss-team-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .boss-team-group-grid { grid-template-columns: 1fr; }
  .boss-team-group > header { align-items: flex-start; }
  .boss-team-group > header > b { white-space: normal; text-align: right; }
}

/* V0.18 - centrum operacyjne dla firmy wielobudowowej. */
.side-nav-group {
  padding-block: 9px !important;
}

.side-nav-group-label {
  margin-bottom: 5px !important;
  font-size: .68rem !important;
  letter-spacing: .13em;
}

.side-menu-list .side-nav-group > button {
  min-height: 35px !important;
  padding-block: 7px !important;
}

.side-nav-operations {
  position: relative;
  background: linear-gradient(180deg, rgba(37, 99, 235, .08), transparent);
}

.side-alerts-priority {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff !important;
  background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
  box-shadow: 0 7px 18px rgba(185, 28, 28, .22);
}

.side-alerts-priority b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  color: #991b1b;
  font-size: .7rem;
  background: #fff;
}

.side-alerts-priority.active {
  outline: 2px solid #fecaca;
  outline-offset: -2px;
}

.operations-alert-center {
  width: 100%;
  min-width: 0;
}

.operations-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dbe5f1;
}

.operations-alert-header h2 {
  margin: 3px 0 4px;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.operations-alert-header small { color: #64748b; }

.operations-alert-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin: 15px 0;
}

.operations-alert-metric {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: center;
  min-height: 80px;
  padding: 13px 15px;
  border: 1px solid #d8e3ef;
  border-left: 5px solid #64748b;
  border-radius: 14px;
  background: #f8fafc;
}

.operations-alert-metric b {
  grid-row: 1 / span 2;
  font-size: 2rem;
  line-height: 1;
}

.operations-alert-metric span { font-weight: 900; }
.operations-alert-metric small { color: #64748b; font-size: .75rem; }
.operations-alert-metric.tone-danger { border-left-color: #dc2626; background: #fff7f7; }
.operations-alert-metric.tone-warning { border-left-color: #f59e0b; background: #fffbeb; }
.operations-alert-metric.tone-fleet { border-left-color: #2563eb; background: #eff6ff; }
.operations-alert-metric.tone-construction { border-left-color: #7c3aed; background: #f5f3ff; }

.operations-alert-toolbar,
.boss-team-toolbar,
.fleet-command-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(2, minmax(150px, .65fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d7e2ee;
  border-radius: 13px;
  background: #f8fafc;
}

.operations-alert-toolbar label,
.boss-team-toolbar label,
.fleet-command-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.operations-alert-toolbar label > span,
.boss-team-toolbar label > span,
.fleet-command-toolbar label > span {
  color: #475569;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.operations-alert-toolbar :is(input, select),
.boss-team-toolbar :is(input, select),
.fleet-command-toolbar :is(input, select) {
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
}

.operations-alert-toolbar button,
.boss-team-toolbar button,
.fleet-command-toolbar button { min-height: 40px; }

.operations-alert-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 13px 2px 9px;
}

.operations-alert-summary b { font-size: 1.25rem; }
.operations-alert-summary span { font-weight: 900; }
.operations-alert-summary small { margin-left: auto; color: #64748b; }

.operations-alert-list { display: grid; gap: 8px; }

.operations-alert-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 11px 13px;
  border: 1px solid #dbe5f0;
  border-left: 5px solid #94a3b8;
  border-radius: 12px;
  background: #fff;
}

.operations-alert-item.tone-danger { border-left-color: #dc2626; background: #fffafa; }
.operations-alert-item.tone-warning { border-left-color: #f59e0b; background: #fffdf5; }
.operations-alert-item.tone-info { border-left-color: #3b82f6; }

.operations-alert-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-weight: 950;
  background: #64748b;
}

.tone-danger .operations-alert-icon { background: #dc2626; }
.tone-warning .operations-alert-icon { color: #78350f; background: #fbbf24; }
.tone-info .operations-alert-icon { background: #3b82f6; }

.operations-alert-copy { display: grid; gap: 2px; min-width: 0; }
.operations-alert-copy > span { color: #2563eb; font-size: .65rem; font-weight: 950; letter-spacing: .09em; }
.operations-alert-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-alert-copy small { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-alert-meta { display: grid; justify-items: end; gap: 6px; }
.operations-alert-meta > b { color: #475569; font-size: .75rem; }
.operations-alert-empty { display: grid; justify-items: center; gap: 5px; padding: 42px; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 14px; }

.boss-team-toolbar {
  position: sticky;
  top: 8px;
  z-index: 4;
  margin: 12px 0;
  box-shadow: 0 7px 20px rgba(15, 23, 42, .07);
}

.boss-technician-card.is-readonly { cursor: default !important; }
.boss-technician-card.is-readonly:hover { transform: none !important; filter: none !important; outline: 0 !important; }

/* V0.20: kadry, odpowiedzialność za przydziały i czytelne zasoby na budowach. */
.boss-team-group.team-color-6 { --team-main: #0f766e; --team-border: #2dd4bf; --team-dot: #5eead4; }
.boss-team-group.team-color-7 { --team-main: #7c2d12; --team-border: #fb923c; --team-dot: #fdba74; }
.boss-team-group.team-color-8 { --team-main: #075985; --team-border: #38bdf8; --team-dot: #7dd3fc; }
.boss-team-group.team-color-9 { --team-main: #4d7c0f; --team-border: #a3e635; --team-dot: #bef264; }
.boss-team-group.team-color-10 { --team-main: #6b21a8; --team-border: #c084fc; --team-dot: #d8b4fe; }

#bossAvailableWorkersPanel .boss-technician-card {
  --resource-accent: #60a5fa;
  display: grid !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  grid-auto-rows: auto;
  align-content: start !important;
  border-top: 4px solid var(--resource-accent) !important;
}

#bossAvailableWorkersPanel .boss-technician-card > :not(i) { grid-column: 2; }
#bossAvailableWorkersPanel .boss-technician-card > i { grid-column: 1; grid-row: 1 / span 6; }
#bossAvailableWorkersPanel .boss-technician-card.role-leader { --resource-accent: #22d3ee; }
#bossAvailableWorkersPanel .boss-technician-card.role-foreman { --resource-accent: #facc15; }
#bossAvailableWorkersPanel .boss-technician-card.role-technician { --resource-accent: #93c5fd; }
#bossAvailableWorkersPanel .boss-technician-card.role-subcontractor { --resource-accent: #f472b6; }
#bossAvailableWorkersPanel .boss-team-equipment-card { --resource-accent: #fb923c; }

.boss-technician-role {
  color: color-mix(in srgb, var(--resource-accent) 78%, white);
  font-size: .56rem;
  font-weight: 950;
  letter-spacing: .09em;
  line-height: 1.2;
}

#bossAvailableWorkersPanel .boss-technician-card.is-available .boss-technician-role { color: #d1fae5; }
#bossAvailableWorkersPanel .boss-technician-card.has-upcoming-vacation {
  outline: 3px solid #ef4444 !important;
  outline-offset: 1px;
}

#bossAvailableWorkersPanel .boss-team-equipment-card.is-requested {
  outline: 3px solid #f97316 !important;
  outline-offset: 1px;
}

.boss-team-equipment-request,
.boss-team-audit-note,
.team-transfer-audit {
  white-space: normal !important;
  line-height: 1.25 !important;
}

.boss-team-equipment-request {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #7c2d12 !important;
  background: #ffedd5;
  font-weight: 950 !important;
}

.boss-team-audit-note { color: #e2e8f0 !important; opacity: .9; }
.boss-technician-card.is-available .boss-team-audit-note { color: #166534 !important; }
.team-transfer-audit { color: #64748b !important; font-weight: 750; }

.employees-panel { width: 100%; }
.employees-panel-heading { align-items: center; }
.employees-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.employees-heading-actions .available-workers-count { margin-right: 4px; }
.employees-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, .35fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}
.employees-toolbar label { display: grid; gap: 5px; }
.employees-toolbar label > span { color: #64748b; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.employees-table-wrap { overflow-x: auto; border: 1px solid #d9e5f2; border-radius: 14px; }
.employees-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.employees-table th { padding: 10px 12px; color: #566a82; background: #eef5fc; font-size: .68rem; text-align: left; text-transform: uppercase; }
.employees-table td { padding: 12px; border-top: 1px solid #e2eaf3; vertical-align: top; }
.employees-table td > strong,
.employees-table td > b,
.employees-table td > small,
.employees-table td > a { display: block; }
.employees-table td > strong { color: #172033; }
.employees-table td > small { margin-top: 4px; color: #64748b; font-size: .72rem; }
.employees-table td > a { color: #0875e1; font-weight: 850; text-decoration: none; }
.employee-qualification-list { display: flex; flex-wrap: wrap; gap: 5px; }
.employee-qualification-badge { padding: 4px 7px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: .64rem; font-weight: 900; }
.employee-qualification-badge.warning { color: #854d0e; background: #fef3c7; }
.employee-qualification-badge.danger { color: #991b1b; background: #fee2e2; }
.employee-empty-value { color: #94a3b8; font-size: .72rem; }

.employee-profile-dialog {
  width: min(760px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .35);
}
.employee-profile-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(4px); }
.employee-profile-dialog form { display: grid; gap: 16px; padding: 22px; }
.employee-profile-dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.employee-profile-dialog-heading h2 { margin: 3px 0 0; }
.employee-profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.employee-profile-form-grid label { display: grid; gap: 6px; color: #42556d; font-size: .75rem; font-weight: 850; }

body.theme-dark .employees-table-wrap { border-color: #334155; }
body.theme-dark .employees-table th { color: #cbd5e1; background: #1e293b; }
body.theme-dark .employees-table td { border-color: #334155; }
body.theme-dark .employees-table td > strong { color: #f8fafc; }
body.theme-dark .employee-profile-dialog { color: #f8fafc; background: #111827; }

@media (max-width: 760px) {
  .employees-panel-heading { align-items: flex-start; flex-direction: column; }
  .employees-heading-actions { width: 100%; justify-content: stretch; }
  .employees-heading-actions button { flex: 1 1 145px; }
  .employees-toolbar { grid-template-columns: 1fr; }
  .employees-table { min-width: 0; }
  .employees-table thead { display: none; }
  .employees-table, .employees-table tbody, .employees-table tr, .employees-table td { display: block; width: 100%; }
  .employees-table tr { padding: 10px; border-top: 1px solid #e2eaf3; }
  .employees-table td { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 8px; padding: 7px 4px; border: 0; }
  .employees-table td::before { content: attr(data-label); color: #64748b; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
  .employee-profile-form-grid { grid-template-columns: 1fr; }
}

.fleet-command-center {
  display: grid;
  gap: 11px;
  margin-bottom: 13px;
}

.fleet-command-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.fleet-command-metric {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
}

.fleet-command-metric b { font-size: 1.55rem; }
.fleet-command-metric span { color: #475569; font-size: .76rem; font-weight: 900; }
.fleet-command-metric.tone-danger { border-color: #fecaca; background: #fff1f2; }
.fleet-command-metric.tone-warning { border-color: #fde68a; background: #fffbeb; }
.fleet-command-metric.tone-info { border-color: #bfdbfe; background: #eff6ff; }

.vehicle-alert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0 7px;
}

.vehicle-alert-badges span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #334155;
  font-size: .66rem;
  font-weight: 900;
  background: #e2e8f0;
}

.vehicle-alert-badges .tone-danger { color: #991b1b; background: #fee2e2; }
.vehicle-alert-badges .tone-warning { color: #92400e; background: #fef3c7; }
.vehicle-alert-badges .tone-info { color: #1d4ed8; background: #dbeafe; }
.vehicle-alert-badges .tone-ok { color: #166534; background: #dcfce7; }

@media (max-width: 1050px) {
  .operations-alert-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fleet-command-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operations-alert-toolbar,
  .boss-team-toolbar,
  .fleet-command-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .operations-alert-header { align-items: flex-start; flex-direction: column; }
  .operations-alert-metrics,
  .fleet-command-metrics,
  .operations-alert-toolbar,
  .boss-team-toolbar,
  .fleet-command-toolbar { grid-template-columns: 1fr; }
  .operations-alert-item { grid-template-columns: 34px minmax(0, 1fr); }
  .operations-alert-meta { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
  .operations-alert-summary { flex-wrap: wrap; }
  .operations-alert-summary small { width: 100%; margin-left: 0; }
}

.technician-contact-form label,
.technician-vehicle-report-form label,
.technician-contact-search {
  display: grid;
  gap: 7px;
  color: #42546d;
  font-weight: 800;
}

.technician-contact-form input,
.technician-vehicle-report-form :is(input, select, textarea),
.technician-contact-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c6d6e7;
  border-radius: 11px;
  color: #172a42;
  background: #fff;
}

.technician-contact-form .error-message,
.technician-vehicle-report-form .error-message,
.technician-vehicle-report-form .full-width { grid-column: 1 / -1; }
.technician-contact-search { margin: 18px 0 10px; }
.technician-phone-list,
.technician-vehicle-report-list { display: grid; gap: 9px; }

.technician-phone-panel {
  width: min(100%, 1320px);
}

.technician-phone-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1.7fr) minmax(210px, .7fr) minmax(150px, .35fr);
  gap: 12px;
  align-items: end;
  margin: 18px 0 12px;
  padding: 14px;
  border: 1px solid #d7e3ef;
  border-radius: 15px;
  background: #f7fbff;
}

.technician-phone-toolbar :is(label, .technician-phone-result-count) {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.technician-phone-toolbar label > span,
.technician-phone-result-count > span {
  color: #52647b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.technician-phone-toolbar :is(input, select) {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c6d6e7;
  border-radius: 11px;
  color: #172a42;
  background: #fff;
}

.technician-phone-result-count {
  min-height: 46px;
  align-content: center;
  padding: 7px 13px;
  border-radius: 11px;
  color: #0f4f91;
  background: #eaf4ff;
}

.technician-phone-result-count strong {
  font-size: 1.2rem;
  line-height: 1;
}

.technician-contact-search { margin: 0; }

.technician-phone-column-head {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) minmax(190px, auto);
  gap: 14px;
  padding: 0 14px 7px 68px;
  color: #6a7b90;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.technician-service-tasks { margin-top: 18px; }
.technician-vehicle-service-tasks { display: grid; gap: 10px; }
.technician-vehicle-service-task {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px solid #0ea5e9;
  border-radius: 14px;
  background: #f0f9ff;
}
.technician-vehicle-service-task.is-blocked { border-color: #dc2626; background: #fff1f2; }
.technician-service-task-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.technician-service-task-head span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: #0369a1;
  font-size: .65rem;
  font-weight: 950;
}
.technician-vehicle-service-task.is-blocked .technician-service-task-head span { background: #b91c1c; }
.technician-service-task-grid { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr); gap: 8px; }
.technician-service-task-grid > span { display: grid; gap: 3px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.82); }
.technician-service-task-grid small { color: #64748b; font-size: .65rem; font-weight: 900; }
.technician-vehicle-service-task p { margin: 0; color: #334155; }
.technician-service-safety-note { padding: 10px 12px; border-radius: 10px; color: #7f1d1d; background: #fee2e2; font-weight: 900; line-height: 1.45; }

.technician-phone-row {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1.2fr) minmax(220px, 1fr) minmax(190px, auto);
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 11px 14px;
  border: 1px solid #dce6f0;
  border-radius: 13px;
  background: #fff;
}

.technician-phone-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #1978de;
  font-weight: 900;
}

.technician-phone-row :is(b, strong, small) { display: block; }
.technician-phone-row small { margin-top: 3px; color: #75849a; }
.technician-phone-assignment strong { color: #1668b7; font-size: .76rem; text-transform: uppercase; }
.technician-phone-row a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  background: #147441;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.technician-phone-row a b { font-size: .72rem; text-transform: uppercase; }
.technician-phone-row em { color: #8794a5; font-style: normal; }

.technician-vehicle-report-row,
.vehicle-report-history article {
  padding: 12px;
  border: 1px solid #dde7f1;
  border-radius: 11px;
  background: #fff;
}
.technician-vehicle-report-row :is(b, small),
.vehicle-report-history article :is(b, small) { display: block; }
.technician-vehicle-report-row small,
.vehicle-report-history article small { margin-top: 3px; color: #77869a; }
.technician-vehicle-report-row p,
.vehicle-report-history article p { margin: 7px 0 0; color: #334a65; }
.vehicle-report-history { margin-top: 8px; padding-top: 8px; border-top: 1px solid #dde6ef; }
.vehicle-report-history summary { cursor: pointer; color: #176fc3; font-weight: 850; }
.vehicle-report-history article { margin-top: 8px; }

body.theme-dark :is(.technician-contact-form, .technician-vehicle-report-form, .technician-phone-row, .technician-vehicle-report-row, .vehicle-report-history article) {
  border-color: #34465b;
  color: #edf5ff;
  background: #1b2939;
}
body.theme-dark :is(.technician-contact-form input, .technician-vehicle-report-form input, .technician-vehicle-report-form select, .technician-vehicle-report-form textarea, .technician-contact-search input) {
  border-color: #40536a;
  color: #edf5ff;
  background: #162333;
}
body.theme-dark .technician-phone-toolbar { border-color: #34465b; background: #1b2939; }
body.theme-dark .technician-phone-toolbar :is(input, select) { border-color: #40536a; color: #edf5ff; background: #162333; }
body.theme-dark .technician-phone-result-count { color: #bfdbfe; background: #15385d; }
body.theme-dark .technician-phone-column-head { color: #93a4b8; }

@media (max-width: 680px) {
  .technician-contact-form,
  .technician-vehicle-report-form { grid-template-columns: 1fr; }
  .technician-phone-toolbar { grid-template-columns: 1fr; }
  .technician-phone-column-head { display: none; }
  .technician-phone-row { grid-template-columns: 38px minmax(0, 1fr); gap: 9px 11px; }
  .technician-phone-assignment { grid-column: 2; }
  .technician-phone-row a,
  .technician-phone-row em { grid-column: 1 / -1; justify-content: center; text-align: center; }
  .technician-service-task-head { align-items: flex-start; flex-direction: column; }
  .technician-service-task-grid { grid-template-columns: 1fr; }
}

/* V0.21 FINAL: jednolita czytelnosc wszystkich zakladek CRM. */
@media (min-width: 980px) {
  body.desktop-layout-active { --crm-content-width: 1640px; font-size: 15px; }
  .app-shell.desktop-layout { --desktop-sidebar-width: 268px; grid-template-rows: 64px auto; gap: 18px; padding: 0 24px 28px 0; }
  .app-shell.desktop-layout > .topbar { min-height: 64px; padding: 0 24px; }
  .app-shell.desktop-layout .hamburger-button { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.16); background: #1d2b3e; }
  body.desktop-menu-collapsed .app-shell.desktop-layout .hamburger-button { color: #fff; background: #1479f7; box-shadow: 0 8px 22px rgba(20,121,247,.3); }
  .app-shell.desktop-layout .topbar-title h1 { font-size: 1.15rem; }
  .app-shell.desktop-layout .topbar-title .user-button { font-size: .78rem; }
  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] { top: 64px; height: calc(100vh - 64px); padding: 14px 12px 16px; }
  .app-shell.desktop-layout .side-menu-list { gap: 8px; padding: 8px 0 14px; }
  .app-shell.desktop-layout .side-nav-group { gap: 3px; }
  .app-shell.desktop-layout .side-nav-group-label,
  .app-shell.desktop-layout .side-admin-nav-group > p { font-size: .68rem !important; letter-spacing: .1em; }
  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button { min-height: 42px; padding: 9px 11px; font-size: .82rem !important; line-height: 1.25; }
  .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active { width: min(100%, var(--crm-content-width)) !important; max-width: var(--crm-content-width) !important; justify-self: center; }
  .app-shell.desktop-layout :is(.panel, .vehicle-panel, .admin-panel, .daily-note, .history-section, .summary-card) { padding: 22px; border-radius: 16px; }
  .app-shell.desktop-layout :is(input, select, textarea, button) { font-size: .875rem !important; line-height: 1.35; }
  .app-shell.desktop-layout :is(button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) { min-height: 34px; }
  .app-shell.desktop-layout .app-route-active button { min-height: 34px !important; }
  .app-shell.desktop-layout .ei-alert-list button { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
  .app-shell.desktop-layout .ei-alert-list button > em { flex: 0 0 auto; }
  .app-shell.desktop-layout :is(p, label, td, .form-hint, .vehicle-item span, .entry-card span) { font-size: .875rem !important; line-height: 1.45; }
  .app-shell.desktop-layout :is(small, .employee-empty-value) { font-size: .78rem !important; line-height: 1.4; }
  .app-shell.desktop-layout :is(th, .eyebrow) { font-size: .75rem !important; line-height: 1.35; }
  .app-shell.desktop-layout :is(h2, .section-title h2) { font-size: 1.35rem; line-height: 1.25; }
  .app-shell.desktop-layout h3 { font-size: 1rem; line-height: 1.3; }
  .app-shell.desktop-layout :is(.inventory-table-wrap, .employees-table-wrap, .toa-table-wrap) { max-height: min(64vh, 760px); overflow: auto; border-radius: 13px; }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table) th { position: sticky; top: 0; z-index: 2; padding: 12px 13px; }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table) td { padding: 13px; }
  .app-shell.desktop-layout .employees-table { min-width: 1120px; }
  .app-shell.desktop-layout .employee-qualification-badge { font-size: .72rem; padding: 5px 8px; }
  .app-shell.desktop-layout .operations-alert-metrics { gap: 12px; }
  .app-shell.desktop-layout .operations-alert-metric { min-height: 82px; padding: 15px 17px; }
  .app-shell.desktop-layout .operations-alert-metric b { font-size: 1.65rem; }
  .app-shell.desktop-layout .operations-alert-item { min-height: 76px; padding: 12px 14px; gap: 13px; }
  .app-shell.desktop-layout .operations-alert-copy { gap: 4px; }
  .app-shell.desktop-layout .operations-alert-copy > span { font-size: .7rem; }
  .app-shell.desktop-layout .operations-alert-copy strong { font-size: .93rem; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-copy small { font-size: .8rem !important; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-meta { min-width: 150px; }
  .app-shell.desktop-layout .reviews-alert-grid { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
  .app-shell.desktop-layout .review-alert-column { min-height: 330px; padding: 16px; }
  .app-shell.desktop-layout .review-alert-card { padding: 14px; }
  .app-shell.desktop-layout .review-alert-card-copy strong { font-size: .9rem; }
  .app-shell.desktop-layout .review-alert-card-copy span,
  .app-shell.desktop-layout .review-alert-card-status small { font-size: .78rem; }
  .app-shell.desktop-layout .vehicle-form { gap: 12px; }
  .app-shell.desktop-layout .vehicle-item { padding: 16px; border-radius: 13px; }
  .app-shell.desktop-layout .vehicle-list { gap: 12px; }
  .app-shell.desktop-layout .section-title { margin-bottom: 14px; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-card { min-height: 132px !important; padding: 13px !important; }
  .app-shell.desktop-layout .boss-technician-role { font-size: .68rem; }
  .app-shell.desktop-layout .employees-toolbar { grid-template-columns: minmax(320px, 1fr) 240px auto; gap: 12px; padding: 13px; border: 1px solid #dbe7f3; border-radius: 13px; background: #f7faff; }
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > :is(#vacationPanel, #reviewsPanel) { width: min(100%, var(--crm-content-width)) !important; max-width: var(--crm-content-width) !important; }
  .app-shell.desktop-layout :is(#vehiclePanel, #heavyEquipmentPanel, #toolsPanel, #subcontractorsPanel, #trainingPanel, #ppePanel) .vehicle-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .app-shell.desktop-layout :is(#vehicleList, #heavyEquipmentList, #toolList, #subcontractorsList, #trainingList, #ppeList) { order: -1; }
  .app-shell.desktop-layout #toolAdminActions { order: -2; }
  .app-shell.desktop-layout :is(#vehicleForm, #heavyEquipmentForm, #toolForm, #subcontractorForm, #trainingForm, #ppeForm) {
    order: 2;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid #dbe5ef;
  }
}

@media (min-width: 980px) and (max-width: 1350px) {
  body.desktop-layout-active { --crm-content-width: 1180px; }
  .app-shell.desktop-layout .reviews-alert-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* V0.22 FINAL: pelna szerokosc i gestosc tabeli Excela przy powiekszeniu 120%. */
@media (min-width: 980px) {
  html { scrollbar-gutter: stable; }

  body.desktop-layout-active {
    --crm-content-width: none;
    font-size: 12.5px;
    overflow-x: hidden;
  }

  .app-shell.desktop-layout {
    --desktop-sidebar-width: 220px;
    width: 100%;
    max-width: none;
    grid-template-rows: 48px auto;
    column-gap: 9px;
    row-gap: 8px;
    padding: 0 10px 12px 0;
  }

  .app-shell.desktop-layout.route-mode-active { padding-bottom: 12px; }

  .app-shell.desktop-layout > .topbar {
    min-height: 48px;
    margin-right: -10px;
    padding: 0 11px;
  }

  .app-shell.desktop-layout .hamburger-button {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .app-shell.desktop-layout .topbar-title h1 { font-size: 14px; }
  .app-shell.desktop-layout .topbar-title .user-button { font-size: 10.5px; }
  .app-shell.desktop-layout .top-logout-icon-button { min-height: 30px; padding: 5px 10px; }

  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] {
    top: 48px;
    width: 220px;
    max-width: 220px;
    height: calc(100vh - 48px);
    padding: 7px 7px 9px;
  }

  .app-shell.desktop-layout .side-menu-head { padding: 2px 2px 7px; }
  .app-shell.desktop-layout .side-logo-frame { width: 31px; height: 31px; }
  .app-shell.desktop-layout .side-menu-list { gap: 3px; padding: 5px 0 8px; }
  .app-shell.desktop-layout .side-nav-group { gap: 1px; }
  .app-shell.desktop-layout .side-nav-group-label,
  .app-shell.desktop-layout .side-admin-nav-group > p {
    margin: 8px 5px 3px;
    font-size: 9px !important;
    letter-spacing: .08em;
  }
  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-utility-button,
  .app-shell.desktop-layout .side-logout-button {
    min-height: 31px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 11px !important;
    line-height: 1.16;
  }

  .app-shell.desktop-layout.route-mode-active > section.app-route-active,
  .app-shell.desktop-layout.route-mode-active > .admin-panel.app-route-active,
  .app-shell.desktop-layout.route-mode-active > :is(#vacationPanel, #reviewsPanel),
  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > :is(#vacationPanel, #reviewsPanel) {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: stretch !important;
  }

  .app-shell.desktop-layout.route-mode-active > .app-route-active {
    grid-column: 2 / -1 !important;
  }

  body.desktop-menu-collapsed .app-shell.desktop-layout.route-mode-active > .app-route-active {
    grid-column: 1 / -1 !important;
  }

  .app-shell.desktop-layout :is(.panel, .vehicle-panel, .admin-panel, .daily-note, .history-section, .summary-card) {
    min-width: 0;
    padding: 11px 12px;
    border-radius: 9px;
  }

  .app-shell.desktop-layout :is(.section-title, .operations-alert-header) {
    gap: 8px;
    margin-bottom: 7px;
    padding-bottom: 7px;
  }
  .app-shell.desktop-layout :is(h2, .section-title h2, .operations-alert-header h2) {
    margin-top: 2px;
    margin-bottom: 2px;
    font-size: 17px;
    line-height: 1.18;
  }
  .app-shell.desktop-layout h3 { font-size: 13px; line-height: 1.2; }
  .app-shell.desktop-layout .eyebrow { font-size: 9.5px !important; line-height: 1.15; }

  .app-shell.desktop-layout :is(p, label, td, .form-hint, .vehicle-item span, .entry-card span) {
    font-size: 11.5px !important;
    line-height: 1.28;
  }
  .app-shell.desktop-layout :is(small, .employee-empty-value) {
    font-size: 10.5px !important;
    line-height: 1.25;
  }
  .app-shell.desktop-layout th { font-size: 10.5px !important; line-height: 1.15; }

  .app-shell.desktop-layout :is(input, select, textarea, button) {
    font-size: 11.5px !important;
    line-height: 1.2;
  }
  .app-shell.desktop-layout :is(button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) {
    min-height: 29px;
  }
  .app-shell.desktop-layout .app-route-active button {
    min-height: 29px !important;
    padding: 5px 8px;
    border-radius: 6px;
  }
  .app-shell.desktop-layout :is(input, select, textarea) {
    padding: 5px 7px;
    border-radius: 5px;
  }
  .app-shell.desktop-layout textarea { min-height: 58px; }

  .app-shell.desktop-layout :is(.inventory-table-wrap, .employees-table-wrap, .toa-table-wrap, .boss-history-table-wrap, .table-wrap) {
    width: 100%;
    max-height: calc(100vh - 205px);
    overflow: auto;
    border: 1px solid #d7e1eb;
    border-radius: 6px;
  }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table, .boss-history-table, table) {
    width: 100%;
    border-collapse: collapse;
  }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table, .boss-history-table) {
    min-width: 0;
    table-layout: auto;
  }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table, .boss-history-table) th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 5px 7px;
    border: 1px solid #d7e1eb;
    background: #edf3f9;
    white-space: nowrap;
  }
  .app-shell.desktop-layout :is(.inventory-table, .employees-table, .toa-table, .boss-history-table) td {
    height: 28px;
    padding: 4px 7px;
    border: 1px solid #e1e8f0;
    vertical-align: middle;
  }
  .app-shell.desktop-layout .inventory-table :is(th, td) { display: table-cell !important; }
  .app-shell.desktop-layout .employee-qualification-badge { padding: 2px 5px; font-size: 9.5px; }

  .app-shell.desktop-layout :is(.operations-alert-toolbar, .boss-team-toolbar, .fleet-command-toolbar, .employees-toolbar) {
    grid-template-columns: minmax(230px, 1.5fr) repeat(2, minmax(130px, .6fr)) auto;
    gap: 6px;
    margin: 6px 0;
    padding: 7px;
    border-radius: 7px;
  }
  .app-shell.desktop-layout :is(.operations-alert-toolbar, .boss-team-toolbar, .fleet-command-toolbar, .employees-toolbar) label { gap: 3px; }
  .app-shell.desktop-layout :is(.operations-alert-toolbar, .boss-team-toolbar, .fleet-command-toolbar) label > span { font-size: 9px; }
  .app-shell.desktop-layout :is(.operations-alert-toolbar, .boss-team-toolbar, .fleet-command-toolbar) :is(input, select) { height: 29px; }

  .app-shell.desktop-layout .operations-alert-metrics {
    gap: 7px;
    margin: 7px 0;
  }
  .app-shell.desktop-layout .operations-alert-metric {
    min-height: 54px;
    gap: 2px 8px;
    padding: 7px 9px;
    border-radius: 7px;
  }
  .app-shell.desktop-layout .operations-alert-metric b { font-size: 20px; }
  .app-shell.desktop-layout .operations-alert-summary { padding: 7px 2px 5px; }
  .app-shell.desktop-layout .operations-alert-list { gap: 4px; }
  .app-shell.desktop-layout .operations-alert-item {
    grid-template-columns: 27px minmax(0, 1fr) minmax(105px, auto);
    min-height: 45px;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 6px;
  }
  .app-shell.desktop-layout .operations-alert-icon { width: 25px; height: 25px; border-radius: 5px; }
  .app-shell.desktop-layout .operations-alert-copy { gap: 1px; }
  .app-shell.desktop-layout .operations-alert-copy > span { font-size: 9px; }
  .app-shell.desktop-layout .operations-alert-copy strong { font-size: 11.5px; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-copy small { font-size: 10px !important; white-space: normal; }
  .app-shell.desktop-layout .operations-alert-meta { min-width: 105px; gap: 3px; }

  .app-shell.desktop-layout .reviews-alert-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 7px;
  }
  .app-shell.desktop-layout .review-alert-column { min-height: 220px; padding: 8px; border-radius: 7px; }
  .app-shell.desktop-layout .review-alert-card { padding: 7px; border-radius: 6px; }

  .app-shell.desktop-layout :is(#vehiclePanel, #heavyEquipmentPanel, #toolsPanel, #subcontractorsPanel, #trainingPanel, #ppePanel) .vehicle-content {
    gap: 8px;
  }
  .app-shell.desktop-layout :is(#vehicleList, #heavyEquipmentList, #toolList, #subcontractorsList, #trainingList, #ppeList) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 7px;
  }
  .app-shell.desktop-layout .vehicle-item {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 7px;
  }
  .app-shell.desktop-layout .vehicle-form {
    gap: 7px;
    margin-top: 4px;
    padding-top: 8px;
  }

  .app-shell.desktop-layout #bossAvailableWorkersPanel .available-workers-list { gap: 6px !important; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group {
    gap: 5px;
    padding: 7px;
    border-radius: 7px;
  }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)) !important;
    gap: 5px !important;
  }
  .app-shell.desktop-layout #bossAvailableWorkersPanel :is(.boss-technician-card, .boss-team-subcontractor-card) {
    min-height: 67px !important;
    padding: 6px 7px !important;
    gap: 1px 6px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 5px color-mix(in srgb, var(--team-main) 14%, transparent) !important;
  }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-card > i {
    width: 7px;
    height: 7px;
    margin-top: 3px;
  }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-role { font-size: 8.5px; line-height: 1.1; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-card strong { font-size: 10.5px; line-height: 1.15; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-status { min-height: 16px; padding: 1px 4px; font-size: 8px; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-technician-meta,
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-audit-note { font-size: 9px !important; line-height: 1.15; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group > header { min-height: 26px; }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group > header strong { font-size: 11.5px; }

  .app-shell.desktop-layout :is(.admin-summary, .summary-grid, .metric-grid) { gap: 7px; }
  .app-shell.desktop-layout :is(.summary-card, .metric-card) { min-height: 58px; padding: 8px; }
  .app-shell.desktop-layout :is(.admin-work-orders-list, .admin-entries-list, .entries-list) {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 7px;
  }

  .app-shell.desktop-layout .ei-ops-layout { gap: 8px; }
  .app-shell.desktop-layout :is(.ei-ops-card, .ei-command-card, .ei-action-card) { padding: 8px; border-radius: 7px; }
}

@media (min-width: 980px) and (max-width: 1350px) {
  .app-shell.desktop-layout { --desktop-sidebar-width: 205px; }
  .app-shell.desktop-layout > .side-menu,
  body.desktop-layout-active:not(.desktop-menu-collapsed) .app-shell.desktop-layout > .side-menu[hidden] {
    width: 205px;
    max-width: 205px;
  }
  .app-shell.desktop-layout .reviews-alert-grid { grid-template-columns: repeat(2, minmax(190px, 1fr)); }
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important; }
  .app-shell.desktop-layout :is(#vehicleList, #heavyEquipmentList, #toolList, #subcontractorsList, #trainingList, #ppeList) {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
/* V0.23: mobilny pulpit Magazynu i zgody między Szefami */
body.warehouse-user [hidden] { display: none !important; }
.warehouse-dashboard-panel {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin-inline: auto;
}
.warehouse-dashboard-header,
.warehouse-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.warehouse-dashboard-header h2,
.warehouse-dashboard-section h3 { margin: 2px 0; }
.warehouse-dashboard-section {
  border: 1px solid #d5e2ef;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.warehouse-time-section {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 300px);
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #f5fbff, #edf7f1);
  border-color: #b9dcc7;
}
.warehouse-time-section > div { display: grid; gap: 3px; }
.warehouse-time-section > div > strong { font-size: clamp(2.4rem, 8vw, 4.8rem); line-height: .95; color: #101d2d; }
.warehouse-time-section .employee-time-action { width: 100%; min-height: 82px; }
.warehouse-dashboard-list { display: grid; gap: 8px; margin-top: 10px; }
.warehouse-dashboard-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dce6f0;
  border-radius: 11px;
  background: #f8fbfe;
}
.warehouse-dashboard-list article div { display: grid; gap: 2px; }
.warehouse-dashboard-list article p { grid-column: 1 / -1; margin: 0; color: #42566d; }
.warehouse-dashboard-list article a { color: #096fd2; font-weight: 900; text-decoration: none; }
.warehouse-dashboard-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.warehouse-dashboard-quick-grid button {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #bad6f0;
  border-radius: 15px;
  background: #eef7ff;
  color: #17283b;
  text-align: left;
  cursor: pointer;
}
.warehouse-dashboard-quick-grid button span { color: #0877df; font-size: .7rem; font-weight: 950; letter-spacing: .09em; }
.warehouse-dashboard-quick-grid button b { font-size: 1rem; }
.warehouse-dashboard-quick-grid button small { color: #5e7084; }
.warehouse-dashboard-analysis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.warehouse-dashboard-analysis article { display: grid; gap: 4px; padding: 12px; border-radius: 11px; background: #eff5fb; }
.warehouse-dashboard-analysis strong { font-size: 1.35rem; }
.assignment-approval-panel { border-left: 5px solid #f0a21a; }
.assignment-approval-count { min-width: 34px; min-height: 34px; display: grid; place-items: center; border-radius: 999px; background: #fff0cf; color: #7b4a00; font-weight: 950; }
.assignment-approval-list { display: grid; gap: 9px; }
.assignment-approval-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #e1e8f0; border-radius: 12px; background: #fff; }
.assignment-approval-row > div:first-child { display: grid; gap: 2px; }
.assignment-approval-row > div:first-child > span { color: #1373d1; font-size: .67rem; font-weight: 950; letter-spacing: .08em; }
.assignment-approval-owner { display: grid; justify-items: end; gap: 7px; }
.assignment-approval-owner > div { display: flex; gap: 7px; }
.assignment-approval-row.is-incoming { border-color: #f0c46b; background: #fffaf0; }
.boss-team-subcontractor-card.is-interactive { cursor: pointer; outline: 2px solid transparent; }
.boss-team-subcontractor-card.is-interactive:hover,
.boss-team-subcontractor-card.is-interactive:focus-visible { outline-color: #fff; box-shadow: 0 0 0 3px #1479dd; transform: translateY(-1px); }

body.theme-dark .warehouse-dashboard-section,
body.theme-dark .assignment-approval-row { background: #162436; border-color: #31465d; color: #edf5ff; }
body.theme-dark .warehouse-time-section { background: linear-gradient(135deg, #15273a, #173429); }
body.theme-dark .warehouse-time-section > div > strong { color: #f4f8fd; }
body.theme-dark .warehouse-dashboard-list article,
body.theme-dark .warehouse-dashboard-analysis article { background: #1d2d40; border-color: #33485f; }

@media (max-width: 720px) {
  .warehouse-dashboard-panel { gap: 10px; padding: 12px; }
  .warehouse-time-section { grid-template-columns: 1fr; }
  .warehouse-time-section .employee-time-action { min-height: 68px; }
  .warehouse-dashboard-section { padding: 13px; border-radius: 13px; }
  .warehouse-dashboard-quick-grid { grid-template-columns: 1fr; }
  .warehouse-dashboard-analysis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warehouse-dashboard-analysis article { padding: 9px; }
  .warehouse-dashboard-analysis strong { font-size: 1rem; }
  .assignment-approval-row { grid-template-columns: 1fr; }
  .assignment-approval-owner { justify-items: start; }
  body.warehouse-user .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.warehouse-user .bottom-nav-item { min-width: 0; }
}
/* V0.24 - operacyjny pulpit Brygadzisty i wydania sprzetu z Magazynu */
.foreman-departure-summary {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

/* V0.28 — trwały dziennik zmian i priorytetowe komunikaty Brygadzisty */
.team-event-journal-panel {
  border-left: 5px solid #1677e8;
  background: linear-gradient(135deg, #ffffff 0%, #f6faff 100%);
}

.team-event-journal-heading {
  align-items: center;
}

.team-event-journal-count {
  display: grid;
  min-width: 40px;
  height: 40px;
  padding: 0 11px;
  place-items: center;
  border-radius: 999px;
  background: #0c5cab;
  color: #fff;
  font-weight: 950;
}

.team-event-journal-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.team-event-journal-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 11px 13px;
  border: 1px solid #cfdeef;
  border-left: 4px solid #2382ef;
  border-radius: 12px;
  background: #fff;
}

.team-event-journal-row.tone-cancelled,
.team-event-journal-row.tone-rejected { opacity: .76; border-left-color: #8190a3; }
.team-event-journal-row.tone-approval_requested { border-left-color: #e6a10b; background: #fffbef; }
.team-event-journal-row.tone-moved,
.team-event-journal-row.tone-approved { border-left-color: #e55353; background: #fff8f8; }

.team-event-journal-icon,
.foreman-change-alert-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #e7f2ff;
  color: #0b66c2;
  font-size: 1.25rem;
  font-weight: 950;
}

.team-event-journal-main { display: grid; gap: 2px; min-width: 0; }
.team-event-journal-main > small { color: #1474db; font-size: .69rem; font-weight: 950; letter-spacing: .08em; }
.team-event-journal-main > b { color: #122033; font-size: .96rem; }
.team-event-journal-main > strong { color: #3e536d; font-size: .82rem; }
.team-event-journal-main > p { margin: 2px 0 0; color: #66778d; font-size: .77rem; }
.team-event-journal-audit { display: grid; gap: 3px; min-width: 150px; text-align: right; }
.team-event-journal-audit b { color: #23344a; font-size: .79rem; }
.team-event-journal-audit span { color: #6d7e91; font-size: .72rem; }

.foreman-change-alerts {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 2px solid #e14b4b;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff4f4 0%, #fffaf0 100%);
  box-shadow: 0 10px 28px rgba(175, 39, 39, .13);
}

.foreman-change-alerts-heading {
  display: flex;
  gap: 12px;
  align-items: center;
}

.foreman-change-alerts-heading .foreman-change-alert-icon { flex: 0 0 auto; background: #d83d3d; color: #fff; }
.foreman-change-alerts-heading h3 { margin: 2px 0; color: #8f2020; font-size: 1.15rem; }
.foreman-change-alerts-heading small { color: #795252; }
.foreman-change-alert-list { display: grid; gap: 8px; }
.foreman-change-alert-list article {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #efc2b6;
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
}
.foreman-change-alert-list small { color: #bc2e2e; font-size: .68rem; font-weight: 950; letter-spacing: .08em; }
.foreman-change-alert-list b { color: #141d2b; font-size: 1rem; }
.foreman-change-alert-list strong { color: #293e57; font-size: .85rem; }
.foreman-change-alert-list span { color: #6c5360; font-size: .76rem; }
.foreman-change-alert-list p { margin: 3px 0 0; color: #5c4d52; font-size: .78rem; }

body.theme-dark .team-event-journal-panel,
body.theme-dark .team-event-journal-row { background: #172536; border-color: #334b66; }
body.theme-dark .team-event-journal-main > b,
body.theme-dark .team-event-journal-main > strong,
body.theme-dark .team-event-journal-audit b { color: #edf5ff; }
body.theme-dark .foreman-change-alerts { background: linear-gradient(135deg, #3a2024, #342b1f); border-color: #ef6b6b; }
body.theme-dark .foreman-change-alert-list article { background: #1a2738; border-color: #74434a; }
body.theme-dark .foreman-change-alert-list b,
body.theme-dark .foreman-change-alert-list strong { color: #f6f9ff; }

@media (max-width: 720px) {
  .foreman-change-alerts { margin: 0 0 12px; padding: 13px; border-radius: 15px; }
  .foreman-change-alerts-heading { align-items: flex-start; }
  .foreman-change-alerts-heading h3 { font-size: 1.02rem; }
  .foreman-change-alert-list article { padding: 11px; }
  .team-event-journal-row { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; align-items: start; }
  .team-event-journal-icon { width: 34px; height: 34px; }
  .team-event-journal-audit { grid-column: 2; min-width: 0; text-align: left; }
}
.foreman-primary-card,
.foreman-dashboard-section {
  border: 1px solid #d7e2ef;
  border-radius: 14px;
  background: #fff;
}
.foreman-primary-card { padding: 16px; display: grid; gap: 5px; }
.foreman-primary-card > span { color: #64748b; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.foreman-primary-card > b { color: #101827; font-size: 20px; line-height: 1.15; }
.foreman-primary-card > small { color: #526277; }
.foreman-primary-card[data-tone="good"] { border-left: 5px solid #16a34a; }
.foreman-primary-card[data-tone="warning"] { border-left: 5px solid #f59e0b; }
.foreman-primary-card[data-tone="danger"] { border-left: 5px solid #dc2626; background: #fff7f7; }
.foreman-service-reminders {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 15px;
  border: 1px solid #f3c663;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
}
.foreman-service-reminders-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.foreman-service-reminders-heading h3 { margin: 3px 0 0; color: #172033; }
.foreman-service-reminders-heading > span { min-width: 32px; min-height: 32px; display: grid; place-items: center; border-radius: 999px; color: #7c2d12; background: #fed7aa; font-weight: 950; }
.foreman-service-reminder-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.foreman-service-reminder-list article { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; padding: 11px 12px; border: 1px solid #fde68a; border-left: 5px solid #f59e0b; border-radius: 11px; background: #fff; }
.foreman-service-reminder-list article.tone-danger { border-color: #fecaca; border-left-color: #dc2626; background: #fff7f7; }
.foreman-service-reminder-list article > div { display: grid; gap: 3px; min-width: 0; }
.foreman-service-reminder-list article b { color: #172033; font-size: .9rem; }
.foreman-service-reminder-list article small { color: #5f6f83; overflow-wrap: anywhere; }
.foreman-service-reminder-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #9a5a00; background: #fef3c7; font-size: 1.05rem; font-weight: 950; }
.foreman-service-reminder-list article.tone-danger .foreman-service-reminder-icon { color: #b91c1c; background: #fee2e2; }
.foreman-dashboard-section { margin-top: 12px; padding: 16px; }
.foreman-people-list,
.foreman-equipment-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.foreman-people-list article,
.foreman-equipment-list article { display: grid; gap: 3px; min-width: 0; padding: 11px 12px; border: 1px solid #dce6f1; border-radius: 10px; background: #f8fbff; }
.foreman-people-list article > span { color: #1d72d8; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.foreman-people-list article > a { color: #1266c4; font-size: 12px; font-weight: 800; }
.foreman-team-editor { margin-top: 12px; padding: 12px; border: 1px solid #a9ccfb; border-radius: 12px; background: #f3f8ff; }
.foreman-team-editor > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 7px; margin: 10px 0; }
.foreman-team-editor label { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 8px 10px; border: 1px solid #cddceb; border-radius: 9px; background: #fff; }
.foreman-team-editor label > span { display: grid; gap: 2px; }
.foreman-team-editor label small { color: #64748b; }
.foreman-contractors { display: grid; gap: 8px; margin-top: 10px; }
.foreman-contractors form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, .75fr) minmax(150px, .65fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #e1d4fa; border-radius: 10px; background: #faf7ff; }
.foreman-contractors form > div { display: grid; }
.foreman-contractors label { display: grid; gap: 3px; font-size: 11px; font-weight: 800; }
.foreman-contractors input { min-width: 0; }
.foreman-contractors button { min-height: 38px; border: 0; border-radius: 8px; padding: 0 15px; color: #fff; background: #1d72d8; font-weight: 900; }
.foreman-contractor-people {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8c8f2;
  border-radius: 13px;
  background: #faf7ff;
}
.foreman-contractor-people > div { display: grid; gap: 3px; }
.foreman-contractor-people > div > b { font-size: 1rem; }
.foreman-contractor-people > div > small { color: #64748b; }
.foreman-contractor-people ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.foreman-contractor-people li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e2d8f4;
  border-radius: 10px;
  background: #fff;
}
.foreman-contractor-people li > span { display: grid; gap: 4px; min-width: 0; }
.foreman-contractor-people li small { color: #64748b; }
.foreman-contractor-people li em { padding: 5px 8px; border-radius: 999px; color: #5b21b6; background: #ede9fe; font-size: .68rem; font-style: normal; font-weight: 900; white-space: nowrap; }
.work-hours-explanation { margin: 12px 0 0; padding: 12px 14px; border: 1px solid #b9d8ff; border-radius: 12px; color: #334155; background: #f2f8ff; line-height: 1.45; }
.work-hours-explanation strong { display: block; margin-bottom: 3px; color: #0b63bd; }
.employee-profile-rates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding: 15px; border: 1px solid #9fc7f5; border-radius: 14px; background: #f3f8ff; }
.employee-profile-rates legend { padding: 0 7px; color: #0b63bd; font-weight: 950; }
.employee-profile-rates > p { grid-column: 1 / -1; margin: 0; color: #51647b; }
.employee-profile-rates label { display: grid; gap: 5px; color: #263b53; font-weight: 800; }
.foreman-trip-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.foreman-trip-form label { display: grid; gap: 4px; color: #334155; font-size: 11px; font-weight: 900; }
.foreman-trip-form .full-width { grid-column: 1 / -1; }
.foreman-trip-form input,
.foreman-trip-form select { width: 100%; min-width: 0; }
.foreman-trip-history { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; }
.foreman-trip-vehicle { min-width: 0; overflow: hidden; border: 1px solid #cddbea; border-radius: 13px; background: #fff; }
.foreman-trip-vehicle > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #dce6f1; background: #eef5fd; }
.foreman-trip-vehicle > header > div { display: grid; gap: 2px; }
.foreman-trip-vehicle > header span { color: #1d72d8; font-size: 10px; font-weight: 950; letter-spacing: .08em; }
.foreman-trip-vehicle > header b { font-size: 15px; }
.foreman-trip-vehicle > header small { padding: 4px 9px; border-radius: 999px; color: #35506e; background: #fff; font-weight: 850; }
.foreman-trip-vehicle-list { display: grid; }
.foreman-trip-vehicle-list article { display: grid; grid-template-columns: 92px minmax(140px, 1fr); gap: 5px 10px; align-items: center; padding: 10px 13px; border-top: 1px solid #edf1f6; }
.foreman-trip-vehicle-list article:first-child { border-top: 0; }
.foreman-trip-vehicle-list article strong { overflow-wrap: anywhere; }
.foreman-trip-vehicle-list article small { grid-column: 1 / -1; color: #526277; }
.warehouse-user #heavyEquipmentForm:not([hidden]) { display: grid !important; border-color: #2f80ed; background: #f5f9ff; }
.warehouse-user #heavyEquipmentForm:not([hidden])::before { content: "DODAJ / WYDAJ / PRZYJMIJ SPRZĘT"; grid-column: 1 / -1; color: #1769c2; font-size: 11px; font-weight: 950; letter-spacing: .08em; }

/* V0.30 — aktywne zmiany, akceptacja i chronologiczna historia */
.team-event-group,
.foreman-change-history {
  border: 1px solid #d5e1ef;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.team-event-group + .team-event-group { margin-top: 12px; }
.team-event-group > header,
.foreman-change-history > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f5f8fc;
  border-bottom: 1px solid #dbe5f0;
}
.team-event-group > header > div:first-child { display: grid; gap: 2px; }
.team-event-group > header > div:last-child { display: flex; align-items: center; gap: 8px; }
.team-event-group > header small { color: #64748b; }
.team-event-group-content { padding: 10px; }
.team-event-group.is-collapsed .team-event-group-content,
.foreman-change-history.is-collapsed .team-event-group-content { display: none; }
.team-event-journal-row.is-history { opacity: .84; background: #f8fafc; }
.team-event-journal-audit { display: grid; justify-items: end; gap: 5px; }
.foreman-change-history { margin-top: 12px; }
.foreman-change-history .team-event-group-content { display: grid; gap: 8px; }
.foreman-change-history article { display: grid; gap: 3px; padding: 10px; border: 1px solid #dce6f1; border-radius: 10px; background: #fff; }
.foreman-team-changes-list article > button,
.foreman-change-history article > button { justify-self: start; margin-top: 6px; }

@media (max-width: 720px) {
  .foreman-contractor-people li { grid-template-columns: 1fr; gap: 8px; }
  .foreman-contractor-people li em { justify-self: start; white-space: normal; }
  .employee-profile-rates { grid-template-columns: 1fr; }
  .team-event-journal-row { grid-template-columns: auto 1fr; }
  .team-event-journal-audit { grid-column: 2; justify-items: start; }
  .team-event-group > header { align-items: flex-start; }
}

.danger-inline-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #f0b7bd;
  border-radius: 9px;
  background: #fff4f5;
  color: #b4232f;
  font-weight: 900;
  cursor: pointer;
}
.danger-inline-button:hover,
.danger-inline-button:focus-visible {
  background: #b4232f;
  color: #fff;
}
.request-inline-button {
  background: #fff1c7;
  color: #825500;
  border-color: #e9bd54;
}
body.theme-dark .danger-inline-button { background: #3a1e25; border-color: #74404a; color: #ffb8c0; }
body.theme-dark .request-inline-button { background: #4a3917; border-color: #8b6c26; color: #ffd76f; }
.foreman-duplicate-request { width: fit-content; border-radius: 999px; padding: 2px 7px; color: #9a3412; background: #ffedd5; font-size: 9px; font-weight: 950; text-transform: uppercase; }
@media (max-width: 760px) {
  .foreman-departure-summary { grid-template-columns: 1fr; gap: 8px; }
  .foreman-primary-card { padding: 12px; }
  .foreman-service-reminders { padding: 12px; }
  .foreman-service-reminder-list { grid-template-columns: 1fr; }
  .foreman-dashboard-section { padding: 12px; }
  .foreman-people-list,
  .foreman-equipment-list,
  .foreman-team-editor > div { grid-template-columns: 1fr; }
  .foreman-contractors form { grid-template-columns: 1fr; }
  .foreman-trip-form { grid-template-columns: 1fr 1fr; }
  .foreman-trip-form .full-width,
  .foreman-trip-form button,
  .foreman-trip-form .error-message { grid-column: 1 / -1; }
  .foreman-trip-history { grid-template-columns: 1fr; }
  .foreman-trip-vehicle-list article { grid-template-columns: 1fr; }
  .foreman-trip-vehicle-list article strong,
  .foreman-trip-vehicle-list article small { grid-column: 1; text-align: left; }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout.boss-home-layout > #teamEventJournalPanel {
    grid-column: 2 / -1 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .app-shell.desktop-layout.boss-home-layout > #eiOperationsPanel { grid-row: 3 !important; }
  .app-shell.desktop-layout.boss-home-layout > #deadlineAlerts { grid-row: 4 !important; }
  .app-shell.desktop-layout.boss-home-layout > #bossAvailableWorkersPanel { grid-row: 5 !important; }
  .app-shell.desktop-layout.boss-home-layout > #activeWorkOrdersPanel { grid-row: 6 !important; }
  .app-shell.desktop-layout.boss-home-layout > #bossDashboardPanel { grid-row: 7 !important; }
  .app-shell.desktop-layout.boss-home-layout > #summaryPanel { grid-row: 8 !important; }
  .app-shell.desktop-layout.boss-home-layout > #dailyNote { grid-row: 9 !important; }
  body.desktop-menu-collapsed .app-shell.desktop-layout.boss-home-layout > #teamEventJournalPanel {
    grid-column: 1 / -1 !important;
  }
}

/* V0.36 — kokpit analityczny Szefa */
.analytics-group-field select {
  min-width: 170px;
  height: 38px;
  border: 1px solid #cbd8e8;
  border-radius: 9px;
  background: #fff;
  color: #142033;
  font: inherit;
  font-weight: 800;
  padding: 0 34px 0 11px;
}
.analytics-command-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  margin-bottom: 14px;
  border: 1px solid #1f5d45;
  border-radius: 18px;
  color: #f8fafc;
  background: radial-gradient(circle at 85% 10%, rgba(47, 215, 151, .22), transparent 34%), linear-gradient(135deg, #111b2a 0%, #123d34 100%);
  box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
}
.analytics-command-hero h3 { margin: 5px 0 7px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; color: #fff !important; }
.analytics-command-hero h3 small { display: block; margin-top: 9px; font-size: .88rem; font-weight: 700; color: #b9d3cb !important; }
.analytics-command-hero p { margin: 0; color: #d7e4e0 !important; }
.analytics-command-hero .eyebrow { color: #55e1a8 !important; }
.analytics-payroll-forecast {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
}
.analytics-payroll-forecast span,
.analytics-payroll-forecast small { color: #cbdad6 !important; }
.analytics-payroll-forecast strong { font-size: 1.8rem; color: #fff !important; }
.analytics-fleet-hero { border-color: #285f8d; background: radial-gradient(circle at 85% 10%, rgba(59, 130, 246, .27), transparent 34%), linear-gradient(135deg, #111b2a 0%, #153b5f 100%); }
.analytics-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf2f7;
  color: #526176;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .025em;
  white-space: nowrap;
}
.analytics-status-chip.is-good { background: #dcfce7; color: #087443; }
.analytics-status-chip.is-danger { background: #fee2e2; color: #b4232d; }
.analytics-decision-note { border-left: 4px solid #3b82f6; }
.analytics-decision-note p { margin: 0; line-height: 1.55; color: #58677d; }
@media (max-width: 760px) {
  .analytics-command-hero { grid-template-columns: 1fr; padding: 18px; }
  .analytics-command-hero h3 { font-size: 2rem; }
.analytics-date-fields .analytics-group-field,
  .analytics-group-field select { width: 100%; }
}

/* V0.38 finalne priorytety czytelnosci na komputerze. */
#adminStatisticsPanel .statistics-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)) !important;
  gap: 12px !important;
}
#adminStatisticsPanel .statistics-card {
  min-height: 128px !important;
  padding: 17px !important;
}
#adminStatisticsPanel .statistics-card b {
  font-size: clamp(1.45rem, 2vw, 2.05rem) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere;
}
.analytics-detail-table .analytics-table-wrap {
  max-height: 560px !important;
  overflow: auto !important;
  scrollbar-gutter: stable;
}
.analytics-detail-table .analytics-table { min-width: 1280px !important; font-size: .84rem !important; }
.analytics-detail-table .analytics-table th { position: sticky !important; top: 0; z-index: 4; padding: 13px 14px !important; white-space: nowrap; }
.analytics-detail-table .analytics-table td { padding: 13px 14px !important; line-height: 1.4 !important; white-space: nowrap; }
.analytics-detail-table .analytics-table tbody tr:nth-child(even) td { background: #f6f9fc; }
.analytics-detail-table .analytics-table th:first-child,
.analytics-detail-table .analytics-table td:first-child { position: sticky !important; left: 0; z-index: 3; }
@media (min-width: 980px) {
  .app-shell.desktop-layout #bossAvailableWorkersPanel .boss-team-group-grid,
  #bossAvailableWorkersPanel .boss-team-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
    gap: 10px !important;
  }
  #bossAvailableWorkersPanel .boss-team-person-card,
  #bossAvailableWorkersPanel .boss-team-equipment-card,
  #bossAvailableWorkersPanel .boss-team-subcontractor-card {
    min-height: 108px !important;
    padding: 12px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
}
.foreman-ops-message-section .form-hint { margin: 8px 0 12px; }
.foreman-ops-message-list { display: grid; gap: 10px; }
.foreman-ops-message-list > article { display: grid; gap: 7px; padding: 12px 14px; border: 1px solid #d7e2ef; border-left: 5px solid #1f7bf2; border-radius: 12px; background: #f8fbff; }
.foreman-ops-message-list > article.is-pending { border-left-color: #e9a41b; background: #fffaf0; }
.foreman-ops-message-list > article.is-rejected { border-left-color: #d64550; background: #fff5f6; }
.foreman-ops-message-list article div { display: grid; gap: 3px; }
.foreman-ops-message-list article span { color: #49627c; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.foreman-ops-message-list article p { margin: 0; }
.personal-note-comments { display: grid; gap: 7px; margin-top: 10px; padding: 10px; border-radius: 10px; background: #eef5fc; }
.personal-note-comments > article { padding-top: 7px; border-top: 1px solid #d4dfeb; }
.personal-note-comments > article:first-of-type { border-top: 0; padding-top: 0; }
.personal-note-comments span { color: #58708a; font-size: .75rem; font-weight: 700; }
.personal-note-comments p { margin: 3px 0 0; }
