: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;
}

.work-order-active-group.whole-park-optional {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.045);
}

.whole-park-optional-note {
  display: block;
  width: fit-content;
  margin-top: 0.45rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: 999px;
  color: #2563eb;
  background: rgba(219, 234, 254, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.theme-dark .work-order-active-group.whole-park-optional {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(30, 64, 175, 0.12);
}

.theme-dark .whole-park-optional-note {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 64, 175, 0.28);
}

/* V9.76 - czytelny EIP w ciemnym motywie i automatyczny powrot po aktualizacji. */
.maintenance-recovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 18, 31, .9);
  backdrop-filter: blur(12px);
}

.maintenance-recovery-overlay[hidden] {
  display: none;
}

.maintenance-recovery-card {
  display: grid;
  width: min(100%, 520px);
  gap: 10px;
  justify-items: center;
  padding: clamp(26px, 5vw, 44px);
  border: 1px solid rgba(105, 177, 255, .42);
  border-radius: 24px;
  color: #f7fbff;
  background: #122034;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  text-align: center;
}

.maintenance-recovery-card h2,
.maintenance-recovery-card p {
  margin: 0;
}

.maintenance-recovery-card > p:not(.eyebrow) {
  color: #d4e2f2;
  line-height: 1.55;
}

.maintenance-recovery-card small {
  color: #91a9c2;
}

.maintenance-recovery-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, .16);
  border-top-color: #4b9cff;
  border-radius: 50%;
  animation: maintenance-recovery-spin .8s linear infinite;
}

@keyframes maintenance-recovery-spin {
  to { transform: rotate(360deg); }
}

body.theme-dark .eip-assigned-card,
body.theme-dark .eip-execution-card,
body.theme-dark .eip-selection-card,
body.theme-dark .eip-document-card,
body.theme-dark .eip-preview-card {
  border-color: #385575;
  color: #f5f9ff;
  background: #14243a;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

body.theme-dark .eip-assigned-item {
  border-color: #3b5877;
  border-left-color: #e1a719;
  color: #f7fbff;
  background: #1a2d43;
}

body.theme-dark .eip-assigned-item.complete {
  border-color: #2b7857;
  border-left-color: #35cf83;
  background: #14382d;
}

body.theme-dark .eip-assigned-item.selected {
  box-shadow: 0 0 0 3px rgba(67, 151, 255, .45);
}

body.theme-dark .eip-assigned-item b,
body.theme-dark .eip-assigned-item strong,
body.theme-dark .eip-execution-card h3,
body.theme-dark .eip-execution-card h4,
body.theme-dark .eip-execution-card label,
body.theme-dark .eip-workflow-switch strong,
body.theme-dark .eip-auto-fields strong {
  color: #f7fbff;
}

body.theme-dark .eip-assigned-item > div:first-child span,
body.theme-dark .eip-assigned-item > div:first-child small,
body.theme-dark .eip-execution-heading p,
body.theme-dark .eip-workflow-switch small,
body.theme-dark .eip-form-section-heading small,
body.theme-dark .eip-auto-fields span {
  color: #b9c9dc;
}

body.theme-dark .eip-workflow-switch,
body.theme-dark .eip-auto-fields > div,
body.theme-dark .eip-form-section,
body.theme-dark .eip-execution-step,
body.theme-dark .eip-lock-row {
  border-color: #395777;
  background: #182a40;
}

body.theme-dark .eip-execution-step.done {
  border-color: #31986a;
  background: #16382e;
}

body.theme-dark .eip-execution-badge {
  border-color: #f5c34f;
  color: #ffe69c;
  background: #4a3611;
}

body.theme-dark .eip-execution-badge.complete {
  border-color: #45d38d;
  color: #b9f4d3;
  background: #163c2c;
}

body.theme-dark .eip-step-check span,
body.theme-dark .eip-step-check strong,
body.theme-dark .eip-step-check small,
body.theme-dark .eip-step-time,
body.theme-dark .eip-form-section-heading,
body.theme-dark .eip-document-copy dt,
body.theme-dark .eip-document-copy dd {
  color: #edf5ff;
}

body.theme-dark .eip-step-check small,
body.theme-dark .eip-form-section-heading small,
body.theme-dark .eip-document-copy dt {
  color: #b9c9dc;
}

body.theme-dark .eip-execution-card input[type="text"],
body.theme-dark .eip-execution-card input[type="time"],
body.theme-dark .eip-execution-card select,
body.theme-dark .eip-execution-card textarea,
body.theme-dark .eip-selection-card select {
  border-color: #4a6687;
  color: #f8fbff;
  background: #0f1e31;
}

body.theme-dark .eip-execution-card input::placeholder,
body.theme-dark .eip-execution-card textarea::placeholder {
  color: #8fa6bf;
  opacity: 1;
}

body.theme-dark .eip-execution-actions button,
body.theme-dark .eip-document-actions button,
body.theme-dark .eip-document-actions a {
  border-color: #52749b;
  color: #f7fbff;
  background: #203955;
}

/* V9.70 - wewnetrzny formularz EIP powiazany z poleceniem. */
.eip-assignment-card,
.work-order-eip-gate {
  border: 1px solid color-mix(in srgb, var(--accent, #2583ee) 34%, var(--border, #cbd7e6));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel, #fff) 94%, var(--accent, #2583ee));
  box-shadow: 0 10px 30px rgba(20, 45, 80, .08);
}

.eip-assignment-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(240px, 1fr);
  gap: 16px 22px;
  align-items: end;
  margin: 18px 0;
  padding: 20px;
}

.eip-assignment-card h3,
.eip-assignment-card p {
  margin: 0;
}

.eip-assignment-card > div > p:last-child {
  margin-top: 7px;
  color: var(--muted, #637083);
}

.eip-assignment-card > label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.eip-assignment-card select {
  width: 100%;
  min-height: 48px;
}

.work-order-eip-external input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
}

#eipFormatActions,
#eipAssignmentStatus {
  grid-column: 1 / -1;
}

.work-order-late-member {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr);
  gap: 12px 18px;
  align-items: end;
  padding: 16px;
  border: 1px solid color-mix(in srgb, #2583ee 42%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, #2583ee 6%);
}

.work-order-late-member > div,
.work-order-late-member label {
  display: grid;
  gap: 5px;
}

.work-order-late-member strong,
.work-order-late-member label {
  color: var(--text);
  font-weight: 900;
}

.work-order-late-member small,
.work-order-late-member p {
  color: var(--muted);
  line-height: 1.45;
}

.work-order-late-member p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .78rem;
  font-weight: 750;
}

.work-order-late-member select {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 760px) {
  .work-order-late-member {
    grid-template-columns: 1fr;
  }

  .work-order-late-member p {
    grid-column: auto;
  }
}

body.theme-dark .work-order-late-member {
  border-color: #3f6388;
  background: #172a3e;
}

body.theme-dark .work-order-late-member strong,
body.theme-dark .work-order-late-member label {
  color: #f5f9ff;
}

body.theme-dark .work-order-late-member small,
body.theme-dark .work-order-late-member p {
  color: #c9d8e9;
}

.eip-format-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.eip-format-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 3px 11px;
  align-items: center;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 14px;
  color: var(--opsui-text, var(--ink));
  background: var(--opsui-surface-raised, var(--surface));
  text-align: left;
}

.eip-format-button > span {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: #2386ff;
  font-size: 1.2rem;
}

.eip-format-button.paper > span {
  background: #bf7a10;
}

.eip-format-button strong {
  font-size: .72rem;
  line-height: 1.35;
}

.eip-format-button small {
  color: var(--opsui-muted, var(--muted));
  font-size: .61rem;
  line-height: 1.35;
}

.eip-format-button:not(:disabled):hover,
.eip-format-button:not(:disabled):focus-visible {
  border-color: #2386ff;
  box-shadow: 0 0 0 3px rgba(35, 134, 255, .12);
  transform: translateY(-1px);
}

.work-order-eip-gate {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  padding: 15px;
}

.work-order-eip-gate.required {
  border-color: #e1a719;
  background: color-mix(in srgb, #f7bf2d 12%, var(--panel, #fff));
}

.work-order-eip-gate.complete {
  border-color: #28a868;
  background: color-mix(in srgb, #28a868 10%, var(--panel, #fff));
}

.work-order-eip-gate-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: min(100%, 320px);
}

.work-order-eip-gate-head > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d99a08;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
}

.work-order-eip-gate.complete .work-order-eip-gate-head > span {
  background: #168a50;
}

.work-order-eip-gate-head p {
  margin: 4px 0 0;
  color: var(--muted, #637083);
}

.work-order-eip-external {
  display: grid;
  gap: 10px;
  flex: 1 1 100%;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, #d99a08 30%, transparent);
}

.work-order-eip-external label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 800;
}

.eip-assigned-card {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 18px;
  background: var(--opsui-surface-raised, var(--surface));
}

.eip-assigned-heading,
.eip-assigned-item,
.eip-assigned-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eip-assigned-heading {
  justify-content: space-between;
}

.eip-assigned-heading h3,
.eip-assigned-heading p,
.eip-assigned-item p {
  margin: 0;
}

.eip-assigned-count {
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: #176fd1;
  font-weight: 900;
}

.eip-assigned-list {
  display: grid;
  gap: 10px;
}

.eip-assigned-item {
  justify-content: space-between;
  padding: 13px;
  border: 1px solid var(--opsui-border, var(--line));
  border-left: 5px solid #d89a08;
  border-radius: 13px;
  background: color-mix(in srgb, #f7bf2d 8%, var(--opsui-surface-raised, var(--surface)));
}

.eip-assigned-item.selected {
  box-shadow: 0 0 0 3px rgba(35, 134, 255, .14);
}

.eip-assigned-item.complete {
  border-left-color: #168a50;
  background: color-mix(in srgb, #28a868 8%, var(--opsui-surface-raised, var(--surface)));
}

.eip-assigned-item.canceled {
  border-left-color: #9aa5b4;
  opacity: .72;
}

.eip-assigned-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.eip-assigned-item > div:first-child span,
.eip-assigned-item > div:first-child small {
  color: var(--opsui-muted, var(--muted));
}

.work-order-eip-quick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  margin-top: 9px;
  padding: 12px 15px;
  border: 1px solid #d89a08;
  border-radius: 13px;
  color: var(--opsui-text, var(--ink));
  background: color-mix(in srgb, #f7bf2d 14%, var(--opsui-surface-raised, var(--surface)));
  text-align: left;
}

.work-order-eip-quick > span {
  grid-row: 1 / span 2;
  padding: 8px;
  border-radius: 9px;
  color: #fff;
  background: #d89a08;
  font-weight: 950;
}

.work-order-eip-quick small {
  color: var(--opsui-muted, var(--muted));
}

.work-order-eip-quick.complete {
  border-color: #168a50;
  background: color-mix(in srgb, #28a868 10%, var(--opsui-surface-raised, var(--surface)));
}

.work-order-eip-quick.complete > span {
  background: #168a50;
}

@media (max-width: 720px) {
  .eip-assignment-card {
    grid-template-columns: 1fr;
    padding: 15px;
    border-radius: 15px;
  }

  .eip-assignment-card > *,
  #eipFormatActions,
  #eipAssignmentStatus {
    grid-column: 1;
  }

  .eip-format-actions {
    grid-template-columns: 1fr;
  }

  .work-order-eip-gate,
  .work-order-eip-gate > button,
  .work-order-eip-gate > a,
  .work-order-eip-external button {
    width: 100%;
  }

  .eip-assigned-item {
    align-items: stretch;
    flex-direction: column;
  }

  .eip-assigned-actions,
  .eip-assigned-actions button {
    width: 100%;
  }
}

/* V9.61: informacje o Parku, zastępstwa i rozdzielone kwalifikacje. */
.park-info-panel,
.duty-delegation-panel {
  display: grid;
  gap: 18px;
}

.park-info-select-label {
  max-width: 620px;
}

.park-info-box {
  display: grid;
  gap: 14px;
  border: 1px solid color-mix(in srgb, var(--accent, #1785ff) 35%, var(--border, var(--line)));
  border-left: 5px solid var(--accent, #1785ff);
  background: color-mix(in srgb, var(--surface, #fff) 94%, #1785ff 6%);
}

.duty-delegation-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.duty-delegation-form .full-width {
  grid-column: 1 / -1;
}

.duty-delegation-scope {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue-soft) 58%, var(--surface));
}

.duty-delegation-scope[hidden] { display: none; }

.duty-delegation-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  align-items: center;
}

.selected-person-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 8px 7px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 44%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.selected-person-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-person-chip button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  font-size: 1rem;
  font-weight: 900;
}

.duty-delegation-scope-empty {
  color: var(--muted);
  font-size: .86rem;
}

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

.duty-delegation-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 5px solid #718096;
  border-radius: 14px;
  background: var(--surface, #fff);
}

.duty-delegation-card.status-active { border-left-color: #14a85a; }
.duty-delegation-card.status-planned { border-left-color: #e9a51b; }
.duty-delegation-card.status-revoked,
.duty-delegation-card.status-finished { opacity: .72; }

.duty-delegation-card-scope {
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
}

.duty-delegation-card-scope small {
  color: var(--muted);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.duty-delegation-card-scope p {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 750;
}

.duty-delegation-card-scope.legacy {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
}

body.theme-dark .duty-delegation-scope {
  border-color: #315f94;
  background: #132740;
}

body.theme-dark .selected-person-chip {
  border-color: #3b82f6;
  background: #172b46;
  color: #f3f8ff;
}

body.theme-dark .duty-delegation-card-scope {
  background: #123b2d;
}

body.theme-dark .duty-delegation-card-scope p { color: #eafff3; }

body.theme-dark .duty-delegation-card-scope.legacy { background: #3b3015; }

.work-order-qualification-audit {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .duty-delegation-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .duty-delegation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .duty-delegation-form,
  .duty-delegation-list {
    grid-template-columns: 1fr;
  }
  .duty-delegation-form .full-width {
    grid-column: auto;
  }
}

/* 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: 1300px;
  }

  .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;
  }
}

/* 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.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: #7c3aed;
}

.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: currentColor;
}

.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-card.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.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 {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  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;
  box-sizing: border-box;
  width: 100%;
}

.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;
  }
}

/* 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 (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);
}

/* V9.52 - instrukcja TNVORA, 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;
  }
}

/* V9.81 - czytelna kolejność i kolory pozycji pod kalendarzem. */
#historyPanel .entries-list .report-calendar-card {
  border-color: #38bdf8 !important;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
  color: #075985 !important;
  box-shadow: 0 10px 26px rgba(14, 165, 233, 0.16);
}

#historyPanel .entries-list .report-calendar-card :is(strong, b, span, small) {
  color: #075985 !important;
}

#historyPanel .entries-list .report-calendar-card .date-tile {
  background: linear-gradient(150deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
}

#historyPanel .entries-list .report-calendar-card .date-tile :is(b, span) {
  color: #ffffff !important;
}

#historyPanel .entries-list .closed-work-order-card {
  border-color: #064e3b !important;
  background: linear-gradient(135deg, #14532d 0%, #064e3b 100%) !important;
  color: #ecfdf5 !important;
  box-shadow: 0 10px 26px rgba(6, 78, 59, 0.2);
}

#historyPanel .entries-list .closed-work-order-card :is(strong, b, span, small) {
  color: #ecfdf5 !important;
}

/* V9.82 - kontrast elementow wewnetrznych karty Polecenia Pracy w obu motywach. */
#historyPanel .entries-list .closed-work-order-card .type-badge.work {
  border: 1px solid #86efac !important;
  background: #dcfce7 !important;
  color: #14532d !important;
}

#historyPanel .entries-list .closed-work-order-card .work-order-copy-reference {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #0b4f9c !important;
}

#historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > span,
#historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > small {
  color: #475569 !important;
}

#historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > b {
  color: #0b4f9c !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button > span {
  background: #0b5fc3 !important;
  color: #ffffff !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button > b {
  color: #0f172a !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action {
  border-color: #fecaca !important;
  background: #fff1f2 !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action > span {
  background: #be123c !important;
}

#historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action > b {
  color: #9f1239 !important;
}

#historyPanel .entries-list .closed-work-order-card .date-tile {
  border: 1px solid rgba(167, 243, 208, 0.35);
  background: #052e16 !important;
}

#historyPanel .entries-list .calendar-availability-card {
  width: 100%;
  min-height: 0;
  border-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

#historyPanel .entries-list .calendar-availability-card:hover,
#historyPanel .entries-list .calendar-availability-card:focus-visible {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 10px 26px rgba(120, 53, 15, 0.12);
  transform: translateY(-1px);
}

#historyPanel .entries-list .calendar-availability-card small {
  display: block;
  margin-top: 5px;
  color: #92400e;
  font-weight: 800;
}

.calendar-marker,
.calendar-marker.marker-report {
  background: #38bdf8;
}

.calendar-marker.marker-order {
  background: #14532d;
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.18);
}

body.theme-dark #historyPanel .entries-list .report-calendar-card {
  border-color: #38bdf8 !important;
  background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%) !important;
  color: #e0f2fe !important;
}

body.theme-dark #historyPanel .entries-list .report-calendar-card :is(strong, b, span, small) {
  color: #e0f2fe !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card {
  border-color: #34d399 !important;
  background: linear-gradient(135deg, #14532d 0%, #052e16 100%) !important;
  color: #ecfdf5 !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card :is(strong, b, span, small) {
  color: #ecfdf5 !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .type-badge.work {
  border-color: #34d399 !important;
  background: #064e3b !important;
  color: #d1fae5 !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .work-order-copy-reference {
  border-color: #60a5fa !important;
  background: #172f4d !important;
  color: #eff6ff !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > span,
body.theme-dark #historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > small {
  color: #bfdbfe !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .work-order-copy-reference > b {
  color: #ffffff !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button {
  border-color: #64748b !important;
  background: #253855 !important;
  color: #ffffff !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button > span {
  background: #0f7bf6 !important;
  color: #ffffff !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button > b {
  color: #ffffff !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action {
  border-color: #fb7185 !important;
  background: #7f1d1d !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action > span {
  background: #be123c !important;
}

body.theme-dark #historyPanel .entries-list .closed-work-order-card .history-pdf-button.danger-action > b {
  color: #ffe4e6 !important;
}

body.theme-dark #historyPanel .entries-list .calendar-availability-card {
  border-color: #f59e0b !important;
  background: #3b2f13 !important;
  color: #fef3c7 !important;
}

body.theme-dark #historyPanel .entries-list .calendar-availability-card :is(strong, b, span, small) {
  color: #fef3c7 !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%;
  }
}

/* V10.04 — przezroczyste logo, firmowy przycisk i kompaktowa zgoda cookies. */
html body .login-logo {
  width: 100%;
  min-height: 112px;
  margin: -4px auto 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

html body .login-logo img {
  width: min(100%, 440px);
  max-width: 440px;
  height: auto;
  max-height: none;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 18px rgba(7, 70, 88, 0.12));
}

html body .login-logo-dark-theme {
  display: none;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-logo-light-theme {
  display: none;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-logo-dark-theme {
  display: block;
}

html body #loginForm > .primary-button[type="submit"] {
  color: #ffffff;
  border: 1px solid rgba(10, 135, 164, 0.7);
  background: linear-gradient(105deg, #1479f7 0%, #0ea7b5 55%, #63ad3d 100%);
  box-shadow: 0 12px 26px rgba(10, 139, 167, 0.24);
}

html body #loginForm > .primary-button[type="submit"]:hover,
html body #loginForm > .primary-button[type="submit"]:focus-visible {
  background: linear-gradient(105deg, #0f68dc 0%, #0b929e 55%, #559836 100%);
  box-shadow: 0 14px 30px rgba(10, 139, 167, 0.32);
}

html body .cookie-consent-dialog {
  position: fixed;
  inset: auto 18px 18px auto;
  width: min(430px, calc(100vw - 36px));
  max-height: min(72dvh, 620px);
  margin: 0;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(4, 43, 57, 0.24);
}

html body .cookie-consent-dialog::backdrop {
  background: rgba(6, 31, 43, 0.12);
  backdrop-filter: none;
}

html body .cookie-consent-dialog form {
  padding: 15px;
}

html body .cookie-consent-brand {
  margin-bottom: 8px;
}

html body .cookie-consent-brand img {
  width: 112px;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

html body .cookie-consent-brand span {
  display: none;
}

html body .cookie-consent-copy .eyebrow {
  margin-bottom: 2px;
  font-size: 0.62rem;
}

html body .cookie-consent-copy h2 {
  margin: 2px 0 6px;
  font-size: 1.18rem;
  line-height: 1.2;
}

html body .cookie-consent-copy > p:last-child {
  font-size: 0.78rem;
  line-height: 1.42;
}

html body .cookie-consent-actions {
  gap: 7px;
  margin-top: 12px;
}

html body .cookie-consent-actions button {
  min-height: 38px;
  padding: 7px 8px;
  font-size: 0.7rem;
  line-height: 1.15;
}

html body .cookie-preferences {
  margin-top: 12px;
  padding: 10px;
  border-radius: 13px;
}

html body .cookie-preference-row {
  gap: 10px;
  padding: 8px 2px;
}

html body .cookie-preference-row strong {
  font-size: 0.78rem;
}

html body .cookie-preference-row small {
  font-size: 0.68rem;
}

html body .cookie-preference-row input {
  width: 20px;
  height: 20px;
}

html body .cookie-consent-footer {
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 0.68rem;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-brand img {
  content: url("tnvora-logo-light.svg?v=20260808-v1005-brand");
}

@media (max-width: 640px) {
  html body .login-logo {
    min-height: 86px;
    margin: -2px auto 10px;
  }

  html body .login-logo img {
    width: min(100%, 360px);
    max-width: 360px;
    max-height: none;
  }

  html body .cookie-consent-dialog {
    inset: auto 8px 8px 8px;
    width: auto;
    max-height: min(76dvh, 580px);
    border-radius: 14px;
  }

  html body .cookie-consent-dialog form {
    padding: 13px;
  }

  html body .cookie-consent-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ================================================================
   TNVORA V10.03 — branding, tlo oraz centrum prywatnosci
   ================================================================ */
:root {
  --tnvora-navy: #0b2633;
  --tnvora-blue: #126f94;
  --tnvora-turquoise: #1aa79c;
  --tnvora-mint: #dff7f4;
}

html body {
  background-color: #eaf7f7;
  background-image:
    radial-gradient(circle at 8% 4%, rgba(46, 190, 181, 0.18), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(54, 151, 201, 0.14), transparent 38rem),
    linear-gradient(145deg, #f7fbfd 0%, #e8f6f6 48%, #e4f3f7 100%);
  background-attachment: fixed;
}

html body::before {
  opacity: 0.28;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(26, 167, 156, 0.12) 46% 47%, transparent 47% 100%),
    linear-gradient(25deg, transparent 0 49%, rgba(18, 111, 148, 0.08) 49% 50%, transparent 50% 100%);
  background-position: 0 0, 0 0;
  background-size: 150px 150px, 190px 190px;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) {
  background-color: #071c27;
  background-image:
    radial-gradient(circle at 9% 4%, rgba(20, 157, 148, 0.19), transparent 34rem),
    radial-gradient(circle at 90% 12%, rgba(24, 111, 150, 0.18), transparent 38rem),
    linear-gradient(145deg, #071925 0%, #0a2731 52%, #09232d 100%);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"])::before {
  opacity: 0.36;
  background-image:
    linear-gradient(115deg, transparent 0 46%, rgba(53, 206, 192, 0.09) 46% 47%, transparent 47% 100%),
    linear-gradient(25deg, transparent 0 49%, rgba(84, 176, 215, 0.08) 49% 50%, transparent 50% 100%);
}

.side-brand-logo {
  width: 54px;
  height: 54px;
  padding: 4px;
  object-fit: contain;
  background: #ffffff;
}

.side-brand-title {
  max-width: 164px;
  font-size: 0.67rem;
  line-height: 1.2;
  letter-spacing: 0.055em;
  overflow-wrap: anywhere;
}

.login-dialog {
  width: min(calc(100vw - 32px), 520px);
  padding: 30px 38px 28px;
  border: 1px solid rgba(26, 167, 156, 0.28);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(9, 56, 72, 0.24);
}

.login-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 7%, rgba(42, 190, 180, 0.24), transparent 30rem),
    linear-gradient(145deg, rgba(237, 249, 250, 0.96), rgba(216, 240, 243, 0.97));
}

.login-logo {
  width: 100%;
  min-height: 214px;
  margin: -12px auto 2px;
  display: grid;
  place-items: center;
}

.login-logo img {
  width: min(100%, 380px);
  max-width: 380px;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(7, 70, 88, 0.15));
}

.login-product-name {
  max-width: 410px;
  margin: 0 auto 24px;
  color: var(--tnvora-navy);
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-align: center;
}

.login-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 20px -4px 8px;
  padding-top: 16px;
  border-top: 1px solid #d8e6ec;
  font-size: 0.75rem;
}

.login-legal-links a,
.login-legal-links button {
  min-height: 28px;
  padding: 3px 0;
  color: #126f94;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.login-legal-links a:hover,
.login-legal-links button:hover {
  color: #0b766f;
  text-decoration: underline;
}

.cookie-consent-dialog {
  width: min(calc(100vw - 28px), 650px);
  max-height: min(86vh, 760px);
  padding: 0;
  color: #142938;
  border: 1px solid rgba(18, 111, 148, 0.24);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(4, 43, 57, 0.3);
  overflow: auto;
}

.cookie-consent-dialog::backdrop {
  background: rgba(6, 31, 43, 0.62);
  backdrop-filter: blur(8px);
}

.cookie-consent-dialog form {
  padding: 28px;
}

.cookie-consent-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--tnvora-navy);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.cookie-consent-brand img {
  width: 64px;
  height: 52px;
  padding: 3px;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff;
}

.cookie-consent-copy h2 {
  margin: 3px 0 12px;
  color: var(--tnvora-navy);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
}

.cookie-consent-copy > p:last-child {
  margin: 0;
  color: #536879;
  line-height: 1.65;
}

.cookie-consent-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.cookie-consent-actions button {
  min-height: 48px;
}

.cookie-preferences {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #cfe1e7;
  border-radius: 18px;
  background: #f3fafb;
}

.cookie-preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid #dae7eb;
}

.cookie-preference-row:last-of-type {
  border-bottom: 0;
}

.cookie-preference-row span {
  display: grid;
  gap: 3px;
}

.cookie-preference-row strong {
  color: #142938;
}

.cookie-preference-row small {
  color: #627887;
  line-height: 1.4;
}

.cookie-preference-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--tnvora-turquoise);
}

.cookie-preferences > .primary-button {
  width: 100%;
  margin-top: 14px;
}

.cookie-consent-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 20px;
  font-size: 0.78rem;
}

.cookie-consent-footer a {
  color: #126f94;
  font-weight: 800;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-dialog,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-dialog {
  color: #edf9fb;
  border-color: rgba(75, 209, 197, 0.32);
  background: #0c2532;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 7%, rgba(28, 173, 163, 0.24), transparent 30rem),
    linear-gradient(145deg, rgba(4, 20, 29, 0.96), rgba(6, 43, 52, 0.98));
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-product-name,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-brand,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-copy h2,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-preference-row strong {
  color: #efffff;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-legal-links {
  border-top-color: #2b4a58;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-legal-links a,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-legal-links button,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-footer a {
  color: #67d8d0;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-consent-copy > p:last-child,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-preference-row small {
  color: #bfd3dc;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-preferences {
  border-color: #2d5260;
  background: #102f3c;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .cookie-preference-row {
  border-bottom-color: #2b4a58;
}

@media (max-width: 640px) {
  .login-dialog {
    width: min(calc(100vw - 20px), 480px);
    max-height: calc(100dvh - 20px);
    padding: 22px 22px 20px;
  }

  .login-logo {
    min-height: 158px;
    margin-top: -8px;
  }

  .login-logo img {
    width: min(100%, 290px);
    max-height: 158px;
  }

  .login-product-name {
    margin-bottom: 18px;
    font-size: 0.68rem;
  }

  .cookie-consent-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 20px;
  }

  .cookie-consent-dialog form {
    padding: 20px;
  }

  .cookie-consent-actions {
    grid-template-columns: 1fr;
  }
}

@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;
}

.linked-report-field-locked .pl-date-display:disabled,
.linked-report-field-locked select:disabled {
  cursor: not-allowed;
  opacity: 1;
  border-color: #94a3b8;
  color: #334155;
  background: #e2e8f0;
}

body.theme-dark .linked-report-field-locked .pl-date-display:disabled,
body.theme-dark .linked-report-field-locked select:disabled {
  border-color: #64748b;
  color: #e2e8f0;
  background: #1e293b;
}

/* 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-actions {
  display: grid;
  gap: 6px;
}

.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%;
  }

  .technician-alert-actions {
    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: #34d399 !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: #14532d;
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.18);
  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: #14532d;
  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(20, 83, 45, 0.12);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(20, 83, 45, 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: url("tnwind-watermark-checker.png?v=20260625-v756-green");
  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 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: minmax(0, 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-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #f59e0b;
  border-radius: 14px;
  color: #78350f;
  background: #fffbeb;
}

.pending-report-summary > div {
  display: grid;
  gap: 3px;
}

.pending-report-summary strong,
.pending-report-summary b {
  font-weight: 950;
}

.pending-report-summary b {
  min-width: 148px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #ffffff;
  text-align: center;
  background: #d97706;
}

.pending-report-summary.blocked {
  border-color: #dc2626;
  color: #7f1d1d;
  background: #fef2f2;
}

.pending-report-summary.blocked b {
  background: #b91c1c;
}

.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;
}

[data-report-countdown] {
  font-variant-numeric: tabular-nums;
}

[data-report-countdown].overdue {
  color: #b91c1c;
}

.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;
}

.report-compliance-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.report-compliance-order-row .pending-report-dismiss {
  min-width: 112px;
}

.report-compliance-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 24px;
  border: 1px solid #f59e0b;
  border-radius: 22px;
  color: #172033;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
}

.report-compliance-dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
}

.report-compliance-dialog.blocked {
  border-color: #dc2626;
}

.report-compliance-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 16px;
  color: #ffffff;
  background: #f59e0b;
  font-size: 1.7rem;
  font-weight: 950;
}

.report-compliance-dialog.blocked .report-compliance-icon {
  background: #dc2626;
}

.report-compliance-dialog h3 {
  margin: 6px 0 8px;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
}

.report-compliance-dialog > p:not(.eyebrow) {
  margin: 0 0 14px;
  color: #526076;
  line-height: 1.5;
}

.report-compliance-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  color: #78350f;
  background: #fffbeb;
}

.report-compliance-counter strong {
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #ffffff;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: #d97706;
}

.report-compliance-dialog.blocked .report-compliance-counter {
  color: #7f1d1d;
  background: #fef2f2;
}

.report-compliance-dialog.blocked .report-compliance-counter strong {
  background: #b91c1c;
}

.report-compliance-list {
  display: grid;
  gap: 8px;
  max-height: min(420px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.report-compliance-order {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d9e2ef;
  border-radius: 13px;
  color: #172033;
  text-align: left;
  background: #f8fafc;
}

.report-compliance-order:hover,
.report-compliance-order:focus-visible {
  border-color: #2783ef;
  background: #eff6ff;
}

.report-compliance-order span,
.report-compliance-order small {
  color: #58677d;
}

.report-compliance-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
}

.report-compliance-blocked,
.report-compliance-blocked:hover {
  color: #ffffff !important;
  background: #b91c1c !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.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;
}

.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),
    url("tnwind-watermark-checker.png?v=20260625-v756-green");
  background-repeat: no-repeat, repeat;
  background-size: auto, 420px 250px;
  background-position: center, 24px 30px;
}

.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.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;
}

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 .pending-report-summary,
body.theme-dark .report-compliance-dialog,
body.theme-dark .report-compliance-order {
  color: #f8fafc;
  border-color: #4b5f79;
  background: #111b29;
}

body.theme-dark .pending-report-dismiss {
  border-color: #7f3a42;
  color: #fecaca;
  background: #3a171c;
}

body.theme-dark .pending-report-dismiss:hover,
body.theme-dark .pending-report-dismiss:focus-visible {
  border-color: #ef6b76;
  color: #ffffff;
  background: #5a2028;
}

body.theme-dark .pending-report-summary.blocked,
body.theme-dark .report-compliance-dialog.blocked {
  border-color: #ef4444;
}

body.theme-dark .report-compliance-dialog > p:not(.eyebrow),
body.theme-dark .report-compliance-order span,
body.theme-dark .report-compliance-order small {
  color: #b9c8dc;
}

body.theme-dark .report-compliance-counter {
  color: #fde68a;
  background: #2a220f;
}

body.theme-dark .report-compliance-dialog.blocked .report-compliance-counter {
  color: #fecaca;
  background: #301517;
}

body.theme-dark .report-compliance-order:hover,
body.theme-dark .report-compliance-order:focus-visible {
  border-color: #4d9cff;
  background: #172b45;
}

@media (max-width: 600px) {
  .report-compliance-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px;
    border-radius: 18px;
  }

  .report-compliance-counter,
  .pending-report-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .pending-report-card,
  .report-compliance-order-row {
    grid-template-columns: 1fr;
  }

  .pending-report-card .pending-report-dismiss,
  .report-compliance-order-row .pending-report-dismiss {
    width: 100%;
    min-height: 44px;
  }

  .report-compliance-counter strong,
  .pending-report-summary b {
    width: 100%;
    min-width: 0;
  }

  .report-compliance-actions {
    grid-template-columns: 1fr;
  }

  .report-compliance-list {
    max-height: 38vh;
  }
}

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;
}

/* Wspolny CERT: karta wybranej osoby zachowuje czytelny uklad w obu motywach. */
#adminPanel .admin-selected-users .collaborator-chip.selection-person-card {
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  grid-template-areas: "avatar copy action";
  gap: 10px;
  min-height: 66px;
}

#adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-person-avatar {
  grid-area: avatar;
}

#adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-person-copy {
  display: flex;
  grid-area: copy;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

#adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-person-copy b,
#adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-person-copy small {
  grid-area: auto;
  width: 100%;
}

#adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-icon-button {
  grid-area: action;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: #b4232d;
  background: color-mix(in srgb, #e0565b 13%, transparent);
}

body.theme-dark #adminPanel .admin-selected-users .collaborator-chip.selection-person-card .selection-icon-button {
  color: #ffb4b8;
  background: rgba(153, 27, 31, 0.22);
}

#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: repeat(2, minmax(0, 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);
}

@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;
  }

  #adminFarmManagement .admin-farm-row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@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);
}

.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-days {
  grid-template-rows: repeat(6, 50px);
}

.pl-calendar-empty {
  min-width: 0;
  min-height: 0;
  pointer-events: none;
}

.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-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-days {
    grid-template-rows: repeat(6, 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-days {
    grid-template-rows: repeat(6, 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(3, minmax(0, 1fr));
}

.boss-employee-rate-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.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: 1220px;
  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-table td:first-child .toa-location {
  margin-top: 6px;
  color: var(--text);
  font-weight: 900;
  letter-spacing: .01em;
}

.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-document-button.canceled {
  border-color: color-mix(in srgb, var(--danger, #d94149) 42%, var(--border));
  background: color-mix(in srgb, var(--danger, #d94149) 7%, var(--surface));
  opacity: .62;
}

.toa-document-button.canceled span {
  color: var(--danger, #c52c35);
}

.toa-eip-documents {
  display: grid;
  gap: 7px;
  min-width: 150px;
}

.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, var(--line)));
  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:disabled,
.toa-apo-close-button.primary-button:disabled,
body.theme-dark .toa-apo-close-button:disabled,
body.theme-dark .toa-apo-close-button.primary-button:disabled {
  border-color: #42d883 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #16884d, #0d6638) !important;
  box-shadow: 0 12px 28px rgba(22, 136, 77, .24) !important;
  opacity: .78 !important;
}

.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: #c084fc !important;
  background: #6d28d9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.22), 0 10px 24px rgba(0, 0, 0, 0.28) !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: #6d28d9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px #60a5fa, 0 0 0 7px rgba(192, 132, 252, 0.2) !important;
}

/* V9.83 - kazdy stan dostepnosci ma unikalny kolor w obu motywach. */
#vacationPanel .vacation-legend .legend-own i {
  background: #7c3aed !important;
}

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

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

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

#vacationPanel button.vacation-day.vacation-selected {
  border-color: #7c3aed !important;
  background: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.28) !important;
}

#vacationPanel button.vacation-day.vacation-selected.vacation-team-highlight {
  border-color: #ffffff !important;
  background: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px #2563eb, 0 8px 18px rgba(124, 58, 237, 0.28) !important;
}

body.theme-dark #vacationPanel button.vacation-day.vacation-selected {
  border-color: #c084fc !important;
  background: #6d28d9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.22), 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

body.theme-dark #vacationPanel button.vacation-day.vacation-selected.vacation-team-highlight {
  border-color: #ffffff !important;
  background: #6d28d9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px #60a5fa, 0 0 0 7px rgba(192, 132, 252, 0.2) !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: 1300px;
  }

  .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;
  }
}
/* TNVORA V01 — porozumienie Boss / Leader */
.tnvora-agreement-panel {
  --agreement-blue: #0b67d1;
  --agreement-navy: #102338;
  --agreement-green: #087443;
  --agreement-amber: #b97808;
}

.tnvora-agreement-title {
  align-items: flex-start;
}

.tnvora-document-version {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #9bc8f5;
  border-radius: 999px;
  color: var(--agreement-blue);
  background: #edf7ff;
  font-weight: 900;
  letter-spacing: .06em;
}

.tnvora-agreement-content {
  display: grid;
  gap: 18px;
}

.tnvora-boss-setup,
.tnvora-leader-management {
  display: grid;
  gap: 14px;
}

.tnvora-setup-card,
.tnvora-leader-card,
.tnvora-document-editor,
.tnvora-acceptance-box {
  border: 1px solid #c9d9e8;
  border-radius: 18px;
  background: #f7fbff;
  padding: 18px;
}

.tnvora-setup-card.company-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr);
  gap: 24px;
  align-items: end;
  border-left: 5px solid var(--agreement-blue);
}

.tnvora-setup-card span,
.tnvora-leader-card header span,
.tnvora-editor-heading span,
.tnvora-acceptance-box > div > span {
  color: var(--agreement-blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.tnvora-setup-card h3,
.tnvora-leader-card h3,
.tnvora-editor-heading h3,
.tnvora-acceptance-box h3 {
  margin: 4px 0;
}

#tnvoraCompanyForm,
.tnvora-counterparty-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tnvora-company-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tnvora-company-form button {
  grid-column: 1 / -1;
}

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

.tnvora-counterparty-details button {
  grid-column: 1 / -1;
}

.tnvora-counterparty-readonly {
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid #d8e4ef;
  border-bottom: 1px solid #d8e4ef;
}

.tnvora-counterparty-readonly span,
.tnvora-counterparty-readonly strong,
.tnvora-counterparty-readonly p {
  display: block;
  margin: 4px 0;
}

.tnvora-counterparty-readonly span {
  color: #61768a;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.tnvora-leader-management {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tnvora-leader-card {
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tnvora-leader-card:hover,
.tnvora-leader-card.active {
  border-color: #55a5ec;
  box-shadow: 0 10px 28px rgba(11, 103, 209, .12);
}

.tnvora-leader-card.active {
  transform: translateY(-1px);
}

.tnvora-leader-card header,
.tnvora-editor-heading,
.tnvora-assignment-head,
.tnvora-document-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tnvora-leader-card header > b,
.tnvora-document-actions b {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .7rem;
}

.tnvora-leader-card header > b.accepted,
.tnvora-document-actions b.accepted {
  background: #dff8e9;
  color: #056638;
}

.tnvora-leader-card header > b.pending,
.tnvora-document-actions b.pending {
  background: #fff0c8;
  color: #805200;
}

.tnvora-counterparty-form {
  margin: 14px 0;
  padding-top: 14px;
  border-top: 1px solid #d8e4ef;
}

.tnvora-assignment-head {
  margin-top: 14px;
}

.tnvora-assignment-head span {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: var(--agreement-navy);
  color: #fff;
  font-weight: 900;
}

.tnvora-technician-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.tnvora-technician-chips > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #a8cbea;
  border-radius: 999px;
  background: #fff;
  color: #17324d;
  font-weight: 800;
}

.tnvora-technician-chips button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #ffe6e8;
  color: #aa1d2c;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.tnvora-add-technician select {
  margin-top: 6px;
}

.tnvora-document-editor {
  border-left: 5px solid var(--agreement-blue);
}

.tnvora-park-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tnvora-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #c7d7e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.tnvora-choice-card.selected {
  border-color: #1ba467;
  background: #eafaf2;
  box-shadow: inset 4px 0 #1ba467;
}

.tnvora-choice-card input {
  width: 22px;
  height: 22px;
  accent-color: #118e58;
}

.tnvora-choice-card span {
  font-weight: 850;
}

.tnvora-choice-card small {
  color: #66798c;
  font-size: .65rem;
  font-weight: 900;
}

.tnvora-document {
  width: min(100%, 1040px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #bccbd8;
  border-radius: 8px;
  background: #fff;
  color: #17212b;
  box-shadow: 0 18px 50px rgba(15, 32, 51, .14);
  font-family: Arial, sans-serif;
}

.tnvora-document-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 4px solid var(--agreement-blue);
}

.tnvora-document-head img {
  display: block;
  width: 140px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.tnvora-document-head > div:nth-child(2) {
  display: grid;
  gap: 4px;
}

.tnvora-document-head > div:nth-child(2) span {
  color: var(--agreement-blue);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
}

.tnvora-document-head > div:nth-child(2) strong {
  font-size: 1.05rem;
}

.tnvora-document-meta {
  display: grid;
  gap: 4px;
  min-width: 118px;
  padding-left: 18px;
  border-left: 1px solid #cbd7e1;
  text-align: right;
}

.tnvora-document-meta b {
  color: var(--agreement-blue);
  font-size: 1.1rem;
}

.tnvora-document-body {
  padding: 34px;
}

.tnvora-document-body > h2 {
  max-width: 720px;
  margin: 0 auto 10px;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.25;
}

.tnvora-legal-basis {
  max-width: 760px;
  margin: 0 auto 28px;
  color: #5a6876;
  text-align: center;
  line-height: 1.55;
}

.tnvora-parties-grid,
.tnvora-scope-grid,
.tnvora-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tnvora-parties-grid > div,
.tnvora-scope-grid > div {
  padding: 18px;
  border: 1px solid #d6e0e9;
  border-radius: 10px;
  background: #f8fafc;
}

.tnvora-parties-grid span,
.tnvora-signature-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--agreement-blue);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.tnvora-parties-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
}

.tnvora-parties-grid p,
.tnvora-scope-grid p {
  margin: 5px 0;
  line-height: 1.45;
}

.tnvora-scope-grid {
  margin-top: 14px;
}

.tnvora-scope-grid h3,
.tnvora-document-section h3 {
  margin: 0 0 10px;
  font-size: .95rem;
}

.tnvora-scope-grid ol,
.tnvora-document-section ul {
  margin: 0;
  padding-left: 22px;
}

.tnvora-missing {
  color: #a15e00;
  font-weight: 800;
}

.tnvora-document-section {
  margin-top: 22px;
}

.tnvora-document-section p,
.tnvora-document-section li {
  line-height: 1.55;
}

.tnvora-signature-grid {
  margin-top: 30px;
}

.tnvora-signature-grid > div {
  min-height: 110px;
  padding: 18px;
  border: 1px solid #cad6e0;
  border-radius: 10px;
  background: #fff;
}

.tnvora-signature-grid > div.signed {
  border-color: #5bc48e;
  background: #edfbf4;
}

.tnvora-signature-grid > div.pending {
  border-color: #e5bb5e;
  background: #fff9e9;
}

.tnvora-signature-grid strong,
.tnvora-signature-grid small {
  display: block;
}

.tnvora-signature-grid small {
  margin-top: 8px;
  color: #607080;
}

.tnvora-document-actions {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.tnvora-acceptance-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr) auto;
  gap: 18px;
  align-items: center;
  border-left: 5px solid var(--agreement-amber);
  background: #fffaf0;
}

.tnvora-acceptance-box.accepted {
  grid-template-columns: minmax(0, 1fr) auto;
  border-left-color: var(--agreement-green);
  background: #edfbf4;
}

.tnvora-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.4;
}

.tnvora-consent input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  accent-color: var(--agreement-green);
}

.tnvora-accepted-seal {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 3px solid #14945b;
  border-radius: 50%;
  color: #087443;
  font-size: 1.1rem;
  transform: rotate(-6deg);
}

body.dark-theme .tnvora-setup-card,
body.dark-theme .tnvora-leader-card,
body.dark-theme .tnvora-document-editor,
body.dark-theme .tnvora-acceptance-box {
  border-color: #30465e;
  background: #142337;
}

body.dark-theme .tnvora-document {
  color: #17212b;
}

body.dark-theme .tnvora-leader-card.active {
  border-color: #479ceb;
}

@media (max-width: 900px) {
  .tnvora-leader-management,
  .tnvora-setup-card.company-card,
  .tnvora-acceptance-box,
  .tnvora-acceptance-box.accepted {
    grid-template-columns: 1fr;
  }
  .tnvora-park-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tnvora-document-version {
    padding: 7px 10px;
    font-size: .72rem;
  }
  #tnvoraCompanyForm,
  .tnvora-counterparty-form {
    grid-template-columns: 1fr;
  }
  .tnvora-company-form button {
    grid-column: auto;
  }
  .tnvora-counterparty-details button {
    grid-column: auto;
  }
  .tnvora-leader-card,
  .tnvora-document-editor,
  .tnvora-acceptance-box,
  .tnvora-setup-card {
    padding: 14px;
    border-radius: 14px;
  }
  .tnvora-leader-card header,
  .tnvora-document-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .tnvora-park-picker,
  .tnvora-parties-grid,
  .tnvora-scope-grid,
  .tnvora-signature-grid {
    grid-template-columns: 1fr;
  }
  .tnvora-document-head {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 16px;
  }
  .tnvora-document-head img {
    width: 112px;
  }
  .tnvora-document-head > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .tnvora-document-meta {
    grid-column: 2;
    grid-row: 1;
  }
  .tnvora-document-body {
    padding: 18px 16px;
  }
  .tnvora-document-body > h2 {
    font-size: 1.05rem;
  }
}

@media print {
  body.printing-tnvora-agreement > *:not(#appShell),
  body.printing-tnvora-agreement #appShell > *:not(#appContent),
  body.printing-tnvora-agreement #appContent > *:not(#tnvoraAgreementPanel),
  body.printing-tnvora-agreement #tnvoraAgreementPanel > *:not(.tnvora-agreement-content),
  body.printing-tnvora-agreement .tnvora-agreement-content > *:not(.tnvora-document) {
    display: none !important;
  }
  body.printing-tnvora-agreement,
  body.printing-tnvora-agreement #appShell,
  body.printing-tnvora-agreement #appContent,
  body.printing-tnvora-agreement #tnvoraAgreementPanel,
  body.printing-tnvora-agreement .tnvora-agreement-content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.printing-tnvora-agreement .tnvora-document {
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  body.printing-tnvora-agreement .tnvora-document-body {
    padding: 18px 24px !important;
  }
  @page { size: A4; margin: 10mm; }
}

/* V9.65 - biblioteka EIP dla Technika. */
.eip-panel {
  display: grid;
  gap: 16px;
}

.eip-heading,
.eip-preview-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eip-heading {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--opsui-border, var(--line));
}

.eip-heading h2,
.eip-preview-card h3,
.eip-document-card h3 {
  margin: 3px 0 0;
}

.eip-heading > div > p:last-child {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--opsui-muted, var(--muted));
  font-size: .76rem;
  line-height: 1.5;
}

.eip-test-badge {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(31, 189, 105, .42);
  border-radius: 999px;
  color: #29c875;
  background: rgba(31, 189, 105, .1);
  font-size: .62rem;
  font-weight: 950;
  white-space: nowrap;
}

.eip-steps {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 13px;
  color: var(--opsui-muted, var(--muted));
  background: var(--opsui-surface-muted, var(--surface-soft));
}

.eip-steps span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .67rem;
  font-weight: 900;
}

.eip-steps span b {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #16885a;
  font-size: .65rem;
}

.eip-steps i {
  color: var(--opsui-primary, #2386ff);
  font-style: normal;
  font-weight: 950;
}

.eip-workspace {
  display: grid;
  grid-template-columns: minmax(330px, .86fr) minmax(380px, 1.14fr);
  gap: 14px;
}

.eip-selection-card,
.eip-document-card,
.eip-preview-card {
  min-width: 0;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 15px;
  background: var(--opsui-surface-muted, var(--surface-soft));
}

.eip-selection-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.eip-selection-card fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.eip-selection-card legend,
.eip-selection-card label > span {
  display: block;
  margin-bottom: 8px;
  color: var(--opsui-text, var(--text));
  font-size: .69rem;
  font-weight: 950;
}

.eip-selection-card label {
  display: grid;
  min-width: 0;
}

.eip-selection-card select {
  width: 100%;
  min-height: 48px;
  font-size: .76rem;
  font-weight: 850;
}

.eip-selection-card label small {
  margin-top: 6px;
  color: var(--opsui-muted, var(--muted));
  font-size: .61rem;
  line-height: 1.4;
}

.eip-manufacturer-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.eip-manufacturer-button {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 3px 9px;
  padding: 11px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 12px;
  color: var(--opsui-text, var(--text));
  background: var(--opsui-surface-raised, var(--surface));
  text-align: left;
  cursor: pointer;
}

.eip-manufacturer-button > span {
  display: grid;
  width: 36px;
  height: 36px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #117d52, #21b66f);
  font-size: .95rem;
  font-weight: 950;
}

.eip-manufacturer-button b {
  overflow: hidden;
  font-size: .72rem;
  text-overflow: ellipsis;
}

.eip-manufacturer-button small {
  overflow: hidden;
  color: var(--opsui-muted, var(--muted));
  font-size: .56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eip-manufacturer-button:hover,
.eip-manufacturer-button:focus-visible,
.eip-manufacturer-button.active {
  border-color: #23b56f;
  background: rgba(31, 189, 105, .12);
  box-shadow: 0 0 0 2px rgba(31, 189, 105, .08);
}

.eip-document-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(31, 189, 105, .13), var(--opsui-surface-muted, var(--surface-soft)) 54%);
}

.eip-document-icon {
  display: grid;
  width: 58px;
  height: 66px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #b81f32, #e04855);
  box-shadow: 0 10px 24px rgba(184, 31, 50, .2);
  font-size: .74rem;
  font-weight: 950;
}

.eip-document-copy {
  min-width: 0;
}

.eip-document-copy h3 {
  color: var(--opsui-text, var(--text));
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.25;
}

.eip-document-copy dl {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
}

.eip-document-copy dl > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--opsui-border, var(--line));
}

.eip-document-copy dt,
.eip-document-copy dd {
  margin: 0;
  font-size: .68rem;
  line-height: 1.4;
}

.eip-document-copy dt {
  color: var(--opsui-muted, var(--muted));
  font-weight: 850;
}

.eip-document-copy dd {
  color: var(--opsui-text, var(--text));
  font-weight: 900;
}

.eip-document-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-self: end;
}

.eip-document-actions a,
.eip-document-actions button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.eip-document-actions .eip-confirm-document-button {
  grid-column: 1 / -1;
  min-height: 52px;
  border: 1px solid #15803d;
  border-radius: 12px;
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(21, 128, 61, .2);
}

.eip-document-actions .eip-confirm-document-button:hover,
.eip-document-actions .eip-confirm-document-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.eip-preview-card {
  overflow: hidden;
  background: var(--opsui-surface-raised, var(--surface));
}

.eip-preview-card > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.eip-preview-card > summary::-webkit-details-marker {
  display: none;
}

.eip-preview-card[open] > summary {
  border-bottom: 1px solid var(--opsui-border, var(--line));
}

.eip-preview-card > summary span {
  color: var(--opsui-muted, var(--muted));
  font-size: .61rem;
  font-weight: 800;
}

/* V9.84 - pełny dokument źródłowy jest nadrzędny wobec rejestru pomocniczego TNVORA. */
#eipSourceOpenButton,
#eipExecutionSourceDetails {
  display: none !important;
}

.eip-procedure-toolbar {
  position: sticky;
  z-index: 4;
  top: calc(var(--topbar-height, 72px) + 6px);
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid #d79a2d;
  border-radius: 14px;
  background: #fff9e9;
  box-shadow: 0 10px 24px rgba(107, 73, 14, .16);
}

.eip-procedure-toolbar > div {
  display: grid;
  gap: 3px;
  text-align: center;
}

.eip-procedure-toolbar strong {
  color: #172033;
  font-size: .78rem;
}

.eip-procedure-toolbar span {
  color: #6b4b16;
  font-size: .66rem;
  font-weight: 850;
}

.eip-procedure-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.eip-procedure-progress button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #c6a35a;
  border-radius: 9px;
  color: #4b3812;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.eip-procedure-progress button.current {
  border-color: #1675dc;
  color: #fff;
  background: #1675dc;
}

.eip-procedure-progress button.reviewed:not(.current) {
  border-color: #16844a;
  color: #0b6236;
  background: #e6f8ee;
}

.eip-procedure-progress button.skipped:not(.current) {
  border-color: #d97706;
  color: #7c3f04;
  background: #fff2d6;
}

.eip-procedure-progress button.incomplete:not(.current):not(.skipped) {
  border-color: #dc2626;
  color: #991b1b;
  background: #fff1f2;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, .12);
}

.eip-procedure-missing-list {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dc2626;
  border-radius: 12px;
  color: #7f1d1d;
  background: #fff1f2;
}

.eip-procedure-missing-list[hidden] {
  display: none;
}

.eip-procedure-missing-list > strong {
  font-size: .74rem;
}

.eip-procedure-missing-list > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 7px;
}

.eip-procedure-missing-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #7f1d1d;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.eip-procedure-missing-list button b {
  grid-row: 1 / 3;
  align-self: center;
  color: #b91c1c;
  font-size: .64rem;
}

.eip-procedure-missing-list button span {
  overflow-wrap: anywhere;
  font-size: .66rem;
  font-weight: 900;
}

.eip-procedure-missing-list button small {
  color: #9f1239;
  font-size: .6rem;
}

.eip-procedure-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  gap: 14px;
  min-width: 0;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid #caa04d;
  border-radius: 14px;
  color: #172033;
  background: #fff;
  scroll-margin-top: 112px;
}

.eip-procedure-page-head,
.eip-procedure-page-skip {
  grid-column: 1 / -1;
}

.eip-procedure-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1d73c9;
}

.eip-procedure-page-head h5,
.eip-procedure-page-head p {
  margin: 0;
}

.eip-procedure-page-skip {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #253247;
  background: #f7f9fc;
}

.eip-procedure-page-skip.active {
  border-color: #d97706;
  background: #fff5dc;
}

.eip-procedure-page-skip > label:first-child {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.eip-procedure-page-skip input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: #d97706;
}

.eip-procedure-page-skip span {
  display: grid;
  gap: 3px;
}

.eip-procedure-page-skip strong {
  color: #172033;
  font-size: .75rem;
}

.eip-procedure-page-skip small,
.eip-procedure-page-skip-reason {
  color: #596579;
  font-size: .66rem;
  line-height: 1.45;
}

.eip-procedure-page-skip-reason {
  display: grid;
  gap: 6px;
  color: #7c3f04;
  font-weight: 900;
}

.eip-procedure-page-skip-reason textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

.eip-procedure-actions.page-skipped {
  opacity: .56;
}

.eip-procedure-page-head h5 {
  font-size: .95rem;
}

.eip-procedure-page-head p {
  margin-top: 4px;
  color: #596579;
  font-size: .66rem;
}

.eip-procedure-lines {
  display: grid;
  grid-column: 1;
  align-content: start;
  gap: 4px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #d9e0e9;
  border-radius: 12px;
  background: #f7f9fc;
}

.eip-procedure-line {
  margin: 0;
  color: #273246;
  font-size: .72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.eip-procedure-line.heading {
  margin-top: 7px;
  color: #101827;
  font-size: .78rem;
  font-weight: 950;
}

.eip-procedure-line.warning {
  margin: 7px 0;
  padding: 8px 10px;
  border-left: 4px solid #dc2626;
  color: #8a1118;
  background: #fff0f1;
  font-weight: 900;
}

.eip-procedure-actions {
  display: grid;
  grid-column: 2;
  align-content: start;
  gap: 9px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-right: 3px;
}

.eip-procedure-actions > h6 {
  margin: 0;
  color: #135da8;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.eip-procedure-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(138px, 170px);
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
}

.eip-procedure-action > div:first-child {
  grid-column: 1 / -1;
}

.eip-procedure-date-time > span:last-child {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) minmax(112px, .72fr);
  gap: 7px;
}

.eip-procedure-date-time input[type="date"] {
  color: #111827;
  font-weight: 850;
  background: #fff;
}

.eip-procedure-action.done {
  border-left-color: #15803d;
  background: #effaf3;
}

.eip-procedure-action.na {
  border-left-color: #c27b0a;
  background: #fff9e8;
}

.eip-procedure-action.incomplete {
  border-color: #ef4444;
  border-left-color: #dc2626;
  background: #fff7f7;
}

.eip-procedure-action .eip-procedure-action-error {
  grid-column: 1 / -1;
  padding: 7px 9px;
  border-radius: 8px;
  color: #991b1b;
  background: #fee2e2;
  font-size: .62rem;
  font-weight: 900;
}

.eip-procedure-action > div:first-child {
  display: grid;
  gap: 5px;
  align-self: center;
}

.eip-procedure-action strong {
  color: #111827;
  font-size: .73rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.eip-procedure-action small {
  color: #657186;
  font-size: .58rem;
}

.eip-procedure-action label {
  display: grid;
  gap: 4px;
  color: #4c596d;
  font-size: .58rem;
  font-weight: 850;
}

.eip-procedure-action select,
.eip-procedure-action input,
.eip-procedure-action textarea {
  width: 100%;
  min-height: 42px;
}

.eip-procedure-action .eip-procedure-reason,
.eip-procedure-action .eip-procedure-value {
  grid-column: 1 / -1;
}

.eip-procedure-empty-actions {
  margin: 0;
  padding: 11px;
  border: 1px dashed #b8c2d1;
  border-radius: 10px;
  color: #596579;
  font-size: .68rem;
  text-align: center;
}

body.theme-dark .eip-procedure-toolbar {
  border-color: #9b6b17;
  background: #302714;
}

body.theme-dark .eip-procedure-toolbar strong,
body.theme-dark .eip-procedure-page-head h5,
body.theme-dark .eip-procedure-action strong {
  color: #f8fafc;
}

body.theme-dark .eip-procedure-toolbar span {
  color: #f0d795;
}

body.theme-dark .eip-procedure-progress button {
  border-color: #6d7788;
  color: #dbe5f3;
  background: #172234;
}

body.theme-dark .eip-procedure-progress button.reviewed:not(.current) {
  border-color: #37b66f;
  color: #bdf5d2;
  background: #123624;
}

body.theme-dark .eip-procedure-progress button.skipped:not(.current) {
  border-color: #f0a72e;
  color: #ffe4a3;
  background: #432f11;
}

body.theme-dark .eip-procedure-progress button.incomplete:not(.current):not(.skipped) {
  border-color: #fb7185;
  color: #fecdd3;
  background: #4a1721;
}

body.theme-dark .eip-procedure-missing-list {
  border-color: #fb7185;
  color: #ffe4e6;
  background: #3b1720;
}

body.theme-dark .eip-procedure-missing-list button {
  border-color: #7f2f3e;
  color: #ffe4e6;
  background: #1f2937;
}

body.theme-dark .eip-procedure-missing-list button b,
body.theme-dark .eip-procedure-missing-list button small {
  color: #fda4af;
}

body.theme-dark .eip-procedure-page {
  border-color: #92702c;
  color: #e5edf7;
  background: #101a2a;
}

body.theme-dark .eip-procedure-page-head p,
body.theme-dark .eip-procedure-action small,
body.theme-dark .eip-procedure-action label {
  color: #aebbd0;
}

body.theme-dark .eip-procedure-page-skip {
  border-color: #3d4d64;
  color: #dce6f4;
  background: #172438;
}

body.theme-dark .eip-procedure-page-skip.active {
  border-color: #e6a637;
  background: #352811;
}

body.theme-dark .eip-procedure-page-skip strong {
  color: #f8fafc;
}

body.theme-dark .eip-procedure-page-skip small,
body.theme-dark .eip-procedure-page-skip-reason {
  color: #efd79e;
}

body.theme-dark .eip-procedure-page-skip-reason textarea {
  border-color: #8d6a2e;
  color: #fff8e7;
  background: #151f2f;
}

body.theme-dark .eip-procedure-lines {
  border-color: #33445c;
  background: #152236;
}

body.theme-dark .eip-procedure-line {
  color: #dce6f4;
}

body.theme-dark .eip-procedure-line.heading {
  color: #fff;
}

body.theme-dark .eip-procedure-line.warning {
  color: #fecaca;
  background: #3a171c;
}

body.theme-dark .eip-procedure-action {
  border-color: #3d4d64;
  background: #172438;
}

body.theme-dark .eip-procedure-action.done {
  border-color: #2ba765;
  border-left-color: #38d27f;
  background: #0f422d;
}

body.theme-dark .eip-procedure-action.na {
  background: #332813;
}

body.theme-dark .eip-procedure-action.incomplete {
  border-color: #be4657;
  border-left-color: #fb7185;
  background: #361923;
}

body.theme-dark .eip-procedure-action .eip-procedure-action-error {
  color: #fecdd3;
  background: #4a1721;
}

body.theme-dark .eip-procedure-action.done strong,
body.theme-dark .eip-procedure-action.done label,
body.theme-dark .eip-procedure-action.done small {
  color: #f4fff8;
}

body.theme-dark .eip-procedure-date-time input[type="date"] {
  border-color: #4f7196;
  color: #ffffff;
  background: #10243a;
  color-scheme: dark;
}

html body .eip-confirm-document-button,
html body #eipCompleteButton,
html body #eipCompletedGoToWorkOrderButton,
html body.theme-dark .eip-confirm-document-button,
html body.theme-dark #eipCompleteButton,
html body.theme-dark #eipCompletedGoToWorkOrderButton,
html body.theme-light .eip-confirm-document-button,
html body.theme-light #eipCompleteButton,
html body.theme-light #eipCompletedGoToWorkOrderButton {
  border: 1px solid #34cf7a !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #159857, #08713e) !important;
  box-shadow: 0 10px 24px rgba(12, 127, 70, .24) !important;
}

html body #eipCompleteButton:disabled {
  opacity: .82;
}

.eip-source-gate {
  display: grid;
  gap: 13px;
  padding: clamp(13px, 2vw, 18px);
  border: 2px solid #d97706;
  border-left-width: 7px;
  border-radius: 16px;
  color: #172033;
  background: #fff8e8;
  box-shadow: 0 12px 30px rgba(146, 86, 9, .12);
}

.eip-source-gate > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eip-source-gate h4,
.eip-source-gate p {
  margin: 0;
}

.eip-source-gate h4 {
  margin-top: 3px;
  color: #111827;
  font-size: clamp(.9rem, 1.8vw, 1.08rem);
}

.eip-source-gate #eipSourceGateMeta {
  margin-top: 6px;
  color: #5b6473;
  font-size: .7rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.eip-source-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.eip-source-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  text-decoration: none;
}

.eip-execution-source {
  overflow: hidden;
  border: 1px solid #d4a044;
  border-radius: 13px;
  background: #fff;
}

.eip-execution-source > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #172033;
  background: #ffefc2;
  cursor: pointer;
  list-style: none;
}

.eip-execution-source > summary::-webkit-details-marker {
  display: none;
}

.eip-execution-source > summary strong {
  font-size: .76rem;
}

.eip-execution-source > summary span {
  color: #684c12;
  font-size: .62rem;
  font-weight: 800;
  text-align: right;
}

#eipExecutionDocumentPreview {
  display: block;
  width: 100%;
  height: clamp(620px, 76vh, 980px);
  border: 0;
  background: #fff;
}

.eip-source-review-confirm {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #b45309;
  border-radius: 13px;
  color: #4a2c06;
  background: #ffedb5;
  cursor: pointer;
}

.eip-source-review-confirm input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: #15803d;
}

.eip-source-review-confirm span {
  display: grid;
  gap: 4px;
}

.eip-source-review-confirm strong {
  color: #352004;
  font-size: .74rem;
}

.eip-source-review-confirm small {
  color: #6b4b16;
  font-size: .64rem;
  line-height: 1.45;
}

body.theme-dark .eip-source-gate {
  border-color: #f59e0b;
  color: #f8fafc;
  background: #2c2415;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

body.theme-dark .eip-source-gate h4 {
  color: #fff7df;
}

body.theme-dark .eip-source-gate #eipSourceGateMeta {
  color: #e4d3aa;
}

body.theme-dark .eip-execution-source {
  border-color: #a76d13;
  background: #111827;
}

body.theme-dark .eip-execution-source > summary {
  color: #fff7df;
  background: #473515;
}

body.theme-dark .eip-execution-source > summary span {
  color: #f2d38a;
}

body.theme-dark .eip-source-review-confirm {
  border-color: #d99a2b;
  color: #fff7df;
  background: #3a2d14;
}

body.theme-dark .eip-source-review-confirm strong {
  color: #fff7df;
}

body.theme-dark .eip-source-review-confirm small {
  color: #efd79e;
}

/* V9.86 - zamykanie musi pozostac zielone takze w stanie oczekiwania i w trybie mobilnym. */
html body button.toa-apo-close-button.primary-button:disabled,
html body.theme-dark button.toa-apo-close-button.primary-button:disabled,
html body.theme-light button.toa-apo-close-button.primary-button:disabled {
  border-color: #42d883 !important;
  color: #ffffff !important;
  background-color: #16884d !important;
  background-image: linear-gradient(135deg, #16884d, #0d6638) !important;
  box-shadow: 0 12px 28px rgba(22, 136, 77, .24) !important;
  opacity: .82 !important;
}

@media (max-width: 920px) {
  .eip-procedure-toolbar {
    top: calc(var(--topbar-height, 72px) + 3px);
    grid-template-columns: 1fr 1fr;
  }

  .eip-procedure-toolbar > div {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .eip-procedure-toolbar #eipProcedurePrevButton,
  .eip-procedure-toolbar #eipProcedureNextButton {
    grid-row: 2;
  }

  .eip-procedure-action {
    grid-template-columns: 1fr;
  }

  .eip-procedure-action .eip-procedure-reason,
  .eip-procedure-action .eip-procedure-value {
    grid-column: 1;
  }

  .eip-source-gate > header,
  .eip-execution-source > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .eip-source-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .eip-execution-source > summary span {
    text-align: left;
  }

  #eipExecutionDocumentPreview {
    height: 68vh;
    min-height: 520px;
  }
}

.eip-execution-card {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid color-mix(in srgb, #2386ff 35%, var(--opsui-border, var(--line)));
  border-left: 5px solid #2386ff;
  border-radius: 18px;
  background: var(--opsui-surface-raised, var(--surface));
  box-shadow: 0 16px 38px rgba(15, 49, 88, .1);
}

.eip-execution-card[hidden] {
  display: none;
}

.eip-execution-heading,
.eip-form-section-heading,
.eip-form-section-heading > div {
  display: flex;
  align-items: center;
}

.eip-execution-heading,
.eip-form-section-heading {
  justify-content: space-between;
  gap: 14px;
}

.eip-execution-heading h3,
.eip-execution-heading p,
.eip-form-section-heading h4 {
  margin: 0;
}

.eip-execution-heading p {
  margin-top: 5px;
  color: var(--opsui-muted, var(--muted));
  font-size: .72rem;
}

.eip-execution-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #e4ad24;
  border-radius: 999px;
  color: #805600;
  background: #fff5cf;
  font-size: .65rem;
  font-weight: 950;
}

.eip-execution-badge.complete {
  border-color: #28a868;
  color: #0e6b3b;
  background: #e6f8ef;
}

.eip-workflow-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(35, 134, 255, .35);
  border-radius: 13px;
  background: rgba(35, 134, 255, .08);
}

.eip-workflow-switch > div {
  display: grid;
  gap: 4px;
}

.eip-workflow-switch strong {
  font-size: .72rem;
}

.eip-workflow-switch small {
  color: var(--opsui-muted, var(--muted));
  font-size: .61rem;
}

.eip-auto-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.eip-auto-fields > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 12px;
  background: var(--opsui-surface-muted, var(--surface-soft));
}

.eip-auto-fields > div:last-child {
  grid-column: span 2;
}

.eip-auto-fields span {
  color: var(--opsui-muted, var(--muted));
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.eip-auto-fields strong {
  overflow-wrap: anywhere;
  color: var(--opsui-text, var(--ink));
  font-size: .75rem;
}

.eip-form-section {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 15px;
  background: color-mix(in srgb, var(--opsui-surface-muted, var(--surface-soft)) 70%, transparent);
}

.eip-form-section-heading > div {
  gap: 10px;
}

.eip-form-section-heading > div > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: #2386ff;
  font-size: .68rem;
  font-weight: 950;
}

.eip-form-section-heading small {
  color: var(--opsui-muted, var(--muted));
  font-size: .62rem;
}

.eip-execution-steps {
  display: grid;
  gap: 8px;
}

.eip-execution-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 118px;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 12px;
  background: var(--opsui-surface-raised, var(--surface));
}

.eip-execution-step.done {
  border-color: rgba(32, 166, 98, .48);
  background: rgba(32, 166, 98, .07);
}

.eip-step-number,
.eip-lock-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #1769c9;
  background: #e9f3ff;
  font-size: .67rem;
  font-weight: 950;
}

.eip-step-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.eip-step-check input,
.eip-lock-not-required input,
.eip-final-consent input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
}

.eip-step-check span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.eip-step-check strong {
  font-size: .72rem;
  line-height: 1.35;
}

.eip-step-check small,
.eip-step-time {
  color: var(--opsui-muted, var(--muted));
  font-size: .6rem;
}

.eip-step-time {
  display: grid;
  gap: 4px;
  font-weight: 850;
}

.eip-step-time input {
  width: 100%;
  min-height: 40px;
}

.eip-lock-not-required,
.eip-final-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 12px;
  background: var(--opsui-surface-raised, var(--surface));
  font-size: .72rem;
  font-weight: 850;
}

.eip-lock-rows {
  display: grid;
  gap: 9px;
}

.eip-lock-row {
  display: grid;
  grid-template-columns: 38px minmax(100px, .75fr) minmax(160px, 1.35fr) minmax(140px, 1fr) 105px 105px 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--opsui-border, var(--line));
  border-radius: 12px;
  background: var(--opsui-surface-raised, var(--surface));
}

.eip-lock-row label,
#eipLockReasonRow {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--opsui-muted, var(--muted));
  font-size: .58rem;
  font-weight: 850;
}

.eip-lock-row input,
.eip-lock-row select,
#eipLockNotRequiredReason,
#eipExecutionNotes {
  width: 100%;
}

.eip-lock-row input,
.eip-lock-row select {
  min-height: 40px;
}

.eip-remove-lock {
  width: 38px;
  height: 40px;
  color: #b4212a;
  border-color: rgba(200, 62, 69, .35);
  background: rgba(200, 62, 69, .08);
}

.eip-final-consent {
  border-color: rgba(32, 166, 98, .4);
  background: rgba(32, 166, 98, .08);
}

.eip-execution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.eip-execution-actions .active-save-state {
  margin-left: auto;
}

.eip-document-card .eyebrow,
.eip-preview-card .eyebrow {
  margin: 0;
}

#eipDocumentPreview {
  display: block;
  width: 100%;
  height: min(78vh, 880px);
  min-height: 620px;
  border: 0;
  background: #e9edf2;
}

.eip-safety-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(231, 165, 45, .45);
  border-radius: 12px;
  color: var(--opsui-text, var(--text));
  background: rgba(231, 165, 45, .1);
  font-size: .67rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .eip-workspace {
    grid-template-columns: 1fr;
  }

  .eip-document-card {
    min-height: 330px;
  }

  .eip-auto-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eip-lock-row {
    grid-template-columns: 38px repeat(2, minmax(0, 1fr));
  }

  .eip-lock-row .eip-lock-index {
    grid-row: 1 / span 2;
  }

  .eip-lock-row .eip-remove-lock {
    grid-column: 3;
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .eip-heading,
  .eip-preview-card > summary,
  .eip-execution-heading,
  .eip-form-section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .eip-test-badge {
    align-self: flex-start;
  }

  .eip-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .eip-steps i {
    display: none;
  }

  .eip-steps span {
    display: grid;
    justify-items: center;
    gap: 5px;
    text-align: center;
    font-size: .56rem;
  }

  .eip-manufacturer-options {
    grid-template-columns: 1fr;
  }

  .eip-manufacturer-button {
    min-height: 68px;
  }

  .eip-document-card {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
    padding: 14px;
  }

  .eip-document-copy dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .eip-document-actions {
    grid-template-columns: 1fr;
  }

  .eip-auto-fields {
    grid-template-columns: 1fr;
  }

  .eip-auto-fields > div:last-child {
    grid-column: auto;
  }

  .eip-execution-card {
    padding: 12px;
    border-left-width: 3px;
    border-radius: 14px;
  }

  .eip-workflow-switch {
    align-items: stretch;
    flex-direction: column;
  }

  .eip-workflow-switch button {
    width: 100%;
  }

  .eip-execution-step {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
  }

  .eip-step-time {
    grid-column: 2;
  }

  .eip-lock-row {
    grid-template-columns: 1fr;
  }

  .eip-lock-row .eip-lock-index,
  .eip-lock-row .eip-remove-lock {
    grid-row: auto;
    grid-column: auto;
  }

  .eip-lock-row .eip-remove-lock {
    justify-self: end;
  }

  .eip-execution-actions > button {
    width: 100%;
  }

  .eip-procedure-date-time > span:last-child {
    grid-template-columns: 1fr;
  }

  .eip-execution-actions .active-save-state {
    width: 100%;
    margin-left: 0;
  }

  #eipDocumentPreview {
    height: 68vh;
    min-height: 480px;
  }
}

/* V9.86: przycisk zamknięcia ma zachować bezpieczny zielony status w każdym motywie. */
html body #toaApoSubmit.toa-apo-close-button,
html body #toaApoSubmit.toa-apo-close-button:disabled,
html body.theme-dark #toaApoSubmit.toa-apo-close-button,
html body.theme-dark #toaApoSubmit.toa-apo-close-button:disabled,
html body.theme-light #toaApoSubmit.toa-apo-close-button,
html body.theme-light #toaApoSubmit.toa-apo-close-button:disabled {
  border-color: #42d883 !important;
  color: #ffffff !important;
  background-color: #16884d !important;
  background-image: linear-gradient(135deg, #16884d, #0d6638) !important;
  box-shadow: 0 12px 28px rgba(22, 136, 77, .28) !important;
}

html body #toaApoSubmit.toa-apo-close-button:disabled,
html body.theme-dark #toaApoSubmit.toa-apo-close-button:disabled,
html body.theme-light #toaApoSubmit.toa-apo-close-button:disabled {
  opacity: .82 !important;
}

/* V9.87: bezpieczna akcja usunięcia przypomnienia pozostaje jednoznaczna w ciemnym motywie. */
html body.theme-dark .pending-report-card > button.pending-report-dismiss,
html body.theme-dark .report-compliance-order-row > button.pending-report-dismiss {
  border-color: #a34c57 !important;
  color: #ffe4e6 !important;
  background: #451c23 none !important;
}

html body.theme-dark .pending-report-card > button.pending-report-dismiss:hover,
html body.theme-dark .pending-report-card > button.pending-report-dismiss:focus-visible,
html body.theme-dark .report-compliance-order-row > button.pending-report-dismiss:hover,
html body.theme-dark .report-compliance-order-row > button.pending-report-dismiss:focus-visible {
  border-color: #fb7185 !important;
  color: #ffffff !important;
  background: #692530 none !important;
}

@media (max-width: 920px) {
  .eip-procedure-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .eip-procedure-page-head,
  .eip-procedure-page-skip,
  .eip-procedure-lines,
  .eip-procedure-actions {
    grid-column: 1;
  }

  .eip-procedure-lines {
    max-height: 34vh;
    min-height: 180px;
  }

  .eip-procedure-actions {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}
.coordinator-company-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.coordinator-company-form label { min-width: 0; }

#workOrderCancelDialog textarea {
  width: 100%;
  resize: vertical;
}

#workOrderCancelDialog .danger-action {
  background: #b4232b;
  color: #fff;
  border-color: #d63a43;
}

body.dark-theme #workOrderCancelDialog,
[data-theme="dark"] #workOrderCancelDialog {
  background: #111d2c;
  color: #f5f8fc;
  border-color: #40556f;
}

body.dark-theme #workOrderCancelDialog textarea,
[data-theme="dark"] #workOrderCancelDialog textarea {
  background: #18283b;
  color: #fff;
  border-color: #607690;
}

@media (max-width: 900px) {
  .coordinator-company-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .coordinator-company-form { grid-template-columns: 1fr; }
}
.cancelled-work-order-card {
  border-color: #b4232b !important;
  background: #fff1f2 !important;
  color: #54151a !important;
}

body.dark-theme .cancelled-work-order-card,
[data-theme="dark"] .cancelled-work-order-card {
  background: #35171d !important;
  color: #ffe8eb !important;
  border-color: #ff6872 !important;
}

/* V9.93: aktywna zakładka Polecenie ma pełny, czytelny kolor także w ciemnym motywie. */
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) #bottomNav button.bottom-nav-item[data-app-route="workOrder"].active:not(.work-order-state-pending):not(.work-order-state-signature) {
  border: 1px solid #42e19a !important;
  color: #ffffff !important;
  background-color: #08784d !important;
  background-image: linear-gradient(145deg, #10a366, #06613e) !important;
  box-shadow: 0 10px 24px rgba(16, 163, 102, .38), inset 0 1px 0 rgba(255, 255, 255, .16) !important;
  opacity: 1 !important;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) #bottomNav button.bottom-nav-item[data-app-route="workOrder"].active:not(.work-order-state-pending):not(.work-order-state-signature) :is(span, svg) {
  color: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1 !important;
}

/* V10.02 - profesjonalny kalendarz O-T-A i bezpieczna konfiguracja MAIL */
.toa-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, #1677e8 8%);
}

.toa-view-switch,
.toa-month-navigation,
.toa-status-legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toa-view-switch {
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 80%, #0d2743 20%);
}

.toa-view-switch button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.toa-view-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, #126fd0, #218cff);
  box-shadow: 0 7px 16px rgba(18, 111, 208, .24);
}

.toa-month-navigation strong {
  min-width: 150px;
  color: var(--ink);
  text-align: center;
  text-transform: capitalize;
}

.toa-status-legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toa-status-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.toa-status-legend i.complete { background: #168b52; }
.toa-status-legend i.progress { background: #2386f5; }

.toa-workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1.35fr) minmax(390px, .75fr);
  gap: 18px;
  align-items: start;
}

.toa-calendar-column,
.toa-detail-panel,
.toa-list-view {
  min-width: 0;
}

.toa-calendar,
.toa-detail-panel,
.toa-list-view {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.toa-calendar { padding: 14px; }

.toa-weekdays,
.toa-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.toa-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.toa-calendar-day {
  display: grid;
  min-width: 0;
  min-height: 94px;
  align-content: space-between;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, #8ca3bb 6%);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.toa-calendar-day:hover,
.toa-calendar-day:focus-visible {
  border-color: #2386f5;
  transform: translateY(-1px);
}

.toa-calendar-day b { font-size: 20px; }
.toa-calendar-day span { color: var(--muted); font-size: 10px; font-weight: 800; }
.toa-calendar-day.progress { border-color: #67aaf6; background: color-mix(in srgb, var(--surface) 76%, #d7eaff 24%); }
.toa-calendar-day.progress b { color: #1167c7; }
.toa-calendar-day.complete { border-color: #55b888; background: color-mix(in srgb, var(--surface) 76%, #d9f6e7 24%); }
.toa-calendar-day.complete b { color: #087746; }
.toa-calendar-day.selected { outline: 3px solid color-mix(in srgb, #2587ff 38%, transparent); outline-offset: 2px; box-shadow: 0 10px 24px rgba(16, 91, 164, .16); }

.toa-detail-panel {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.toa-detail-content { display: grid; gap: 14px; padding: 16px; }
.toa-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.toa-detail-heading h3 { margin: 2px 0 0; color: var(--ink); font-size: 20px; text-transform: capitalize; }
.toa-detail-heading > span { padding: 7px 10px; border-radius: 999px; color: #0f64bc; background: #dceeff; font-size: 11px; font-weight: 900; }

.toa-day-order-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0; }
.toa-day-order-tabs button {
  flex: none;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.toa-day-order-tabs button.active { border-color: #2386f5; color: #0e66c6; background: color-mix(in srgb, var(--surface) 85%, #d9ecff 15%); }

.toa-order-summary {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-left: 4px solid #2386f5;
  border-radius: 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, #1677e8 4%);
  cursor: pointer;
}
.toa-order-summary.complete { border-left-color: #169357; }
.toa-order-summary.selected { box-shadow: 0 0 0 2px color-mix(in srgb, #2587ff 28%, transparent); }
.toa-order-summary header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.toa-order-summary h4 { margin: 4px 0 0; color: var(--ink); font-size: 15px; }
.toa-order-reference { color: #1674d3; font-size: 11px; font-weight: 950; overflow-wrap: anywhere; }
.toa-order-status { flex: none; padding: 6px 8px; border-radius: 999px; color: #0c64bd; background: #deedff; font-size: 9px; font-weight: 950; }
.toa-order-summary.complete .toa-order-status { color: #087747; background: #dcf5e8; }

.toa-order-facts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; }
.toa-order-facts div { display: grid; gap: 2px; }
.toa-order-facts dt { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.toa-order-facts dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }

.toa-order-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.toa-order-timeline li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px; }
.toa-order-timeline li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 38px; bottom: -12px; width: 2px; background: var(--border); }
.toa-order-timeline li.complete:not(:last-child)::after { background: #51b985; }
.toa-stage-marker { display: grid; width: 29px; height: 29px; place-items: center; z-index: 1; border: 2px solid var(--border); border-radius: 50%; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 950; }
.toa-order-timeline li.complete .toa-stage-marker { border-color: #169357; color: #fff; background: #169357; }
.toa-stage-copy { display: grid; gap: 2px; min-width: 0; }
.toa-stage-copy b { color: var(--ink); font-size: 12px; }
.toa-stage-copy small { color: var(--muted); font-size: 10px; }
.toa-stage-action { min-width: 66px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 9px; font-weight: 900; text-align: center; }
button.toa-stage-action { cursor: pointer; }
.toa-stage-action.ready { border-color: #52b987; color: #087747; background: #e0f7eb; }

.toa-detail-empty { display: grid; min-height: 230px; place-content: center; gap: 7px; padding: 25px; color: var(--muted); text-align: center; }
.toa-detail-empty span { color: var(--ink); font-size: 16px; font-weight: 900; }
.toa-detail-empty p { margin: 0; font-size: 12px; }
.toa-mobile-timeline { display: none; }
.toa-list-view { display: grid; gap: 12px; padding: 14px; }
.toa-list-view[hidden] { display: none; }
.toa-list-view .toa-order-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toa-list-view .toa-order-timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.toa-list-view .toa-order-timeline li { grid-template-columns: 28px minmax(0, 1fr); align-content: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.toa-list-view .toa-order-timeline li::after { display: none; }
.toa-list-view .toa-stage-action { grid-column: 1 / -1; }

.mail-settings-form {
  display: grid;
  gap: 18px;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, #177be8 4%);
}
.mail-form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mail-form-heading h4 { margin: 3px 0 0; font-size: 20px; }
.mail-connection-state { padding: 7px 10px; border-radius: 999px; font-size: 10px; font-weight: 950; }
.mail-connection-state.ready { color: #087747; background: #dff7eb; }
.mail-connection-state.pending { color: #9a5c05; background: #fff0c2; }
.mail-mode-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.mail-mode-picker legend { grid-column: 1 / -1; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 900; }
.mail-mode-card { display: flex; gap: 10px; align-items: flex-start; min-height: 78px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.mail-mode-card.selected { border-color: #2386f5; box-shadow: 0 0 0 2px rgba(35, 134, 245, .14); }
.mail-mode-card span { display: grid; gap: 4px; }
.mail-mode-card b { color: var(--ink); }
.mail-mode-card small { color: var(--muted); }
.mail-provider-field,
.mail-settings-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 850; }
.mail-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mail-settings-grid.is-disabled { display: none; }
.mail-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.mail-form-actions .form-hint { margin: 0; }

body.theme-dark .toa-calendar,
body.theme-dark .toa-detail-panel,
body.theme-dark .toa-list-view,
body.theme-dark .mail-settings-form,
body.dark-theme .toa-calendar,
body.dark-theme .toa-detail-panel,
body.dark-theme .toa-list-view,
body.dark-theme .mail-settings-form {
  border-color: #31465f;
  background: #131f2e;
}

body.theme-dark .toa-calendar-day.progress,
body.dark-theme .toa-calendar-day.progress { border-color: #3e83cb; background: #142f4a; }
body.theme-dark .toa-calendar-day.complete,
body.dark-theme .toa-calendar-day.complete { border-color: #2b8c5e; background: #123928; }
body.theme-dark .toa-calendar-day.progress b,
body.dark-theme .toa-calendar-day.progress b { color: #72b8ff; }
body.theme-dark .toa-calendar-day.complete b,
body.dark-theme .toa-calendar-day.complete b { color: #73dca6; }
body.theme-dark .toa-stage-action.ready,
body.dark-theme .toa-stage-action.ready { border-color: #319062; color: #8be4b7; background: #123b2a; }
body.theme-dark .toa-detail-heading > span,
body.theme-dark .toa-order-status,
body.dark-theme .toa-detail-heading > span,
body.dark-theme .toa-order-status { color: #85c4ff; background: #16334f; }
body.theme-dark .toa-order-summary.complete .toa-order-status,
body.dark-theme .toa-order-summary.complete .toa-order-status { color: #8be4b7; background: #143a2a; }
body.theme-dark .mail-mode-card,
body.dark-theme .mail-mode-card { border-color: #31465f; background: #172638; }
body.theme-dark .mail-connection-state.ready,
body.dark-theme .mail-connection-state.ready { color: #8be4b7; background: #143a2a; }
body.theme-dark .mail-connection-state.pending,
body.dark-theme .mail-connection-state.pending { color: #ffd276; background: #4a3514; }

@media (max-width: 1080px) {
  .toa-workspace { grid-template-columns: 1fr; }
  .toa-detail-panel { display: none; }
  .toa-mobile-timeline { display: block; margin-top: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
  .toa-list-view .toa-order-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mail-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .toa-filters { grid-template-columns: 1fr; }
  .toa-view-toolbar { display: grid; grid-template-columns: 1fr; }
  .toa-view-switch { width: 100%; }
  .toa-view-switch button { flex: 1; }
  .toa-month-navigation { justify-content: space-between; }
  .toa-status-legend { justify-content: center; }
  .toa-calendar { padding: 8px; }
  .toa-weekdays, .toa-calendar-grid { gap: 5px; }
  .toa-calendar-day { min-height: 68px; padding: 8px 6px; border-radius: 11px; }
  .toa-calendar-day b { font-size: 17px; }
  .toa-calendar-day span { font-size: 8px; line-height: 1.2; }
  .toa-calendar-spacer { min-height: 68px; }
  .toa-detail-content { padding: 12px; }
  .toa-order-summary { padding: 12px; }
  .toa-order-summary header { display: grid; }
  .toa-order-status { justify-self: start; }
  .toa-list-view .toa-order-facts,
  .toa-list-view .toa-order-timeline { grid-template-columns: 1fr; }
  .mail-settings-form { padding: 14px; }
  .mail-form-heading, .mail-form-actions { display: grid; }
  .mail-mode-picker, .mail-settings-grid { grid-template-columns: 1fr; }
}

/* V9.97: prywatne stawki i warunki zatrudnienia zarządzane wyłącznie przez Szefa. */
.employees-panel {
  border-top: 4px solid #1677d2;
}

.employees-terms-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.employees-picker-card,
.employees-terms-form,
.employees-terms-form fieldset {
  border: 1px solid #cad9e8;
  border-radius: 16px;
  background: #f7fbff;
}

.employees-picker-card,
.employees-terms-form {
  padding: 18px;
}

.employees-picker-card label,
.employees-terms-form label,
.employees-terms-form legend {
  color: #25364a;
  font-weight: 800;
}

.employees-picker-card select,
.employees-terms-form input,
.employees-terms-form select {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid #9fb5cc;
  border-radius: 10px;
  background: #ffffff;
  color: #102033;
}

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

.employee-terms-heading h3 {
  margin: 2px 0 0;
  color: #102033;
}

.employee-terms-heading .status-badge {
  border: 1px solid #c58b13;
  background: #fff5cf;
  color: #755000;
}

.employee-terms-heading .status-badge.is-saved {
  border-color: #208654;
  background: #dcf8e9;
  color: #0c5c36;
}

.employees-terms-form fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 16px;
}

.employees-terms-form legend {
  padding: 0 8px;
}

.employee-terms-grid {
  display: grid;
  gap: 12px;
}

.employee-rate-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.employee-contract-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, auto);
  align-items: end;
}

.employee-indefinite-option {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #9fb5cc;
  border-radius: 10px;
  background: #ffffff;
}

.employee-indefinite-option input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}

.employee-contract-grid label.is-disabled {
  opacity: .65;
}

.readonly-rates-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid #9ec3e8;
  border-radius: 10px;
  background: #edf6ff;
  color: #174d7e;
  font-weight: 750;
}

.employee-own-contract {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #c7d7e6;
  border-radius: 12px;
  background: #f7fbff;
  color: #33475b;
}

.work-hours-rates input[readonly],
.employees-terms-form input[readonly] {
  cursor: default;
  background: #eaf1f7;
  color: #26394d;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) :is(.employees-picker-card, .employees-terms-form, .employees-terms-form fieldset) {
  border-color: #40566e;
  background: #142235;
  color: #f5f8fc;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) :is(.employees-picker-card label, .employees-terms-form label, .employees-terms-form legend, .employee-terms-heading h3) {
  color: #f5f8fc;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) :is(.employees-picker-card select, .employees-terms-form input, .employees-terms-form select, .employee-indefinite-option) {
  border-color: #607895;
  background: #1c3048;
  color: #ffffff;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .employees-terms-heading .status-badge {
  border-color: #e7b541;
  background: #4b3914;
  color: #ffe8a3;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .employees-terms-heading .status-badge.is-saved {
  border-color: #40d990;
  background: #123e2d;
  color: #bdf7d9;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) :is(.readonly-rates-note, .employee-own-contract) {
  border-color: #4e7194;
  background: #182b41;
  color: #dbeeff;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) :is(.work-hours-rates input[readonly], .employees-terms-form input[readonly]) {
  border-color: #506983;
  background: #101d2c;
  color: #e9f4ff;
}

@media (max-width: 1100px) {
  .employee-rate-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 760px) {
  .employees-terms-layout,
  .employee-rate-grid,
  .employee-contract-grid { grid-template-columns: 1fr; }
  .employees-picker-card,
  .employees-terms-form { padding: 14px; }
}

/* V10.01: akceptacja zastępstw i płaska, profesjonalna hierarchia menu Bossa. */
.side-admin-shortcuts,
.app-shell.desktop-layout .side-admin-shortcuts {
  display: grid;
  gap: 8px;
  margin: 7px 0 5px;
  padding: 9px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  border-left: 0;
}

.side-admin-shortcuts .side-admin-nav-group,
.app-shell.desktop-layout .side-admin-shortcuts .side-admin-nav-group {
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 0;
}

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

.side-admin-shortcuts .side-admin-nav-group > p,
.app-shell.desktop-layout .side-admin-shortcuts .side-admin-nav-group > p {
  margin: 0;
  padding: 3px 10px 4px;
  color: #718199;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-admin-shortcuts button,
.app-shell.desktop-layout .side-admin-shortcuts button {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: #40506a;
  background: rgba(255, 255, 255, 0.46);
  font-size: 0.8rem;
  font-weight: 850;
  text-align: left;
}

.side-menu-list [data-app-route="delegation"].delegation-state-awaiting {
  color: #ffffff;
  background: linear-gradient(135deg, #d73742, #b71f2b);
  box-shadow: 0 7px 16px rgba(183, 31, 43, 0.26);
}

.side-menu-list [data-app-route="delegation"].delegation-state-accepted {
  color: #ffffff;
  background: linear-gradient(135deg, #19a65c, #08733c);
  box-shadow: 0 7px 16px rgba(8, 115, 60, 0.24);
}

html body .side-menu-list button[data-app-route="delegation"].delegation-state-awaiting,
html body .side-menu-list button[data-app-route="delegation"].delegation-state-awaiting.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #d73742, #b71f2b) !important;
  box-shadow: 0 7px 18px rgba(183, 31, 43, 0.34) !important;
}

html body .side-menu-list button[data-app-route="delegation"].delegation-state-accepted,
html body .side-menu-list button[data-app-route="delegation"].delegation-state-accepted.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #19a65c, #08733c) !important;
  box-shadow: 0 7px 18px rgba(8, 115, 60, 0.31) !important;
}

.duty-delegation-card.status-awaiting {
  border-color: #ef8890;
  border-left-color: #d73742;
  background: color-mix(in srgb, var(--surface, #ffffff) 92%, #d73742 8%);
}

.duty-delegation-card.status-awaiting > strong { color: #b71f2b; }
.duty-delegation-card.status-active,
.duty-delegation-card.status-planned {
  background: color-mix(in srgb, var(--surface, #ffffff) 94%, #139052 6%);
}
.duty-delegation-card.status-planned { border-left-color: #139052; }

.duty-delegation-acceptance {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.duty-delegation-accept-button {
  width: 100%;
  background: linear-gradient(135deg, #169957, #08713b);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .side-admin-shortcuts,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .app-shell.desktop-layout .side-admin-shortcuts {
  border-top-color: rgba(148, 163, 184, 0.18);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .side-admin-shortcuts .side-admin-nav-group > p,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .app-shell.desktop-layout .side-admin-shortcuts .side-admin-nav-group > p {
  color: #91a5bd;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .side-admin-shortcuts button,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .app-shell.desktop-layout .side-admin-shortcuts button {
  color: #d7e3f1;
  background: rgba(255, 255, 255, 0.055);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .side-admin-shortcuts button:is(:hover, :focus-visible, .active),
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .app-shell.desktop-layout .side-admin-shortcuts button:is(:hover, :focus-visible, .active) {
  color: #ffffff;
  background: rgba(20, 121, 247, 0.25);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .duty-delegation-card.status-awaiting {
  border-color: #c64d58;
  border-left-color: #ff6571;
  background: #351921;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .duty-delegation-card.status-awaiting > strong { color: #ffb7bd; }
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .duty-delegation-card.status-active,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .duty-delegation-card.status-planned {
  background: #123326;
  border-color: #2b7e56;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .duty-delegation-acceptance { color: #c7d7e8; }

/* V10.01 - profesjonalny panel operacyjny SMS */
.sms-operations-card {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid #c9d8e8;
  border-left: 6px solid #168c54;
  border-radius: 18px;
  background: #f7fbff;
  color: #142033;
  box-shadow: 0 12px 30px rgba(15, 38, 66, 0.08);
}

.sms-operations-card.is-disabled {
  border-left-color: #c93643;
  background: #fff7f7;
}

.sms-operation-status,
.sms-operation-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sms-operation-status {
  justify-content: space-between;
}

.sms-operation-status-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.sms-operation-status-copy strong,
.sms-operation-status-copy small {
  display: block;
}

.sms-operation-status-copy small {
  margin-top: 3px;
  color: #56677c;
}

.sms-operation-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #ffffff;
  background: #168c54;
  font-size: 1.05rem;
  font-weight: 900;
}

.sms-operations-card.is-disabled .sms-operation-icon {
  background: #c93643;
}

.sms-operation-actions button {
  min-height: 46px;
}

.sms-operation-actions .danger-button,
.sms-operation-actions .button-danger,
.sms-operation-actions .danger-action {
  color: #ffffff;
  border-color: #a81f2a;
  background: #b92733;
}

.sms-operation-actions .danger-action:hover:not(:disabled) {
  color: #ffffff;
  border-color: #861923;
  background: #9f202b;
}

.sms-operation-actions .danger-action:disabled {
  color: #6b2630;
  border-color: #e4a9ae;
  background: #f3c9cd;
  opacity: 1;
}

.sms-pending-preview {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #b8cde1;
  border-radius: 14px;
  background: #ffffff;
}

.sms-pending-preview.is-empty {
  background: #f2f7fb;
}

.sms-pending-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sms-pending-preview-heading h4 {
  margin: 3px 0 0;
  color: #142033;
  font-size: 1rem;
}

.sms-pending-count {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  color: #5b3600;
  background: #ffd978;
  font-weight: 900;
}

.sms-pending-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.sms-pending-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 13px;
  border: 1px solid #d7e3ee;
  border-radius: 12px;
  background: #f7fafc;
}

.sms-pending-position {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  background: #176a9a;
  font-weight: 900;
}

.sms-pending-copy {
  min-width: 0;
}

.sms-pending-copy strong,
.sms-pending-copy small {
  display: block;
}

.sms-pending-copy strong {
  color: #142033;
}

.sms-pending-copy small {
  margin-top: 3px;
  color: #526579;
  line-height: 1.4;
}

.sms-pending-copy p {
  margin: 8px 0 0;
  color: #17283a;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-operations-card {
  color: #f1f6fc;
  border-color: #2c634c;
  border-left-color: #35c47d;
  background: #112b22;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-operations-card.is-disabled {
  border-color: #783743;
  border-left-color: #ff6674;
  background: #351a21;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-operation-status-copy small {
  color: #c8d7e7;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-operation-actions .danger-action {
  color: #ffffff;
  border-color: #ff7380;
  background: #b92733;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-operation-actions .danger-action:disabled {
  color: #f2b9bf;
  border-color: #74434a;
  background: #51272e;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-preview,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-preview.is-empty {
  border-color: #41627d;
  background: #172b3a;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-preview-heading h4,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-copy strong,
html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-copy p {
  color: #f2f7fc;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-item {
  border-color: #39566f;
  background: #102331;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-copy small {
  color: #b9cad9;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-position {
  background: #2387bd;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .sms-pending-count {
  color: #2b1900;
  background: #ffd978;
}

@media (max-width: 640px) {
  .sms-operation-status,
  .sms-operation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sms-operation-actions button {
    width: 100%;
  }

  .sms-pending-preview {
    padding: 13px;
  }

  .sms-pending-item {
    gap: 9px;
    padding: 11px;
  }

  .sms-pending-position {
    width: 28px;
    height: 28px;
  }
}

/* V10.03 finalne nadpisania brandingu — musza pozostac na koncu arkusza. */
html body .login-dialog {
  width: min(calc(100vw - 32px), 520px);
  padding: 30px 38px 28px;
  border: 1px solid rgba(26, 167, 156, 0.3);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(9, 56, 72, 0.24);
}

html body .login-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 7%, rgba(42, 190, 180, 0.24), transparent 30rem),
    linear-gradient(145deg, rgba(237, 249, 250, 0.96), rgba(216, 240, 243, 0.97));
}

html body .login-logo {
  width: 100%;
  min-height: 214px;
  margin: -12px auto 2px;
  display: grid;
  place-items: center;
}

html body .login-logo img {
  width: min(100%, 380px);
  max-width: 380px;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(7, 70, 88, 0.15));
}

html body .login-product-name {
  max-width: 410px;
  margin: 0 auto 24px;
  color: var(--tnvora-navy);
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-align: center;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-dialog {
  color: #edf9fb;
  border-color: rgba(75, 209, 197, 0.34);
  background: #0c2532;
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 7%, rgba(28, 173, 163, 0.24), transparent 30rem),
    linear-gradient(145deg, rgba(4, 20, 29, 0.96), rgba(6, 43, 52, 0.98));
}

html body:is(.theme-dark, .dark-theme, [data-theme="dark"]) .login-product-name {
  color: #efffff;
}

@media (max-width: 640px) {
  html body .login-dialog {
    width: min(calc(100vw - 20px), 480px);
    max-height: calc(100dvh - 20px);
    padding: 22px 22px 20px;
  }

  html body .login-logo {
    min-height: 158px;
    margin-top: -8px;
  }

  html body .login-logo img {
    width: min(100%, 290px);
    max-height: 158px;
  }
}

/* =============================================================
   V10.04 — FINALNE STYLE LOGOWANIA I COOKIES
   Ten blok celowo pozostaje na końcu pliku, aby starsze reguły
   responsywne nie przywracały ramki logo ani dużego modalu cookies.
   ============================================================= */
html body .login-logo {
  width: 100%;
  min-height: 112px;
  margin: -4px auto 12px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

html body .login-logo img {
  display: block;
  width: min(100%, 440px);
  max-width: 440px;
  height: auto;
  max-height: none;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 20px rgba(4, 37, 64, 0.08));
}

html body .login-logo img.login-logo-dark-theme {
  display: none;
}

html body:is(.dark-mode, .theme-dark, [data-theme="dark"]) .login-logo img.login-logo-light-theme {
  display: none;
}

html body:is(.dark-mode, .theme-dark, [data-theme="dark"]) .login-logo img.login-logo-dark-theme {
  display: block;
}

html body #loginForm > .primary-button[type="submit"] {
  color: #fff;
  background: linear-gradient(112deg, #1479f7 0%, #0ea7b5 54%, #63ad3d 100%);
  border: 1px solid rgba(7, 107, 133, 0.34);
  box-shadow: 0 12px 28px rgba(14, 167, 181, 0.22);
}

html body #loginForm > .primary-button[type="submit"]:hover,
html body #loginForm > .primary-button[type="submit"]:focus-visible {
  color: #fff;
  background: linear-gradient(112deg, #0f6fe8 0%, #079aa9 54%, #559d32 100%);
  border-color: #087f9a;
  box-shadow: 0 14px 32px rgba(14, 167, 181, 0.3);
}

html body .cookie-consent-backdrop {
  background: rgba(7, 29, 44, 0.12);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html body .cookie-consent-dialog {
  position: fixed;
  inset: auto 18px 18px auto;
  width: min(430px, calc(100vw - 36px));
  max-width: 430px;
  max-height: min(82dvh, 640px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(36, 111, 133, 0.22);
  box-shadow: 0 20px 54px rgba(4, 27, 43, 0.22);
}

html body .cookie-consent-form {
  padding: 15px;
}

html body .cookie-consent-brand {
  min-height: 34px;
  margin-bottom: 7px;
}

html body .cookie-consent-brand img {
  width: 112px;
  max-height: 30px;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html body .cookie-consent-brand span {
  display: none;
}

html body .cookie-consent-dialog h2 {
  margin: 0 0 7px;
  font-size: 1.18rem;
  line-height: 1.16;
}

html body .cookie-consent-dialog p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

html body .cookie-consent-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

html body .cookie-consent-actions button {
  min-height: 38px;
  padding: 7px 8px;
  font-size: 0.7rem;
  line-height: 1.15;
  border-radius: 10px;
}

html body .cookie-consent-preferences {
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
}

html body .cookie-preference-row {
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 10px;
}

html body .cookie-preference-row strong,
html body .cookie-preference-row small {
  font-size: 0.7rem;
}

html body .cookie-consent-footer {
  gap: 12px;
  margin-top: 10px;
  padding-top: 9px;
  font-size: 0.7rem;
}

html body:is(.dark-mode, .theme-dark, [data-theme="dark"]) .cookie-consent-brand img {
  content: url("tnvora-logo-light.svg?v=20260808-v1005-brand");
}

@media (max-width: 640px) {
  html body .login-logo {
    min-height: 96px;
    margin: -2px auto 10px;
  }

  html body .login-logo img {
    width: min(100%, 360px);
    max-width: 360px;
    max-height: none;
  }

  html body .cookie-consent-dialog {
    inset: auto 8px 8px 8px;
    width: auto;
    max-width: none;
    max-height: 76dvh;
    border-radius: 16px;
  }

  html body .cookie-consent-form {
    padding: 13px;
  }

  html body .cookie-consent-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  html body .cookie-consent-actions button {
    min-height: 40px;
    padding: 7px 5px;
    font-size: 0.64rem;
  }
}

/* =============================================================
   V10.05 — POWRÓT LOGOWANIA V10.03, MINI-LISTA O-T-A I COOKIES
   ============================================================= */
html body .login-logo {
  width: 100%;
  min-height: 214px;
  margin: -12px auto 2px;
  display: grid;
  place-items: center;
}

html body .login-logo img {
  display: block;
  width: min(100%, 380px);
  max-width: 380px;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(7, 70, 88, 0.15));
}

html body .login-product-name {
  display: block;
  max-width: 410px;
  margin: 0 auto 24px;
  color: var(--tnvora-navy);
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.13em;
  text-align: center;
}

html body #loginForm > .primary-button[type="submit"] {
  color: #ffffff !important;
  border-color: #1479f7 !important;
  background: #1479f7 !important;
  box-shadow: 0 9px 20px rgba(20, 121, 247, 0.24) !important;
}

html body #loginForm > .primary-button[type="submit"]:hover,
html body #loginForm > .primary-button[type="submit"]:focus-visible {
  color: #ffffff !important;
  border-color: #0969db !important;
  background: #0969db !important;
  box-shadow: 0 11px 24px rgba(20, 121, 247, 0.3) !important;
}

html body:is(.dark-mode, .theme-dark, [data-theme="dark"]) .login-product-name {
  color: #efffff;
}

html body .cookie-consent-dialog {
  z-index: 2147483000;
}

.toa-day-order-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 2px 0;
}

.toa-day-order-tabs .toa-day-order-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-left: 4px solid #2386f5;
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.toa-day-order-option.complete { border-left-color: #169357; }
.toa-day-order-option.closed-incomplete { border-left-color: #d79213; }
.toa-day-order-option.active {
  border-color: #2386f5;
  box-shadow: 0 0 0 2px color-mix(in srgb, #2587ff 28%, transparent);
}
.toa-day-order-option-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #0f64bc;
  background: #deedff;
  font-size: 10px;
  font-weight: 950;
}
.toa-day-order-option-copy { display: grid; gap: 3px; min-width: 0; }
.toa-day-order-option-copy b { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.toa-day-order-option-copy small { overflow-wrap: anywhere; color: var(--muted); font-size: 9px; font-weight: 800; }
.toa-day-order-option-status {
  padding: 5px 7px;
  border-radius: 999px;
  color: #0c64bd;
  background: #deedff;
  font-size: 8px;
  font-weight: 950;
  white-space: nowrap;
}
.toa-day-order-option.complete .toa-day-order-option-status { color: #087747; background: #dcf5e8; }
.toa-day-order-option.closed-incomplete .toa-day-order-option-status { color: #8b5700; background: #fff0c2; }

.toa-order-summary.closed-incomplete { border-left-color: #d79213; }
.toa-order-summary.closed-incomplete .toa-order-status { color: #8b5700; background: #fff0c2; }

body.theme-dark .toa-day-order-option,
body.dark-theme .toa-day-order-option { border-color: #31465f; background: #172638; }
body.theme-dark .toa-day-order-option.active,
body.dark-theme .toa-day-order-option.active { border-color: #4098f8; }
body.theme-dark .toa-day-order-option-index,
body.dark-theme .toa-day-order-option-index { color: #8cc8ff; background: #16334f; }
body.theme-dark .toa-day-order-option-status,
body.dark-theme .toa-day-order-option-status { color: #85c4ff; background: #16334f; }
body.theme-dark .toa-day-order-option.complete .toa-day-order-option-status,
body.dark-theme .toa-day-order-option.complete .toa-day-order-option-status { color: #8be4b7; background: #143a2a; }
body.theme-dark .toa-day-order-option.closed-incomplete .toa-day-order-option-status,
body.dark-theme .toa-day-order-option.closed-incomplete .toa-day-order-option-status,
body.theme-dark .toa-order-summary.closed-incomplete .toa-order-status,
body.dark-theme .toa-order-summary.closed-incomplete .toa-order-status { color: #ffd276; background: #4a3514; }

/* V10.07: czytelna karta godzin pracy */
.employee-work-hours-days {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.employee-hours-day {
  overflow: hidden;
  border: 1px solid #c8d9e8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(13, 47, 71, .06);
}
.employee-hours-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  color: #0b3145;
  background: #e8f7f8;
  border-bottom: 1px solid #c8e6e9;
}
.employee-hours-day-header div { display: grid; gap: 2px; }
.employee-hours-day-header strong { font-size: 15px; }
.employee-hours-day-header span { color: #577384; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.employee-hours-day-header > b { color: #006d73; font-size: 18px; white-space: nowrap; }
.employee-hours-day-entries { display: grid; }
.employee-hours-entry {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2ebf1;
}
.employee-hours-entry:last-child { border-bottom: 0; }
.employee-hours-entry div { display: grid; gap: 3px; }
.employee-hours-entry span { color: #6c7e8a; font-size: 10px; font-weight: 900; letter-spacing: .07em; }
.employee-hours-entry strong { color: #122c3b; font-size: 14px; }
body.theme-dark .employee-hours-day,
body.dark-theme .employee-hours-day {
  border-color: #30485f;
  background: #142235;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
body.theme-dark .employee-hours-day-header,
body.dark-theme .employee-hours-day-header {
  color: #eefcff;
  background: #173746;
  border-color: #285567;
}
body.theme-dark .employee-hours-day-header span,
body.dark-theme .employee-hours-day-header span { color: #9fc3ce; }
body.theme-dark .employee-hours-day-header > b,
body.dark-theme .employee-hours-day-header > b { color: #57d9d2; }
body.theme-dark .employee-hours-entry,
body.dark-theme .employee-hours-entry { border-color: #263c50; }
body.theme-dark .employee-hours-entry span,
body.dark-theme .employee-hours-entry span { color: #91a9bc; }
body.theme-dark .employee-hours-entry strong,
body.dark-theme .employee-hours-entry strong { color: #f2f8fc; }

/* V10.07: prywatny podgląd diagnostyczny administratora */
.observer-eye-menu-icon,
.observer-eye-title { color: #13aeb1; font-size: 1.15em; }
.admin-user-observer { border-top: 4px solid #13aeb1; }
.observer-private-badge,
.observer-live-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .05em;
}
.observer-private-badge { color: #075d68; background: #dcf7f6; border: 1px solid #9bdedc; }
.observer-analytics {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid #b9dfe1;
  border-radius: 18px;
  background: linear-gradient(145deg, #f4fbfc 0%, #eaf7f8 100%);
  color: #163746;
}
.observer-analytics-heading,
.observer-analytics-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.observer-analytics-heading > div,
.observer-analytics-section-title { display: grid; gap: 4px; }
.observer-analytics-heading span,
.observer-analytics-section-title span { color: #087f87; font-size: 10px; font-weight: 950; letter-spacing: .1em; }
.observer-analytics-heading strong { font-size: 20px; }
.observer-analytics-heading small { color: #607b88; font-weight: 750; }
.observer-analytics-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.observer-analytics-kpis article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #cce4e8;
  border-radius: 14px;
  background: #fff;
}
.observer-analytics-kpis span { color: #607783; font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.observer-analytics-kpis strong { color: #0d6f77; font-size: 20px; overflow-wrap: anywhere; }
.observer-analytics-kpis small { color: #748995; font-size: 10px; }
.observer-analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.observer-analytics-grid > article { padding: 14px; border: 1px solid #cce4e8; border-radius: 14px; background: rgba(255,255,255,.82); }
.observer-analytics-section-title { margin-bottom: 12px; }
.observer-analytics-section-title strong { color: #173b49; }
.observer-analytics-bars { display: grid; gap: 10px; }
.observer-analytics-bar { display: grid; gap: 5px; }
.observer-analytics-bar > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #486572; font-size: 11px; font-weight: 800; }
.observer-analytics-bar i { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #d9e9ec; }
.observer-analytics-bar em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b8f97, #35c4bd); }
.observer-analytics-table-wrap { overflow-x: auto; border: 1px solid #c5dfe4; border-radius: 14px; background: #fff; }
.observer-analytics-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.observer-analytics-table th,
.observer-analytics-table td { padding: 11px 12px; border-bottom: 1px solid #dbe9ec; text-align: left; vertical-align: middle; }
.observer-analytics-table th { color: #5b727e; background: #eef7f8; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.observer-analytics-table td { color: #294956; font-size: 11px; }
.observer-analytics-table tbody tr:last-child td { border-bottom: 0; }
.observer-analytics-table td:first-child { display: grid; gap: 3px; }
.observer-analytics-table td:first-child small { color: #718792; font-size: 9px; }
.observer-role-pill { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #08727a; background: #def4f3; font-size: 9px; font-weight: 900; }
.observer-analytics-empty { padding: 14px; color: #6d818c; text-align: center; font-weight: 750; }
.observer-user-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 18px 0;
}
.observer-user-picker label { display: grid; gap: 7px; color: #314b5c; font-weight: 850; }
.observer-live-state.idle { color: #637787; background: #edf2f6; }
.observer-live-state.online { color: #056b40; background: #dff7e9; border: 1px solid #8ed8ae; }
.observer-live-state.offline { color: #865807; background: #fff2cc; border: 1px solid #e6bf62; }
.observer-now-card {
  padding: 18px;
  border: 1px solid #bcdfe0;
  border-radius: 16px;
  background: linear-gradient(135deg, #f1fbfb, #fff);
}
.observer-now-heading,
.observer-timeline-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.observer-now-heading > div,
.observer-timeline-heading > div { display: grid; gap: 4px; }
.observer-now-heading span,
.observer-timeline-heading span { color: #0c7f85; font-size: 10px; font-weight: 950; letter-spacing: .1em; }
.observer-now-heading time { color: #526d7b; font-size: 11px; font-weight: 750; }
.observer-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.observer-facts article { display: grid; gap: 5px; padding: 12px; border: 1px solid #d2e5ea; border-radius: 12px; background: #fff; }
.observer-facts span { color: #6c808d; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.observer-facts strong { color: #102f40; overflow-wrap: anywhere; }
.observer-timeline-heading { margin: 20px 0 10px; }
.observer-timeline { display: grid; gap: 8px; }
.observer-timeline-item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid #d5e3eb; border-radius: 12px; background: #fff; }
.observer-timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: #13aeb1; box-shadow: 0 0 0 4px rgba(19,174,177,.12); }
.observer-timeline-item div { display: grid; gap: 3px; }
.observer-timeline-item strong { color: #173344; }
.observer-timeline-item small,
.observer-timeline-item time { color: #6a7d89; font-size: 10px; }
body.theme-dark .admin-user-observer,
body.dark-theme .admin-user-observer { border-top-color: #42d1d0; }
body.theme-dark .observer-private-badge,
body.dark-theme .observer-private-badge { color: #8af1ec; background: #12383d; border-color: #286267; }
body.theme-dark .observer-analytics,
body.dark-theme .observer-analytics { color: #e9f7fa; border-color: #285568; background: linear-gradient(145deg, #132a36 0%, #111f30 100%); }
body.theme-dark .observer-analytics-heading small,
body.dark-theme .observer-analytics-heading small { color: #9eb7c2; }
body.theme-dark .observer-analytics-kpis article,
body.dark-theme .observer-analytics-kpis article,
body.theme-dark .observer-analytics-grid > article,
body.dark-theme .observer-analytics-grid > article { border-color: #2b4d5f; background: #182c3b; }
body.theme-dark .observer-analytics-kpis span,
body.dark-theme .observer-analytics-kpis span,
body.theme-dark .observer-analytics-kpis small,
body.dark-theme .observer-analytics-kpis small,
body.theme-dark .observer-analytics-bar > div,
body.dark-theme .observer-analytics-bar > div { color: #9db5c1; }
body.theme-dark .observer-analytics-kpis strong,
body.dark-theme .observer-analytics-kpis strong { color: #54dbd5; }
body.theme-dark .observer-analytics-section-title strong,
body.dark-theme .observer-analytics-section-title strong { color: #eef8fa; }
body.theme-dark .observer-analytics-bar i,
body.dark-theme .observer-analytics-bar i { background: #294353; }
body.theme-dark .observer-analytics-table-wrap,
body.dark-theme .observer-analytics-table-wrap { border-color: #2d4b5d; background: #172838; }
body.theme-dark .observer-analytics-table th,
body.dark-theme .observer-analytics-table th { color: #a7bdc7; background: #1d3445; }
body.theme-dark .observer-analytics-table td,
body.dark-theme .observer-analytics-table td { color: #e8f4f7; border-color: #2b4657; }
body.theme-dark .observer-analytics-table td:first-child small,
body.dark-theme .observer-analytics-table td:first-child small { color: #91aab6; }
body.theme-dark .observer-role-pill,
body.dark-theme .observer-role-pill { color: #8cece6; background: #174047; }
body.theme-dark .observer-user-picker label,
body.dark-theme .observer-user-picker label { color: #d8edf3; }
body.theme-dark .observer-live-state.idle,
body.dark-theme .observer-live-state.idle { color: #aebfcb; background: #273646; }
body.theme-dark .observer-live-state.online,
body.dark-theme .observer-live-state.online { color: #8be8b6; background: #123d2b; border-color: #26734c; }
body.theme-dark .observer-live-state.offline,
body.dark-theme .observer-live-state.offline { color: #ffd985; background: #463616; border-color: #745a21; }
body.theme-dark .observer-now-card,
body.dark-theme .observer-now-card { border-color: #31596a; background: linear-gradient(135deg, #142c39, #132235); }
body.theme-dark .observer-now-heading time,
body.dark-theme .observer-now-heading time { color: #a6bdca; }
body.theme-dark .observer-facts article,
body.dark-theme .observer-facts article,
body.theme-dark .observer-timeline-item,
body.dark-theme .observer-timeline-item { border-color: #2c455b; background: #18293b; }
body.theme-dark .observer-facts span,
body.dark-theme .observer-facts span,
body.theme-dark .observer-timeline-item small,
body.dark-theme .observer-timeline-item small,
body.theme-dark .observer-timeline-item time,
body.dark-theme .observer-timeline-item time { color: #9cb2c1; }
body.theme-dark .observer-facts strong,
body.dark-theme .observer-facts strong,
body.theme-dark .observer-timeline-item strong,
body.dark-theme .observer-timeline-item strong { color: #f1f8fb; }

@media (max-width: 820px) {
  .observer-analytics { padding: 14px; }
  .observer-analytics-heading { display: grid; }
  .observer-analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .observer-analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .observer-analytics-kpis { grid-template-columns: 1fr; }
  .observer-user-picker { grid-template-columns: 1fr; }
  .observer-live-state { justify-self: start; }
}

/* V10.12 — administrator: wspólna kolejka niedokończonych raportów. */
.admin-pending-reports-panel {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #b8dce6;
  border-left: 5px solid #0f9299;
  border-radius: 18px;
  background: linear-gradient(145deg, #f6fcfd 0%, #edf8fa 100%);
  color: #173344;
  box-shadow: 0 14px 30px rgba(18, 92, 104, 0.08);
}

.admin-pending-reports-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-pending-reports-heading > div { display: grid; gap: 4px; }
.admin-pending-reports-heading .eyebrow { margin: 0; color: #087b84; }
.admin-pending-reports-heading h3 { margin: 0; color: #102b3b; font-size: 1.06rem; }
.admin-pending-reports-heading p { margin: 0; color: #5b7180; font-size: .76rem; }

.admin-pending-reports-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #c5e0e7;
  border-radius: 12px;
  background: rgba(255,255,255,.8);
  color: #315465;
  font-size: .76rem;
  font-weight: 800;
}

.admin-pending-reports-list { display: grid; gap: 9px; }
.admin-pending-report-card {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(250px, 1.35fr) auto minmax(230px, auto);
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #c9dce4;
  border-radius: 14px;
  background: #ffffff;
  color: #173344;
}

.admin-pending-report-card.has-day-report { border-left: 4px solid #e6a20b; }
.admin-pending-report-person,
.admin-pending-report-order { display: grid; min-width: 0; gap: 3px; }
.admin-pending-report-card strong { color: #102b3b; overflow-wrap: anywhere; }
.admin-pending-report-card small { color: #607887; font-size: .69rem; overflow-wrap: anywhere; }
.admin-pending-report-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #e6c46e;
  border-radius: 999px;
  background: #fff7dc;
  color: #815d00;
  font-size: .62rem;
  font-weight: 900;
}

.admin-pending-report-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.admin-pending-report-actions button { width: auto; min-height: 38px; padding: 8px 12px; }
.danger-outline-button {
  border: 1px solid #d96b6b;
  background: #fff5f5;
  color: #a51f2b;
}
.danger-outline-button:hover,
.danger-outline-button:focus-visible { border-color: #b91c2b; background: #ffe7e9; color: #8f1421; }

body.theme-dark .admin-pending-reports-panel,
body.dark-theme .admin-pending-reports-panel {
  border-color: #285469;
  border-left-color: #27c4c1;
  background: linear-gradient(145deg, #102536 0%, #0d202e 100%);
  color: #edf9fb;
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}
body.theme-dark .admin-pending-reports-heading .eyebrow,
body.dark-theme .admin-pending-reports-heading .eyebrow { color: #61d8d5; }
body.theme-dark .admin-pending-reports-heading h3,
body.dark-theme .admin-pending-reports-heading h3,
body.theme-dark .admin-pending-report-card strong,
body.dark-theme .admin-pending-report-card strong { color: #f4fcfd; }
body.theme-dark .admin-pending-reports-heading p,
body.dark-theme .admin-pending-reports-heading p,
body.theme-dark .admin-pending-report-card small,
body.dark-theme .admin-pending-report-card small { color: #adc5cf; }
body.theme-dark .admin-pending-reports-summary,
body.dark-theme .admin-pending-reports-summary {
  border-color: #315b6d;
  background: #152d3e;
  color: #d7eef2;
}
body.theme-dark .admin-pending-report-card,
body.dark-theme .admin-pending-report-card {
  border-color: #31556a;
  background: #162a3b;
  color: #edf9fb;
}
body.theme-dark .admin-pending-report-status,
body.dark-theme .admin-pending-report-status {
  border-color: #9a7415;
  background: #4a390b;
  color: #ffe7a1;
}
body.theme-dark .danger-outline-button,
body.dark-theme .danger-outline-button {
  border-color: #a84a56;
  background: #451d27;
  color: #ffd7dc;
}
body.theme-dark .danger-outline-button:hover,
body.dark-theme .danger-outline-button:hover,
body.theme-dark .danger-outline-button:focus-visible,
body.dark-theme .danger-outline-button:focus-visible { border-color: #e46a78; background: #5c2230; color: #ffffff; }

@media (max-width: 900px) {
  .admin-pending-report-card { grid-template-columns: 1fr; gap: 9px; }
  .admin-pending-report-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .admin-pending-reports-panel { padding: 13px; border-radius: 16px; }
  .admin-pending-reports-heading { display: grid; }
  .admin-pending-reports-heading button { width: 100%; }
  .admin-pending-report-actions { display: grid; grid-template-columns: 1fr; }
  .admin-pending-report-actions button { width: 100%; }
}

@media (max-width: 640px) {
  html body .login-logo {
    min-height: 158px;
    margin-top: -8px;
  }

  html body .login-logo img {
    width: min(100%, 290px);
    max-width: 290px;
    max-height: 158px;
  }

  html body .cookie-consent-dialog {
    inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px;
    max-height: min(76dvh, 560px);
  }

  .toa-day-order-tabs { grid-template-columns: 1fr; }
  .toa-day-order-tabs .toa-day-order-option { min-height: 66px; }
  .observer-user-picker { grid-template-columns: 1fr; }
  .observer-live-state { justify-self: start; }
  .observer-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .observer-timeline-item { grid-template-columns: 12px minmax(0, 1fr); }
  .observer-timeline-item time { grid-column: 2; }
  .employee-hours-entry { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 11px 12px; }
  .employee-hours-entry strong { font-size: 13px; }
}

/* V10.11 — zwarte monity Notatnika: wyłącznie dzisiaj i jutro. */
#deadlineAlerts.deadline-alerts {
  gap: 0;
  margin-bottom: 12px;
}

#deadlineAlerts .deadline-notes-panel {
  padding: 14px;
  border: 1px solid #cfe0ef;
  border-radius: 18px;
  background: rgba(250, 253, 255, 0.97);
  box-shadow: 0 12px 26px rgba(15, 45, 70, 0.08);
}

#deadlineAlerts .deadline-notes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#deadlineAlerts .deadline-notes-heading .eyebrow {
  margin: 0 0 2px;
  color: #1479f7;
  font-size: 0.62rem;
}

#deadlineAlerts .deadline-notes-heading h2 {
  margin: 0;
  color: #10243a;
  font-size: 1rem;
  line-height: 1.2;
}

#deadlineAlerts .deadline-notes-count {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #9dc9f4;
  border-radius: 999px;
  background: #e8f4ff;
  color: #0c65bd;
  font-size: 0.75rem;
  font-weight: 900;
}

#deadlineAlerts .deadline-notes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

#deadlineAlerts .deadline-note-alert {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px 11px;
  border: 1px solid #cae0f5;
  border-left: 4px solid #1479f7;
  border-radius: 13px;
  background: #f2f8ff;
  color: #10243a;
  box-shadow: none;
  font-size: 0.78rem;
  line-height: 1.3;
}

#deadlineAlerts .note-reminder-date {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border: 1px solid #a9d2f8;
  border-radius: 10px;
  background: #dcefff;
  color: #0a5da8;
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.05em;
}

#deadlineAlerts .note-reminder-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#deadlineAlerts .note-reminder-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #10243a;
  font-size: 0.86rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#deadlineAlerts .note-reminder-copy span {
  overflow: hidden;
  color: #5d7085;
  font-size: 0.7rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#deadlineAlerts .deadline-note-alert .note-acknowledge-button {
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  border-color: #13874f;
  background: #13874f;
  color: #ffffff;
  font-size: 0.68rem;
}

#deadlineAlerts .deadline-notes-hint {
  margin: 9px 2px 0;
  color: #65788d;
  font-size: 0.67rem;
  font-weight: 650;
}

body.theme-dark #deadlineAlerts .deadline-notes-panel {
  border-color: #334e69 !important;
  background: #0f1d2c !important;
  color: #eaf3ff !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24) !important;
}

body.theme-dark #deadlineAlerts .deadline-notes-heading .eyebrow {
  color: #67b5ff !important;
}

body.theme-dark #deadlineAlerts .deadline-notes-heading h2 {
  color: #f7fbff !important;
}

body.theme-dark #deadlineAlerts .deadline-notes-count {
  border-color: #356da7 !important;
  background: #173f68 !important;
  color: #dceeff !important;
}

body.theme-dark #deadlineAlerts .deadline-note-alert {
  border-color: #315a7d !important;
  border-left-color: #43a3ff !important;
  background: #132b43 !important;
  color: #edf6ff !important;
  box-shadow: none !important;
}

body.theme-dark #deadlineAlerts .note-reminder-date {
  border-color: #3976ac !important;
  background: #18517e !important;
  color: #eaf5ff !important;
}

body.theme-dark #deadlineAlerts .note-reminder-copy strong {
  color: #f8fbff !important;
}

body.theme-dark #deadlineAlerts .note-reminder-copy span,
body.theme-dark #deadlineAlerts .deadline-notes-hint {
  color: #b8c9db !important;
}

body.theme-dark #deadlineAlerts .deadline-note-alert .note-acknowledge-button {
  border-color: #1b8c52 !important;
  background: #157b48 !important;
  color: #ffffff !important;
}

.mfa-recovery-codes {
  margin: 12px 0;
  padding: 14px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid #bfd0e2;
  border-radius: 12px;
  background: #f3f7fb;
  color: #10243a;
  font: 700 0.9rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

body.theme-dark .mfa-recovery-codes {
  border-color: #3d5873;
  background: #13283b;
  color: #edf6ff;
}

#passwordResetDialog .form-hint,
#mfaSettingsDialog p {
  overflow-wrap: anywhere;
}

@media (max-width: 540px) {
  #passwordResetDialog,
  #mfaLoginDialog,
  #mfaSettingsDialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}

@media (max-width: 767px) {
  #deadlineAlerts.deadline-alerts {
    margin-bottom: 10px;
  }

  #deadlineAlerts .deadline-notes-panel {
    padding: 11px;
    border-radius: 16px;
  }

  #deadlineAlerts .deadline-notes-heading {
    margin-bottom: 8px;
  }

  #deadlineAlerts .deadline-notes-list {
    grid-template-columns: 1fr;
  }

  #deadlineAlerts .deadline-note-alert {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    min-height: 64px;
    padding: 9px;
  }

  #deadlineAlerts .note-reminder-date {
    min-height: 42px;
    font-size: 0.55rem;
  }

  #deadlineAlerts .note-reminder-copy strong {
    font-size: 0.8rem;
  }

  #deadlineAlerts .deadline-note-alert .note-acknowledge-button {
    grid-column: 2;
    width: 100%;
  }

  #deadlineAlerts .deadline-notes-hint {
    font-size: 0.63rem;
  }
}
