/*
 * TNVORA V10.43 — RESPONSIVE
 * Plik generowany przez kontrolowaną refaktoryzację CSS.
 * Kolejność kaskady wynika z jawnej kolejności plików w index.html.
 */

@media (max-width: 760px) {
  .admin-problem-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .admin-problem-toolbar label {
    grid-column: 1 / -1;
  }
  .work-order-late-member {
    grid-template-columns: 1fr;
  }

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

  .work-order-team-leave[open] {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-order-team-leave[open] > * {
    grid-column: 1;
    min-width: 0;
  }
}

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

@media (min-width: 980px) {
  .app-shell.desktop-layout > .support-session-banner { grid-column: 2 / -1; width: auto; margin-inline: 14px; }
  body.desktop-menu-collapsed .app-shell.desktop-layout > .support-session-banner { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .support-session-banner,
  .support-code-actions,
  .admin-support-code-entry,
  .employee-month-chart-heading { align-items: stretch; flex-direction: column; }
  .support-session-banner { position: relative; margin: 8px 12px 0; width: auto; }
  .employee-month-kpis { grid-template-columns: 1fr; }
  .support-code-actions button,
  .admin-support-code-entry button { width: 100%; }
  .support-code-value { letter-spacing: .08em; }
}

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

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

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

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

  .guide-workflow-animation-toolbar strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .guide-workflow-animation-toolbar {
    justify-content: flex-end;
  }

  .guide-workflow-animation-toolbar button {
    min-width: 154px;
  }
}

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

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

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

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

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

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

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

@media (max-width: 820px) {
  .app-install-grid {
    grid-template-columns: 1fr;
  }

  .app-install-card > p {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .app-install-panel {
    padding: 16px;
    border-radius: 16px;
  }

  .app-install-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .app-install-hero img {
    width: min(66%, 190px);
    margin: 0 auto;
  }
}

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

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

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

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

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

@media (max-width: 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));
  }
}

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

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

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

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

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

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

@media (max-width: 820px) {
  .sms-gateway-grid {
    grid-template-columns: 1fr;
  }

  .sms-users-heading {
    display: grid;
  }
}

@media (max-width: 820px) {
  .work-time-range {
    grid-template-columns: 1fr;
  }

  .collaborators-box {
    grid-template-columns: 1fr;
  }
}

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

  .travel-cert-row .report-allowance-option {
    grid-column: 1 / -1;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
  }
}

@media (max-width: 720px) {
  .coordinator-flow-steps {
    grid-template-columns: 1fr;
  }

  .coordinator-company-heading,
  .coordinator-subheading,
  .coordinator-company-create > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .coordinator-company-heading .inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .coordinator-company-heading .inline-actions button {
    min-height: 46px;
    width: 100%;
  }

  .coordinator-unassigned-leader {
    grid-template-columns: 1fr;
  }

  .coordinator-technician-table .coordinator-check-column {
    width: 56px;
  }

  .coordinator-technician-table th.coordinator-check-column {
    font-size: 0;
  }

  .coordinator-technician-table th.coordinator-check-column::after {
    content: "✓";
    color: var(--muted);
    font-size: 0.86rem;
  }

  .coordinator-technician-table th,
  .coordinator-technician-table td {
    padding: 10px 6px;
  }

  .coordinator-technician-table th:nth-child(3),
  .coordinator-technician-table td:nth-child(3) {
    display: none;
  }

  .coordinator-technician-mobile-login {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
  }

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

  .coordinator-actions {
    align-items: stretch;
  }

  .coordinator-actions .primary-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .company-settings-grid {
    grid-template-columns: 1fr;
  }

  .company-settings-actions button {
    flex: 1 1 100%;
  }
}

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

@media (max-width: 760px) {
  .backup-panel-grid { grid-template-columns: 1fr; }
  .admin-month-delete-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

@media (min-width: 760px) {
  .admin-user-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.9fr);
  }
}

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

@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: var(--tnvora-white);
  }

  .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: var(--tnvora-surface-blue);
    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: var(--tnvora-white);
  }

  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: var(--tnvora-surface-blue) !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: var(--tnvora-white) !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: var(--tnvora-white);
    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;
    white-space: normal;
    min-width: 0;
    max-width: 100%;
  }

  .inventory-table td > * {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .inventory-table .inventory-notes {
    max-width: 100%;
  }

  .inventory-table td:first-child {
    border-left: 0;
  }

  .inventory-table td::before {
    content: attr(data-label);
    color: var(--tnvora-gray-500);
    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-active-task .work-order-task-moment {
    grid-column: 2;
  }

  .work-order-task-moment.multi-day {
    grid-template-columns: minmax(0, 1fr) minmax(86px, 104px);
  }

  .work-order-break-extra {
    grid-template-columns: 1fr;
  }

  .user-work-order .admin-user-actions > * {
    flex: 1 1 180px;
  }
}

@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;
    --desktop-page-right-gap: 18px;
    --desktop-grid-gap: 14px;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0 var(--desktop-page-right-gap) 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: var(--desktop-grid-gap);
    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: 2 / -1;
    grid-row: 1;
    min-height: 52px;
    width: calc(100% + var(--desktop-page-right-gap));
    margin: 0 calc(-1 * var(--desktop-page-right-gap)) 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 {
    display: 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] {
    --side-menu-bg: rgba(16, 23, 34, 0.975);
    --side-menu-border: rgba(255, 255, 255, 0.08);
    --side-menu-shadow: 12px 0 24px rgba(16, 23, 34, 0.1);
    --side-menu-text: #ecf3fb;
    --side-menu-muted: #9fb0c3;
    --side-menu-label: #91a5bd;
    --side-menu-divider: rgba(148, 163, 184, 0.18);
    --side-menu-button-text: #cbd7e6;
    --side-menu-button-bg: transparent;
    --side-menu-hover-text: var(--tnvora-white);
    --side-menu-hover-bg: rgba(255, 255, 255, 0.08);
    --side-menu-active-text: var(--tnvora-white);
    --side-menu-active-bg: #0866d8;
    --side-menu-active-border: var(--blue);
    --side-menu-active-shadow: 0 7px 16px rgba(20, 121, 247, 0.24);
    --side-menu-disabled-text: #8290a2;
    --side-menu-disabled-bg: rgba(255, 255, 255, 0.03);
    --side-menu-utility-text: #d9e5f2;
    --side-menu-utility-bg: rgba(255, 255, 255, 0.05);
    --side-menu-warning-text: #ffb4ba;
    --side-menu-warning-bg: rgba(200, 62, 69, 0.14);
    --side-menu-logout-bg: #c83e45;
    --side-menu-logout-border: #e45b62;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex !important;
    box-sizing: border-box;
    grid-column: 1;
    grid-row: 1 / span 201;
    width: calc(var(--desktop-sidebar-width) + var(--desktop-grid-gap));
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    align-self: start;
    padding: 12px calc(10px + var(--desktop-grid-gap)) 14px 10px;
    border-right: 1px solid var(--side-menu-border);
    color: var(--side-menu-text);
    background: var(--side-menu-bg);
    box-shadow: var(--side-menu-shadow);
    transform: none;
    overflow: hidden;
  }

  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 var(--side-menu-divider);
  }

  .app-shell.desktop-layout .side-logo-frame {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--tnvora-white);
    box-shadow: none;
  }

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

  .app-shell.desktop-layout .side-brand strong {
    color: var(--side-menu-text);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .app-shell.desktop-layout .side-brand span {
    color: var(--side-menu-muted);
    font-size: 0.64rem;
  }

  .app-shell.desktop-layout .close-menu-button {
    display: none;
  }

  .app-shell.desktop-layout .side-menu-list {
    flex: 1 1 auto;
    gap: 2px;
    min-height: 0;
    padding: 4px 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] {
    gap: 8px;
    padding-top: 9px;
    padding-bottom: 10px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] .side-menu-head {
    padding-bottom: 5px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] .side-menu-list {
    gap: 1px;
    padding: 2px 0;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] :is(.side-nav-group, .side-admin-nav-group) {
    gap: 1px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] :is(.side-nav-group + .side-nav-group, .side-admin-nav-group + .side-admin-nav-group) {
    margin-top: 3px;
    padding-top: 4px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] .side-nav-group-toggle {
    min-height: 25px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] .side-menu-list button:not(.side-nav-group-toggle) {
    min-height: 29px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.68rem;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="compact"] .side-menu-footer {
    gap: 5px;
    padding-top: 5px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] {
    gap: 5px;
    padding-top: 6px;
    padding-bottom: 7px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-menu-head {
    padding-bottom: 3px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-logo-frame {
    width: 31px;
    height: 31px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-logo-frame img {
    width: 26px;
    height: 26px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-brand strong {
    font-size: 0.66rem;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-brand span {
    font-size: 0.58rem;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-menu-list {
    gap: 0;
    padding: 1px 0;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] :is(.side-nav-group, .side-admin-nav-group) {
    gap: 0;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] :is(.side-nav-group + .side-nav-group, .side-admin-nav-group + .side-admin-nav-group) {
    margin-top: 1px;
    padding-top: 2px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-nav-group-toggle {
    min-height: 22px;
    padding-top: 1px;
    padding-bottom: 1px;
    font-size: 0.56rem;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-menu-list button:not(.side-nav-group-toggle) {
    min-height: 26px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 0.64rem;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] .side-menu-footer {
    gap: 3px;
    padding-top: 3px;
  }

  .app-shell.desktop-layout .side-menu[data-menu-density="tight"] :is(.side-utility-button, .side-logout-button) {
    min-height: 29px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.64rem;
  }

  .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;
    font-size: 0.72rem;
    font-weight: 850;
  }

  .app-shell.desktop-layout .side-admin-shortcuts button {
    min-height: 29px;
    padding: 6px 8px;
    font-size: 0.66rem;
  }

  .app-shell.desktop-layout .side-menu-footer {
    padding-top: 8px;
    border-top: 1px solid var(--side-menu-divider);
  }

  .app-shell.desktop-layout .side-info-dot {
    width: 22px;
    height: 22px;
    color: var(--tnvora-white);
    background: var(--side-menu-active-bg);
    font-size: 0.7rem;
  }

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

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

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

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

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

@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: var(--tnvora-surface-cool) !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: var(--tnvora-surface-cool) !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: var(--tnvora-gray-300) !important;
  }
}

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

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

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

  #adminFarmManagement .farm-numbering-builder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #adminFarmManagement .farm-numbering-builder > button {
    grid-column: 1 / -1;
  }

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

@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: 820px) {
  .work-hours-download-toolbar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .work-hours-download-copy {
    order: -1;
  }

  .work-hours-project-card header,
  .work-hours-projects-heading {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .work-hours-download-toolbar,
  .work-hours-project-card {
    padding: 13px;
  }

  .work-hours-project-card header,
  .work-hours-projects-heading {
    display: grid;
  }

  .work-hours-project-card header > strong,
  .work-hours-projects-heading small {
    justify-self: start;
  }

  .work-hours-project-rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@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,
  .analytics-table,
  .boss-history-table {
    min-width: 620px;
  }
}

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

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

@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-year-picker {
    margin-right: 44px;
    margin-left: 44px;
  }

  .pl-calendar-days {
    gap: 5px;
  }

  .pl-calendar-day {
    min-height: 44px;
    border-radius: 10px;
  }

  .pl-calendar-days {
    grid-template-rows: repeat(6, 44px);
  }
}

@media (max-width: 900px) {
  .park-document-form { grid-template-columns: 1fr 1fr; }
  .park-document-form > button { min-height: 48px; }
}

@media (max-width: 620px) {
  .park-document-heading { flex-direction: column; }
  .park-document-form { grid-template-columns: 1fr; padding: 12px; }
  .park-document-form .error-message { grid-column: auto; }
  .park-document-card { grid-template-columns: 46px minmax(0, 1fr); align-items: start; gap: 10px; }
  .park-document-icon { width: 46px; height: 46px; }
  .park-document-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .park-document-actions button { width: 100%; min-height: 44px; }
}

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

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

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

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

@media (prefers-reduced-motion: reduce) {
  body :is(
    .bottom-nav-item,
    .side-menu-list button
  )[data-app-route="workOrder"].work-order-state-pending {
    animation: none;
  }
}

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

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

@media (max-width: 560px) {
  .work-order-copy-reference {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 1440px) {
  .app-shell.desktop-layout.boss-home-layout #userWorkOrdersList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

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

@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: var(--tnvora-white) !important;
    background: #168a4a !important;
    border-color: #35a766 !important;
  }
}

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

@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,
  #workOrderForm > .work-order-guests {
    grid-column: 1 / -1;
    width: 100%;
  }

  #workOrderForm > .work-order-guests {
    align-self: auto;
  }

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

  .work-order-permit-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .work-order-permit-selector {
    padding: 13px;
  }

  .work-order-permit-options {
    grid-template-columns: 1fr;
  }

  .work-order-permit-option {
    min-height: 0;
  }

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

@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: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    border-radius: 18px;
  }

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

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

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

@media (max-width: 720px) {
  .short-workday-decision {
    align-items: stretch;
    flex-direction: column;
  }

  .short-workday-decision button {
    width: 100%;
  }
}

@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: var(--tnvora-white) !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;
  }
  body.printing-tnvora-agreement .tnvora-document-body h3,
  body.printing-tnvora-agreement .tnvora-document-body h4 {
    break-after: avoid;
    page-break-after: avoid;
  }
  body.printing-tnvora-agreement .tnvora-signature-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  @page { size: A4; margin: 10mm; }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@media (max-width: 720px) {
  .operational-calendar.history-calendar {
    padding: 8px;
  }

  .operational-calendar .calendar-weekdays,
  .operational-calendar .calendar-grid {
    gap: 5px;
  }

  .operational-calendar .calendar-cell,
  .operational-calendar .calendar-day {
    min-height: 76px;
  }

  .operational-calendar .calendar-day {
    gap: 4px;
    padding: 7px 5px;
    border-radius: 11px;
  }

  .operational-calendar .calendar-day-number {
    font-size: 1rem;
  }

  .operational-day-summary em {
    font-size: 0.5rem;
    letter-spacing: -0.03em;
  }

  .operational-day-summary small {
    font-size: 0.48rem;
    letter-spacing: -0.04em;
  }

  .operational-full {
    display: none;
  }

  .operational-compact {
    display: inline;
  }

  .operational-calendar .calendar-markers,
  .operational-calendar .vacation-day-signals {
    top: 7px;
    right: 5px;
  }

  .operational-calendar-timeline {
    padding: 12px;
  }

  .operational-timeline-heading {
    display: grid;
  }

  .operational-timeline-heading > span {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .app-install-recovery {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar.history-calendar,
  .app-shell.desktop-layout #vacationPanel.app-route-active #vacationCalendar.operational-calendar {
    width: 100%;
    max-width: none;
    margin: 14px 0 18px;
    padding: 14px;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar .calendar-weekdays,
  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar .calendar-grid,
  .app-shell.desktop-layout #vacationPanel.app-route-active .operational-calendar .calendar-weekdays,
  .app-shell.desktop-layout #vacationPanel.app-route-active .operational-calendar .calendar-grid {
    gap: 8px;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar .calendar-cell,
  .app-shell.desktop-layout #vacationPanel.app-route-active .operational-calendar .calendar-cell {
    min-height: 104px;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar .calendar-day,
  .app-shell.desktop-layout #vacationPanel.app-route-active .operational-calendar .calendar-day,
  .app-shell.desktop-layout #vacationPanel.app-route-active #vacationCalendar .calendar-day {
    width: 100%;
    max-width: none;
    min-height: 104px;
    aspect-ratio: auto;
    align-content: space-between;
    justify-items: stretch;
    padding: 12px;
    border-width: 1px;
    border-radius: 14px;
  }

  .app-shell.desktop-layout #historyPanel.app-route-active .operational-calendar .calendar-day-number,
  .app-shell.desktop-layout #vacationPanel.app-route-active .operational-calendar .vacation-day-number {
    align-self: start;
    font-size: 1.25rem;
    line-height: 1;
  }

  .app-shell.desktop-layout #vacationPanel.app-route-active .vacation-planner-grid {
    grid-template-columns: minmax(700px, 1.35fr) minmax(360px, 0.65fr);
  }
}

@media (max-width: 979px) {
  #historyPanel .operational-calendar .calendar-day,
  #vacationPanel #vacationCalendar.operational-calendar .calendar-day {
    width: 100%;
    max-width: none;
    min-height: 76px;
    aspect-ratio: auto;
    align-content: space-between;
    justify-items: stretch;
    padding: 8px 6px;
    border-width: 1px;
  }

  #vacationPanel #vacationCalendar.operational-calendar {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  #historyPanel .operational-calendar .calendar-cell,
  #historyPanel .operational-calendar .calendar-day,
  #vacationPanel #vacationCalendar.operational-calendar .calendar-cell,
  #vacationPanel #vacationCalendar.operational-calendar .calendar-day {
    min-height: 68px;
  }

  #historyPanel .operational-day-summary small,
  #vacationPanel .operational-day-summary small {
    display: none;
  }

  #historyPanel .operational-day-summary em,
  #vacationPanel .operational-day-summary em {
    overflow: visible;
    font-size: 0.48rem;
    white-space: normal;
  }
}

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

@media (max-width: 620px) {
  .technician-overview-title {
    font-size: 1.45rem !important;
  }

  .operational-timeline-heading h3 {
    font-size: 1.22rem;
  }

  .operational-timeline-total {
    margin-top: 10px;
    font-size: 1.55rem;
  }
}

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

  .technician-kpi-grid article {
    min-height: 132px;
    padding: 14px 10px 12px 14px;
  }

  .technician-kpi-grid strong {
    font-size: clamp(1.2rem, 7vw, 1.65rem);
  }

  .technician-kpi-grid span,
  .technician-kpi-grid small {
    overflow-wrap: anywhere;
  }

  .technician-kpi-pair {
    gap: 7px;
  }

  .technician-kpi-pair > div + div {
    padding-left: 7px;
  }
}

@media (min-width: 980px) {
  .app-shell.desktop-layout > .support-presence-banner { grid-column: 2 / -1; width: auto; margin-inline: 14px; }
  body.desktop-menu-collapsed .app-shell.desktop-layout > .support-presence-banner { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .business-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .business-cost-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .business-data-toolbar { align-items: stretch; flex-direction: column; }
  .business-data-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .business-data-actions button { width: 100%; }
  .business-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-cost-form { grid-template-columns: 1fr; }
  .business-cost-form .business-wide { grid-column: auto; }
  .business-cost-list article { grid-template-columns: 1fr auto; }
  .business-cost-list article button { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .sep-expiry-item { align-items: flex-start; flex-direction: column; gap: 7px; }
  .sep-expiry-dialog .account-dialog-actions { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .inventory-table th, .inventory-table td { padding-block: 6px !important; }
  .inventory-table td { height: 40px; line-height: 1.18; }
  .inventory-table .inventory-name small { margin-top: 1px; font-size: .62rem; }
  .vehicle-list { gap: 7px; }
}

@media (max-width: 760px) {
  .operational-list-toolbar { grid-template-columns: 1fr 1fr; padding: 9px; }
  .operational-search { grid-column: 1 / -1; }
  .operational-list-toolbar > strong { justify-self: end; }
  .operational-table-wrap { overflow: visible; border: 0; background: transparent; }
  .operational-table { min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
  .operational-table thead { display: none; }
  .operational-table tbody, .operational-table tr { display: block; }
  .operational-table tbody tr:not(.qualification-detail-row) {
    display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
    border: 1px solid var(--line, #d6dee8); border-left: 4px solid var(--operational-accent, #2785e6);
    border-radius: 12px; background: var(--surface, var(--tnvora-white)); box-shadow: 0 5px 14px rgba(18, 42, 66, .06);
  }
  .operational-table td { display: grid; align-content: start; gap: 3px; height: auto; min-height: 48px; padding: 8px 10px; border-bottom: 1px solid var(--line, #e1e6ec); }
  .operational-table td::before { content: attr(data-label); color: var(--muted, #657286); font-size: .6rem; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
  .operational-table td:first-child { grid-column: 1 / -1; }
  .operational-table td:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .operational-table .vehicle-item-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); width: 100%; }
  .qualification-detail-row { margin: -9px 7px 9px; }
  .qualification-detail-row td { display: block; padding: 8px; border: 1px solid var(--line, #d6dee8); border-radius: 0 0 12px 12px; }
  .qualification-detail-row td::before { content: none; }
  .qualification-records article { grid-template-columns: 1fr; align-items: stretch; }
  .operational-pagination { justify-content: space-between; }
  .inventory-table tr { padding: 0 !important; gap: 0 !important; }
  .inventory-table td { min-height: 44px; padding: 7px 9px !important; }
body.theme-dark .operational-table tbody tr:not(.qualification-detail-row) { border-color: #344a62; background: #132237; }
}

@media (max-width: 720px) {
  .vacation-team-filters { grid-template-columns: 1fr; }
  #vacationPanel #vacationCalendar.operational-calendar .calendar-day { min-height: 88px; padding: 7px 5px; }
  .vacation-own-state { min-height: 20px; padding: 2px 5px; font-size: .5rem; }
  .vacation-person-state { grid-template-columns: 19px 6px minmax(0, 1fr); gap: 3px; min-height: 17px; padding: 1px 4px; font-size: .46rem; }
  .vacation-person-state i { width: 6px; height: 6px; }
  .vacation-team-total { display: none; }
  /* Seven columns remain usable on phones. Full status is in the legend,
     accessible day label and selected-day details, not clipped microtext. */
  #vacationCalendar .vacation-own-state { padding: 3px; min-height: 16px; }
  #vacationCalendar .vacation-own-state b { display: none; }
  #vacationCalendar .vacation-own-state i { display: block; }
  #vacationCalendar .vacation-person-state { grid-template-columns: minmax(0, 1fr) 4px; gap: 2px; padding: 2px; border-left-width: 1px; }
  #vacationCalendar .vacation-person-state i { width: 4px; height: 4px; }
  #vacationCalendar .vacation-person-state em { display: none; }
}

@media (max-width: 430px) {
  .login-support-row {
    align-items: flex-start;
  }

  .login-help-link {
    max-width: 48%;
    text-align: right;
  }
}

@media (max-width: 1100px) {
  .tenant-kpi-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .tenant-admin-layout { grid-template-columns: 1fr; }
  .tenant-user-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-feature-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .tenant-control-grid { grid-template-columns: 1fr 1fr; }
  .tenant-payment-message { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .organization-payment-notice { margin: 10px 10px 0; }
  .tenant-admin-heading, .tenant-admin-toolbar, .tenant-card-heading { align-items: stretch; flex-direction: column; }
  .tenant-admin-toolbar label { min-width: 0; }
  .tenant-admin-toolbar small { margin-left: 0; }
  .tenant-kpi-grid, .tenant-control-grid, .tenant-feature-grid, .tenant-server-grid { grid-template-columns: 1fr; }
  .tenant-user-toolbar { grid-template-columns: minmax(0, 1fr); }
  .tenant-user-pagination { display: grid; grid-template-columns: 1fr 1fr; }
  .tenant-user-pagination strong { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
  .tenant-payment-message { grid-column: auto; }
}

@media (min-width: 1101px) {
  /* Czytelna typografia na ekranach desktopowych: skala rośnie łagodnie wraz
     z szerokością CSS ekranu, respektuje zoom przeglądarki i ma bezpieczny limit. */
  html {
    font-size: clamp(17px, calc(14px + .22vw), 20px);
  }

  .app-shell.desktop-layout .topbar-title .user-button {
    min-height: 32px;
    margin-top: 0;
    padding: 5px 7px;
  }

  .app-shell.desktop-layout .side-menu-list button,
  .app-shell.desktop-layout .side-admin-shortcuts button {
    min-height: 36px;
  }
}

@media (max-width: 1100px) {
  .topbar-title .user-button {
    min-height: 32px;
    margin-top: 0;
    padding: 4px 6px;
  }
}
/* V11.05: equal responsive team cells; no fixed column count or clipped names. */
.app-shell #availableWorkersList.available-workers-list,
.app-shell #leaderOperationsPanel .leader-available-technicians-list,
.app-shell.desktop-layout #availableWorkersList.available-workers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  align-items: stretch;
}
.app-shell #availableWorkersList .boss-technician-card,
.app-shell #leaderOperationsPanel .leader-technician-location,
.app-shell.desktop-layout #availableWorkersList .boss-technician-card {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  min-width: 0;
  min-height: 108px;
  height: auto;
  gap: 5px 9px;
  padding: 12px;
}
.app-shell #availableWorkersList .boss-technician-card > :not(i),
.app-shell #leaderOperationsPanel .leader-technician-location > :not(i),
.app-shell.desktop-layout #availableWorkersList .boss-technician-card > :not(i) {
  grid-column: 2;
  grid-row: auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.app-shell #availableWorkersList .boss-technician-card strong,
.app-shell #leaderOperationsPanel .leader-technician-location strong,
.app-shell.desktop-layout #availableWorkersList .boss-technician-card strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: .85rem;
}
.app-shell #summaryPanel[hidden] { display: none !important; }
.toa-order-summary.incident,
.toa-day-order-option.incident,
.datop-incident-notice {
  border: 2px solid #c52a37;
  background: #fff0f1;
  color: #711321;
}
.toa-order-summary.incident .toa-order-status,
.toa-day-order-option.incident .toa-day-order-option-status {
  color: #fff;
  background: #a51629;
}
.datop-incident-notice { padding: 16px; border-radius: 12px; margin: 12px 0; }
.datop-incident-notice p { color: inherit; }
body.theme-dark :is(.toa-order-summary.incident, .toa-day-order-option.incident, .datop-incident-notice) {
  background: #401b26;
  color: #ffe5e9;
  border-color: #ff8293;
}
.app-shell :is(#availableWorkersList, #leaderOperationsPanel) .is-incident {
  background: #971e30 !important;
  color: white !important;
  border: 2px solid #ff8b9b !important;
}
.app-shell :is(#availableWorkersList, #leaderOperationsPanel) .is-incident :is(strong, small, b, span) { color: white !important; }
.app-shell :is(#availableWorkersList, #leaderOperationsPanel) .is-incident > i {
  background: #ff8b9b !important;
  box-shadow: 0 0 0 5px #ff8b9b44;
}

/* V11.19: każda rola otrzymuje jednokolumnowe, czytelne akcje Polecenia na telefonie. */
@media (max-width: 760px) {
  .user-work-order,
  .user-work-order-summary,
  .user-work-order-info,
  .user-work-order .admin-user-actions,
  .user-work-order .admin-user-actions > *,
  .user-work-order .work-order-sign-as,
  .user-work-order .work-order-condition-picker,
  .user-work-order .issuer-pre-sign-review {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .user-work-order .admin-user-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
  }

  .user-work-order .boss-sign-direct {
    min-width: 0;
  }

  .guide-iobp-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .guide-iobp-actions > * {
    width: 100%;
    min-width: 0;
  }
}
