/* FieldOps Filament panel polish */

/* Surfaces */
.fi-input-wrp:not(:focus-within) {
  --tw-ring-color: rgb(100 116 139 / 0.5);
}
.fi-section,
.fi-fo-section,
.fi-ta-ctn {
  --tw-ring-color: rgb(100 116 139 / 0.18);
  border-radius: 0.85rem;
}
.fi-wi-stats-overview-stat {
  border-radius: 0.85rem;
}
html:not(.dark) .fi-section,
html:not(.dark) .fi-wi-stats-overview-stat {
  box-shadow:
    0 1px 3px rgb(15 23 42 / 0.06),
    0 1px 2px rgb(15 23 42 / 0.04);
}
.fi-wi-stats-overview-stat {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.fi-wi-stats-overview-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.1);
}
.fi-ta-header-cell {
  font-weight: 600;
}
.fi-sidebar-group-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  opacity: 0.72;
}

/* Sticky page footer */
.fi-main-ctn {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.fi-main {
  flex: 1 0 auto;
}
.fi-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1rem 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(100 116 139);
  border-top: 1px solid rgb(226 232 240);
}
html.dark .fi-footer {
  color: rgb(148 163 184);
  border-top-color: rgb(51 65 85);
}

/* Table actions */
.fi-ta-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}
.fi-ta-text-item-label {
  overflow-wrap: anywhere;
}

/* Table toolbar: Bitrix filter left, export right */
.fi-ta-header-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  overflow: visible !important;
}
.fi-ta-header-toolbar > .flex.shrink-0 {
  flex: 1 1 100%;
}
.fi-ta-header-toolbar > .ms-auto {
  display: contents;
}
.fi-ta-header-toolbar:has(.fo-bx-ui-filter) > .ms-auto {
  display: flex !important;
  flex: 1 1 100%;
  width: 100%;
  margin-inline-start: 0 !important;
  margin-left: 0 !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  overflow: visible !important;
}
.fi-ta-header-toolbar .fi-ta-search-field {
  flex: 0 1 22rem;
  width: 100%;
  max-width: 22rem;
  margin-right: auto;
}
.fi-ta-header-toolbar .fo-bx-ui-filter {
  flex: 0 1 36rem;
  width: 100%;
  max-width: 36rem;
  min-width: 14rem;
  margin-right: auto;
}
.fi-ta-header-toolbar .fo-ta-toolbar-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}
.fi-ta-header-toolbar .fo-ta-toolbar-actions .fi-ac-btn-action {
  margin: 0;
}
/* Export lives in the toolbar; empty Filament table header is hidden.
   Tailwind divide-y uses `:not([hidden])`, so display:none alone still leaves a 1px border-top
   on the next sibling (the toolbar) — that is the strip under the page title. */
.fi-ta-header:not(:has(.fi-ta-header-heading)):not(:has(.fi-ta-header-description)) {
  display: none !important;
}
.fi-ta-header-ctn:has(> .fi-ta-header:not(:has(.fi-ta-header-heading)):not(:has(.fi-ta-header-description))) > * + * {
  border-top-width: 0 !important;
  border-top-style: none !important;
}
.fi-resource-list-records-page .fi-ta-header-ctn > .fi-ta-header-toolbar {
  border-top-width: 0 !important;
  border-top-style: none !important;
}
@media (max-width: 640px) {
  .fi-ta-header-toolbar .fi-ta-search-field {
    flex: 1 1 100%;
    max-width: none;
    margin-right: 0;
  }
  .fi-ta-header-toolbar   .fo-bx-ui-filter {
    flex: 1 1 100%;
    margin-right: 0;
  }
  .fo-report__toolbar .fo-bx-ui-filter {
    flex: 1 1 100%;
    max-width: none;
    margin-right: 0;
  }
  .fo-report__toolbar .fo-ta-toolbar-actions {
    margin-left: 0;
  }
}

/* Global search: icon trigger + popover */
.fo-global-search {
  position: relative;
}
.fo-global-search-trigger--active {
  --c-400: var(--primary-400);
  --c-500: var(--primary-500);
  --c-600: var(--primary-600);
}
.fo-global-search-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: min(20rem, calc(100vw - 1.5rem));
  padding: 0.65rem;
  border-radius: 0.85rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(255 255 255);
  box-shadow:
    0 12px 28px rgb(15 23 42 / 0.1),
    0 2px 8px rgb(15 23 42 / 0.05);
}
html.dark .fo-global-search-popover {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.35);
}
.fo-global-search-popover .fi-global-search-field {
  width: 100%;
}
.fo-global-search-recent {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgb(241 245 249);
}
html.dark .fo-global-search-recent {
  border-top-color: rgb(30 41 59);
}
.fo-global-search-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.15rem 0.35rem;
}
.fo-global-search-recent__title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}
.fo-global-search-recent__clear {
  font-size: 0.75rem;
  color: rgb(100 116 139);
}
.fo-global-search-recent__clear:hover {
  color: rgb(13 148 136);
}
.fo-global-search-recent__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fo-global-search-recent__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.35rem;
  border-radius: 0.45rem;
  text-align: left;
  font-size: 0.875rem;
  color: rgb(51 65 85);
}
.fo-global-search-recent__item:hover {
  background: rgb(248 250 252);
}
html.dark .fo-global-search-recent__item {
  color: rgb(226 232 240);
}
html.dark .fo-global-search-recent__item:hover {
  background: rgb(30 41 59);
}
.fo-global-search-recent__item-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: rgb(148 163 184);
}
.fo-global-search-popover .fi-global-search-results-ctn {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  max-height: 16rem;
  margin-top: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgb(241 245 249);
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  transition: none !important;
}
html.dark .fo-global-search-popover .fi-global-search-results-ctn {
  border-top-color: rgb(30 41 59);
}

/*
 * Stacking (low → high): page content, filter bar (10), topbar (20), filter popups (25–35),
 * sidebar (50), tooltips (55), column gear (80), modals (1100+).
 */
:root {
  --fo-topbar-height: 4rem;
}
[data-tippy-root] {
  z-index: 55 !important;
}

html.fo-sidebar-flyout-open [data-tippy-root] {
  visibility: hidden !important;
  pointer-events: none !important;
}

.fi-dropdown-panel {
  z-index: 100 !important;
}

/* Sidebar zone + edge handle on the contour */
@media (min-width: 1024px) {
  .fi-sidebar {
    overflow: visible !important;
    z-index: 50 !important;
  }

  /* Soft menu panel: light surface + right contour */
  .fi-sidebar.fi-main-sidebar,
  aside.fi-sidebar {
    background: rgb(248 250 252) !important;
    box-shadow: inset -1px 0 0 rgb(203 213 225 / 0.9);
  }
  html.dark .fi-sidebar.fi-main-sidebar,
  html.dark aside.fi-sidebar {
    background: rgb(15 23 42 / 0.55) !important;
    box-shadow: inset -1px 0 0 rgb(71 85 105 / 0.9);
  }
  .fi-sidebar-header {
    background: transparent !important;
    box-shadow: none !important;
  }

  /*
   * Collapsed rail: Filament hides the logo (x-show=isOpen) and shows an
   * expand button instead. We keep the square brand mark and center icons.
   */
  .fi-sidebar:not(.fi-sidebar-open) {
    width: var(--collapsed-sidebar-width) !important;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-header {
    justify-content: center;
    padding-inline: 0.5rem;
  }

  /* Override Alpine x-show="isOpen" on the logo wrapper */
  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-header > div:first-child {
    display: flex !important;
    opacity: 1 !important;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-logo {
    height: 2rem !important;
    width: 2rem;
    max-width: none;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
    align-items: center;
    padding-inline: 0.5rem;
    scrollbar-gutter: auto;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav-groups {
    width: 100%;
    margin-inline: 0;
    align-items: center;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group,
  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item {
    width: 100%;
    align-items: center;
  }

  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-button,
  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group > .fi-dropdown > button,
  .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-group button.relative {
    justify-content: center;
    margin-inline: auto;
    width: 2.5rem;
    padding-inline: 0.35rem;
  }
}

.fi-sidebar-header > .fi-icon-btn.ms-auto,
.fi-sidebar-header > .fi-icon-btn.mx-auto {
  display: none !important;
}

.fo-sidebar-edge-toggle {
  display: none;
}

@media (min-width: 1024px) {
  .fo-sidebar-edge-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 40;
    width: 1.15rem;
    height: 3.4rem;
    padding: 0.35rem 0;
    border: 1px solid rgb(203 213 225);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff 0%, rgb(248 250 252) 100%);
    color: rgb(100 116 139);
    box-shadow:
      0 1px 2px rgb(15 23 42 / 0.04),
      0 4px 10px rgb(15 23 42 / 0.06);
    transform: translate(50%, -50%);
    cursor: pointer;
    transition:
      background 0.15s ease,
      color 0.15s ease,
      border-color 0.15s ease,
      box-shadow 0.15s ease,
      width 0.15s ease;
  }

  .fo-sidebar-edge-toggle__grip {
    width: 0.45rem;
    height: 0.55rem;
    background-image: radial-gradient(circle, rgb(148 163 184) 0.9px, transparent 1px);
    background-size: 0.22rem 0.22rem;
    background-position: center;
    opacity: 0.85;
  }

  .fo-sidebar-edge-toggle__icon {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
  }

  .fo-sidebar-edge-toggle:hover {
    width: 1.3rem;
    border-color: #0d9488;
    color: #0f766e;
    background: #fff;
    box-shadow:
      0 2px 6px rgb(15 23 42 / 0.08),
      0 0 0 3px rgb(13 148 136 / 0.12);
  }

  .fo-sidebar-edge-toggle:hover .fo-sidebar-edge-toggle__grip {
    background-image: radial-gradient(circle, #0d9488 0.9px, transparent 1px);
  }

  .fo-sidebar-edge-toggle:focus-visible {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgb(13 148 136 / 0.22);
  }

  html.dark .fo-sidebar-edge-toggle {
    background: linear-gradient(180deg, rgb(30 41 59) 0%, rgb(15 23 42) 100%);
    border-color: rgb(71 85 105);
    color: rgb(148 163 184);
  }

  html.dark .fo-sidebar-edge-toggle:hover {
    background: rgb(30 41 59);
    border-color: #0d9488;
    color: #5eead4;
  }
}

/* Per-page picker: styled trigger + custom menu (native option list can't be styled) */
.fo-per-page-picker {
  position: relative;
  display: inline-block;
}
.fo-per-page-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.25rem;
  padding: 0 0.7rem 0 0.85rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.7rem;
  background: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.fo-per-page-trigger:hover {
  border-color: rgb(148 163 184);
}
.fo-per-page-trigger--open,
.fo-per-page-trigger:focus-visible {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.18);
}
.fo-per-page-trigger__label {
  color: rgb(100 116 139);
  font-size: 0.8125rem;
  font-weight: 400;
}
.fo-per-page-trigger__value {
  min-width: 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(51 65 85);
  text-align: center;
}
.fo-per-page-trigger__chevron {
  width: 1rem;
  height: 1rem;
  color: rgb(148 163 184);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.fo-per-page-trigger--open .fo-per-page-trigger__chevron {
  transform: rotate(180deg);
}

/* Native month picker (Период) — match Filament control height */
.fi-fo-text-input:has(.fo-month-input) input[type='month'],
input.fo-month-input[type='month'] {
  min-height: 2.25rem;
  cursor: pointer;
}
html.dark .fi-fo-text-input:has(.fo-month-input) input[type='month'] {
  color-scheme: dark;
}

/* Address map picker (contractor addresses) */
.fi-fo-field-wrp:has(.fo-addr) {
  grid-column: 1 / -1;
}
.fi-modal-window:has(.fo-addr) .fi-modal-content {
  padding-bottom: 0.25rem;
}
.fo-addr {
  width: 100%;
}
.fo-addr__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: stretch;
}
.fo-addr__panel {
  min-width: 0;
}
.fo-addr__panel--search {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.fo-addr__panel--map {
  display: flex;
  flex-direction: column;
}
.fo-addr__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.55rem;
  background: #fff;
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.875rem;
}
.fo-addr__input:focus {
  outline: 2px solid rgb(13 148 136);
  outline-offset: 1px;
}
.fo-addr__suggestions {
  position: relative;
  z-index: 1100;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.55rem;
  background: #fff;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.1);
}
.fo-addr__suggestion {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-bottom: 1px solid rgb(241 245 249);
  background: transparent;
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}
.fo-addr__suggestion:last-child {
  border-bottom: 0;
}
.fo-addr__suggestion:hover {
  background: rgb(240 253 250);
}
.fo-addr__help {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgb(100 116 139);
}
.fo-addr__status {
  margin: 0;
  font-size: 0.75rem;
}
.fo-addr__status--loading {
  color: rgb(100 116 139);
}
.fo-addr__status--error {
  color: rgb(220 38 38);
}
.fo-addr__locate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.45rem;
  background: rgb(248 250 252);
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.fo-addr__locate--inline {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.45rem 0.7rem;
}
.fo-addr__locate svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgb(13 148 136);
}
.fo-addr__locate:hover:not(:disabled) {
  border-color: rgb(13 148 136);
  color: rgb(13 148 136);
  background: rgb(240 253 250);
}
.fo-addr__locate:disabled {
  opacity: 0.65;
  cursor: wait;
}
.fo-addr__map-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.65rem;
  overflow: hidden;
  background: rgb(248 250 252);
}
.fo-addr__map {
  flex: 1;
  width: 100%;
  min-height: 280px;
}
.fo-addr__attrib {
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-size: 0.7rem;
  color: rgb(100 116 139);
  background: rgb(248 250 252);
}
.fo-addr__attrib a {
  color: rgb(13 148 136);
  text-decoration: underline;
}
@media (max-width: 768px) {
  .fo-addr__layout {
    grid-template-columns: 1fr;
  }
  .fo-addr__map-wrap {
    min-height: 260px;
  }
}
html.dark .fo-addr__input,
html.dark .fo-addr__suggestions,
html.dark .fo-addr__map-wrap {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}
html.dark .fo-addr__help,
html.dark .fo-addr__status--loading {
  color: rgb(148 163 184);
}
html.dark .fo-addr__suggestion {
  color: rgb(226 232 240);
  border-bottom-color: rgb(51 65 85);
}
html.dark .fo-addr__suggestion:hover {
  background: rgb(255 255 255 / 0.06);
}
html.dark .fo-addr__locate {
  background: rgb(30 41 59);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}
html.dark .fo-addr__locate svg {
  color: #5eead4;
}
html.dark .fo-addr__attrib {
  background: rgb(30 41 59);
  color: rgb(148 163 184);
}

/* Custom month picker (Период) — same language as fo-dtp */
.fo-mp {
  position: relative;
  width: 100%;
}
.fo-mp__trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.55rem;
  background: #fff;
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.fo-mp__trigger:hover {
  border-color: rgb(203 213 225);
}
.fo-mp__trigger:focus-visible {
  outline: 2px solid rgb(13 148 136);
  outline-offset: 1px;
}
.fo-mp__icon,
.fo-mp__chevron {
  width: 1.05rem;
  height: 1.05rem;
  color: rgb(148 163 184);
  flex-shrink: 0;
}
.fo-mp__value {
  flex: 1;
  min-width: 0;
}
.fo-mp__value--empty {
  color: rgb(148 163 184);
}
.fo-mp__panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 0.85rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.12);
}
.fo-mp__year {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0 0.15rem;
  height: 2.25rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.55rem;
  background: rgb(248 250 252);
}
.fo-mp__year-step {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: rgb(100 116 139);
  cursor: pointer;
}
.fo-mp__year-step:hover {
  background: #fff;
  color: rgb(15 23 42);
}
.fo-mp__year-step svg {
  width: 1rem;
  height: 1rem;
}
.fo-mp__year-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: rgb(15 23 42);
}
.fo-mp__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}
.fo-mp__month {
  display: grid;
  place-items: center;
  min-height: 2.35rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.fo-mp__month:hover {
  background: rgb(241 245 249);
}
.fo-mp__month--current {
  color: rgb(13 148 136);
  font-weight: 700;
}
.fo-mp__month--selected {
  background: rgb(13 148 136) !important;
  color: #fff !important;
  font-weight: 700;
}
.fo-mp__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgb(226 232 240);
}
.fo-mp__link {
  border: 0;
  background: transparent;
  color: rgb(13 148 136);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.fo-mp__link:hover {
  color: rgb(15 118 110);
  text-decoration: underline;
}
html.dark .fo-mp__trigger {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  color: rgb(226 232 240);
}
html.dark .fo-mp__value--empty,
html.dark .fo-mp__icon,
html.dark .fo-mp__chevron {
  color: rgb(148 163 184);
}
html.dark .fo-mp__panel {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
}
html.dark .fo-mp__year {
  background: rgb(30 41 59);
  border-color: rgb(51 65 85);
}
html.dark .fo-mp__year-label,
html.dark .fo-mp__month {
  color: rgb(226 232 240);
}
html.dark .fo-mp__month:hover {
  background: rgb(255 255 255 / 0.06);
}
html.dark .fo-mp__month--current {
  color: #5eead4;
}
html.dark .fo-mp__footer {
  border-top-color: rgb(51 65 85);
}
html.dark .fo-mp__link {
  color: #5eead4;
}

.fo-per-page-picker {
  position: relative;
  display: inline-flex;
}
.fo-per-page-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.4rem;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  color: rgb(30 41 59);
  cursor: pointer;
}
.fo-per-page-trigger__label {
  color: rgb(100 116 139);
  font-size: 0.8125rem;
  font-weight: 500;
}
.fo-per-page-trigger__value {
  font-weight: 600;
}
.fo-per-page-trigger__chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: rgb(148 163 184);
}

.fo-per-page-picker--compact .fo-per-page-trigger {
  padding-inline: 0.65rem;
}
.fo-per-page-menu {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  z-index: 40;
  min-width: 100%;
  padding: 0.3rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.12);
  transform: translateX(-50%);
}
.fo-per-page-menu__item {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: rgb(51 65 85);
  text-align: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.fo-per-page-menu__item:hover {
  background: rgb(248 250 252);
}
.fo-per-page-menu__item--active {
  background: rgb(204 251 241);
  color: #0f766e;
  font-weight: 600;
}
html.dark .fo-per-page-trigger {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(71 85 105);
}
html.dark .fo-per-page-trigger__label {
  color: rgb(148 163 184);
}
html.dark .fo-per-page-trigger__value {
  color: rgb(226 232 240);
}
html.dark .fo-per-page-menu {
  background: rgb(30 41 59);
  border-color: rgb(71 85 105);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
}
html.dark .fo-per-page-menu__item {
  color: rgb(226 232 240);
}
html.dark .fo-per-page-menu__item:hover {
  background: rgb(255 255 255 / 0.06);
}
html.dark .fo-per-page-menu__item--active {
  background: rgb(13 148 136 / 0.22);
  color: #5eead4;
}
.fi-dropdown-panel {
  border-radius: 0.85rem !important;
  overflow: hidden;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.12) !important;
  z-index: 100 !important;
}

/* Date picker: Filament-styled month/year controls */
.fi-fo-date-time-picker {
  position: relative;
}
.fi-fo-date-time-picker-backdrop {
  display: none;
}
.fi-fo-date-time-picker-panel {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 40;
  width: max-content !important;
  min-width: 16.75rem;
  max-width: none;
  padding: 0.75rem !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.12) !important;
}
.fi-fo-date-time-picker-panel > .grid {
  gap: 0.6rem !important;
}
.fi-fo-date-time-picker-panel .grid.grid-cols-7 > div {
  font-size: 0.62rem !important;
  letter-spacing: 0.02em !important;
  line-height: 1.2 !important;
  padding: 0.15rem 0 !important;
}
.fi-fo-date-time-picker-panel [role='grid'] {
  gap: 0.15rem !important;
  grid-template-columns: repeat(7, minmax(1.55rem, 1fr)) !important;
}
.fi-fo-date-time-picker-panel [role='grid'] > [role='option'] {
  box-sizing: border-box;
  width: 1.55rem;
  height: 1.55rem;
  margin-inline: auto;
  font-size: 0.72rem !important;
  line-height: 1.55rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.fo-dtp-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem !important;
}
.fo-dtp-month {
  flex: 1 1 auto;
  min-width: 0;
}
.fo-dtp-month__trigger,
.fo-dtp-year {
  box-sizing: border-box;
  height: 1.9rem;
  min-height: 1.9rem;
  max-height: 1.9rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  background: rgb(248 250 252);
  color: rgb(15 23 42);
  line-height: 1;
  vertical-align: middle;
}
.fo-dtp-month__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0 0.55rem;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.fo-dtp-month__trigger:hover,
.fo-dtp-month__trigger[aria-expanded='true'] {
  background: #fff;
  border-color: rgb(45 212 191);
}
.fo-dtp-month__label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
  line-height: 1.9rem;
}
.fo-dtp-month__chevron {
  width: 0.85rem;
  height: 0.85rem;
  color: rgb(100 116 139);
  flex-shrink: 0;
  margin-inline-start: auto;
}
.fo-dtp-month__panel {
  position: absolute;
  z-index: 50;
  top: auto;
  bottom: calc(100% + 0.35rem);
  left: 0;
  min-width: 9.5rem;
  width: max(100%, 9.5rem);
  max-height: 14rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.7rem;
  background: #fff;
  box-shadow:
    0 8px 24px rgb(15 23 42 / 0.14),
    0 2px 6px rgb(15 23 42 / 0.06);
  overscroll-behavior: contain;
}
.fo-dtp-month__option {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: rgb(51 65 85);
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: start;
  text-transform: capitalize;
  white-space: nowrap;
  cursor: pointer;
}
.fo-dtp-month__option:hover {
  background: rgb(240 253 250);
  color: rgb(15 118 110);
}
.fo-dtp-month__option--active {
  background: #0f766e !important;
  color: #fff !important;
  font-weight: 600;
}
.fo-dtp-year {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 0;
  width: 8rem;
  min-width: 8rem;
  padding: 0 0.2rem;
  overflow: visible;
}
.fo-dtp-year__input {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 3.75rem;
  min-width: 3.75rem;
  max-width: 3.75rem;
  height: 100%;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  text-align: center;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.9rem;
  color: rgb(15 23 42);
  -moz-appearance: textfield;
  appearance: textfield;
}
.fo-dtp-year__input::-webkit-outer-spin-button,
.fo-dtp-year__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fo-dtp-year__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: rgb(100 116 139);
  cursor: pointer;
}
.fo-dtp-year__step:hover {
  background: #fff;
  color: rgb(15 23 42);
}
.fo-dtp-year__step svg {
  width: 0.8rem;
  height: 0.8rem;
}
.fo-dtp-day--selected {
  background: #0f766e !important;
  color: #fff !important;
}
/* Hide native month select if vendor view slips through */
.fi-fo-date-time-picker-panel select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  background: rgb(248 250 252);
  padding: 0 0.5rem;
  height: 1.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}
html.dark .fo-dtp-month__trigger,
html.dark .fo-dtp-year {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(71 85 105);
  color: rgb(226 232 240);
}
html.dark .fo-dtp-month__panel {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
}
html.dark .fo-dtp-month__option {
  color: rgb(226 232 240);
}
html.dark .fo-dtp-month__option:hover {
  background: rgb(255 255 255 / 0.06);
}
html.dark .fo-dtp-year__input {
  color: rgb(226 232 240);
}

/* Filter / form selects — one border via .fi-input-wrp, not nested */
.fi-fo-select .choices {
  margin-bottom: 0;
}
.fi-fo-select .choices__inner {
  min-height: 2.25rem;
  padding: 0.25rem 2rem 0.25rem 0.75rem;
  border: none !important;
  border-radius: inherit !important;
  background-color: transparent !important;
  box-shadow: none !important;
  font-size: 0.875rem;
  color: rgb(51 65 85);
}
.fi-fo-select .choices__list--single {
  padding: 0;
}
.fi-fo-select .choices__list--single .choices__item {
  padding-inline: 0 !important;
  color: rgb(51 65 85);
}
.fi-fo-select .choices__placeholder {
  color: rgb(148 163 184);
  opacity: 1;
}
.fi-fo-select .choices[data-type*='select-one'] .choices__button {
  inset-inline-end: 1.65rem;
}
.fi-fo-select .choices__list--dropdown,
.fi-fo-select .choices__list[aria-expanded] {
  margin-top: 0.35rem;
  padding: 0 !important;
  border: 1px solid rgb(226 232 240) !important;
  border-radius: 0.75rem !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.12) !important;
  overflow: hidden;
}
/* Search row: same left inset as options, no nested box */
.fi-fo-select .choices__list--dropdown .choices__input,
.fi-fo-select .choices__list[aria-expanded] .choices__input,
.fi-fo-select .choices__list--dropdown .choices__input--cloned,
.fi-fo-select .choices__list[aria-expanded] .choices__input--cloned {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.65rem 0.75rem !important;
  border: 0 !important;
  border-bottom: 1px solid rgb(241 245 249) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  color: rgb(51 65 85) !important;
}
.fi-fo-select .choices__list--dropdown .choices__input::placeholder,
.fi-fo-select .choices__list[aria-expanded] .choices__input::placeholder,
.fi-fo-select .choices__list--dropdown .choices__input--cloned::placeholder,
.fi-fo-select .choices__list[aria-expanded] .choices__input--cloned::placeholder {
  color: rgb(148 163 184);
  opacity: 1;
}
.fi-fo-select .choices__list--dropdown .choices__list,
.fi-fo-select .choices__list[aria-expanded] .choices__list {
  padding: 0.25rem 0 !important;
}
.fi-fo-select .choices__list--dropdown .choices__item,
.fi-fo-select .choices__list[aria-expanded] .choices__item {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem;
  color: rgb(51 65 85);
}
.fi-fo-select .choices__list--dropdown .choices__item--selectable.is-highlighted,
.fi-fo-select .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgb(240 253 250) !important;
  color: rgb(15 118 110) !important;
}
.fi-fo-select .choices__input {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}
html.dark .fi-fo-select .choices__inner {
  color: rgb(226 232 240);
}
html.dark .fi-fo-select .choices__list--single .choices__item {
  color: rgb(226 232 240);
}
html.dark .fi-fo-select .choices__list--dropdown,
html.dark .fi-fo-select .choices__list[aria-expanded] {
  border-color: rgb(51 65 85) !important;
  background: rgb(15 23 42) !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35) !important;
}
html.dark .fi-fo-select .choices__list--dropdown .choices__input,
html.dark .fi-fo-select .choices__list[aria-expanded] .choices__input,
html.dark .fi-fo-select .choices__list--dropdown .choices__input--cloned,
html.dark .fi-fo-select .choices__list[aria-expanded] .choices__input--cloned {
  border-bottom-color: rgb(30 41 59) !important;
  color: rgb(226 232 240) !important;
}
html.dark .fi-fo-select .choices__list--dropdown .choices__item,
html.dark .fi-fo-select .choices__list[aria-expanded] .choices__item {
  color: rgb(226 232 240);
}
html.dark .fi-fo-select .choices__list--dropdown .choices__item--selectable.is-highlighted,
html.dark .fi-fo-select .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgb(13 148 136 / 0.2) !important;
  color: #5eead4 !important;
}

/* Match date inputs to select look inside Bitrix filter popup */
.fo-bx-ui-filter .fi-fo-date-time-picker .fi-input-wrp {
  min-height: 2.5rem;
}
.fo-bx-ui-filter .fi-fo-date-time-picker .fi-fo-date-time-picker-display-text-input {
  min-height: 2.5rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 2.5rem;
}
.fo-bx-ui-filter .fi-fo-date-time-picker .fi-input-wrp-suffix {
  color: rgb(100 116 139);
}
.fo-bx-ui-filter .fi-fo-date-time-picker .fi-input-wrp-suffix svg {
  width: 1rem;
  height: 1rem;
}

/* Trip filters: give date fields room for «дд.мм.гггг» */
.fi-ta-filters .fi-fo-date-time-picker {
  min-width: 9.5rem;
}
.fi-ta-filters .fi-fo-date-time-picker input {
  min-width: 0;
}

/* Date picker mobile: bottom sheet — no page scroll needed */
@media (max-width: 640px) {
  .fi-fo-date-time-picker:has(.fi-fo-date-time-picker-panel[style*='display: block']) .fi-fo-date-time-picker-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgb(15 23 42 / 0.35);
  }
  .fi-fo-date-time-picker-panel {
    position: fixed !important;
    inset: auto 12px 12px 12px !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    z-index: 90 !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(70vh, calc(100dvh - 24px)) !important;
    overflow: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 1rem !important;
  }
  .fi-fo-date-time-picker-panel [role='grid'] > [role='option'] {
    min-height: 2rem;
    width: 2rem;
    height: 2rem;
    line-height: 2rem !important;
  }
  .fo-dtp-month__trigger,
  .fo-dtp-year {
    height: 2.15rem;
    min-height: 2.15rem;
    max-height: 2.15rem;
  }
  .fo-dtp-month__label,
  .fo-dtp-year__input {
    line-height: 2.15rem;
  }
  .fo-dtp-year {
    width: 8.5rem;
    min-width: 8.5rem;
  }
  .fo-dtp-month__panel {
    max-height: 12rem;
  }
}

/* Mobile-friendly pick lists (contractor / address) */
.fo-pick-selected {
  margin-top: -0.35rem;
  margin-bottom: 0.25rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgb(153 246 228);
  border-radius: 0.75rem;
  background: rgb(240 253 250);
  color: rgb(15 118 110);
  font-size: 0.875rem;
  font-weight: 600;
}
html.dark .fo-pick-selected {
  border-color: rgb(13 148 136 / 0.45);
  background: rgb(13 148 136 / 0.18);
  color: #5eead4;
}
.fo-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem !important;
  margin-top: 0 !important;
}
.fo-pick-list.fi-fo-radio {
  gap: 0.4rem !important;
  margin-top: 0 !important;
}
.fo-pick-list > div {
  padding-top: 0 !important;
}
.fo-pick-list label {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  margin: 0 !important;
  padding: 0.65rem 0.85rem !important;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.fo-pick-list label span {
  color: rgb(15 23 42) !important;
  font-size: 0.875rem;
  font-weight: 500;
}
.fo-pick-list label:hover {
  border-color: rgb(94 234 212);
  background: rgb(240 253 250);
}
.fo-pick-list label:has(input:checked) {
  border-color: #0d9488;
  background: rgb(240 253 250);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.15);
}
.fo-pick-list label:has(input:checked) span {
  color: rgb(15 118 110) !important;
  font-weight: 600;
}
.fo-pick-list input[type='radio'] {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0 !important;
  accent-color: #0d9488;
}
html.dark .fo-pick-list label {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
}
html.dark .fo-pick-list label span {
  color: rgb(226 232 240) !important;
}
html.dark .fo-pick-list label:hover,
html.dark .fo-pick-list label:has(input:checked) {
  border-color: #0d9488;
  background: rgb(13 148 136 / 0.18);
}
html.dark .fo-pick-list label:has(input:checked) span {
  color: #5eead4 !important;
}

/* Remaining native controls in the panel */
.fi-main select:not(.choices__input):not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-position: right 0.55rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  padding-inline-end: 2rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.65rem;
  min-height: 2.25rem;
  color: rgb(51 65 85);
  font: inherit;
  font-size: 0.875rem;
}
.fi-main select:not(.choices__input):focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.18);
}
.fi-main input[type='file']::file-selector-button {
  margin-inline-end: 0.75rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.5rem;
  background: rgb(248 250 252);
  color: rgb(51 65 85);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.fi-main input[type='file']::file-selector-button:hover {
  background: #fff;
  border-color: rgb(148 163 184);
}
.fi-main input[type='number'] {
  -moz-appearance: textfield;
}
.fi-main input[type='number']::-webkit-outer-spin-button,
.fi-main input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* §7.1 Reporting table (expandable contractor rows) */
.fo-report {
  overflow: visible;
}
.fo-report__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem 0.65rem 1rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  color: rgb(15 23 42);
  font-size: 0.95rem;
  font-weight: 700;
}
.fo-report__title > span {
  min-width: 0;
}
.fo-report__scroll {
  overflow-x: auto;
  max-width: 100%;
}
.fo-report__table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8125rem;
}
.fo-report__col-expand {
  width: 1.5rem;
}
.fo-report__table th,
.fo-report__table td {
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid rgb(226 232 240);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgb(51 65 85);
}
.fo-report__table th {
  background: rgb(241 245 249);
  color: rgb(30 41 59);
  font-weight: 600;
  white-space: normal;
  line-height: 1.15;
  font-size: 0.75rem;
}
.fo-report__expand-col {
  width: 1.5rem;
  padding-inline: 0.15rem !important;
  text-align: center;
}
.fo-report__table td.fo-report__expand-col {
  text-align: center;
}
.fo-report__col-gear-host {
  text-align: center;
  vertical-align: middle;
}
.fo-report__col-gear-host .fo-bx-col-gear-wrap {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}
.fo-report__col-gear-host .fo-bx-col-gear.fo-bx-ui-filter__icon-btn {
  width: 1.5rem;
  height: 1.5rem;
}
.fo-report__empty {
  padding: 2.5rem 1rem !important;
  text-align: center !important;
  white-space: normal !important;
  color: rgb(100 116 139);
}
.fo-report__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: rgb(100 116 139);
  cursor: pointer;
}
.fo-report__toggle:hover {
  background: rgb(240 253 250);
  color: rgb(15 118 110);
}
.fo-report__toggle svg {
  width: 1rem;
  height: 1rem;
}
.fo-report__row--open > td {
  background: rgb(240 253 250);
}
.fo-report__row--header > td {
  background: rgb(226 232 240);
  font-weight: 700;
  color: rgb(15 23 42);
}
.fo-report__row--address > td {
  background: rgb(248 250 252);
}
.fo-report__row--address .fo-report__address {
  padding-left: 1rem;
}
.fo-report__address--meta {
  color: rgb(100 116 139);
  font-weight: 600;
}
.fo-report__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  overflow: visible;
}
.fo-report__toolbar .fo-bx-ui-filter {
  flex: 0 1 36rem;
  width: 100%;
  max-width: 36rem;
  min-width: 14rem;
  margin-right: auto;
}
.fo-report__toolbar .fo-ta-toolbar-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}
.fo-report__name {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-weight: 600;
  color: rgb(15 23 42);
}
/* Long text: one line + ellipsis; full text in native tooltip */
.fo-report__address,
.fo-report__document {
  max-width: 0;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fo-report__detail-row > td {
  padding: 0 !important;
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(203 213 225);
}
.fo-report__detail {
  padding: 0.75rem 1rem 1rem 2.5rem;
}
.fo-report__detail-summary {
  margin-bottom: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  background: rgb(226 232 240);
  color: rgb(30 41 59);
  font-size: 0.8125rem;
  font-weight: 600;
}
.fo-report__detail-empty {
  color: rgb(100 116 139);
  font-size: 0.8125rem;
}
.fo-report__weeks {
  width: 100%;
  max-width: 42rem;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.55rem;
  overflow: hidden;
}
.fo-report__weeks th,
.fo-report__weeks td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgb(241 245 249);
  text-align: left;
  font-size: 0.8125rem;
  color: rgb(51 65 85);
  vertical-align: top;
}
.fo-report__weeks th {
  background: rgb(241 245 249);
  font-weight: 600;
  white-space: nowrap;
}
.fo-report__weeks th:first-child,
.fo-report__weeks td:first-child {
  width: 7.5rem;
  white-space: nowrap;
}
.fo-report__weeks th:not(:first-child),
.fo-report__weeks td:not(:first-child) {
  width: auto;
  min-width: 5.5rem;
}
.fo-report__weeks td:not(:first-child) {
  /* Long cargo summaries wrap inside the cell; headers stay one line. */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fo-report__weeks tr:last-child td {
  border-bottom: 0;
}
html.dark .fo-report__title {
  border-bottom-color: rgb(51 65 85);
  background: rgb(15 23 42);
  color: rgb(226 232 240);
}
html.dark .fo-report__table th,
html.dark .fo-report__table td {
  border-bottom-color: rgb(51 65 85);
  color: rgb(203 213 225);
}
html.dark .fo-report__table th {
  background: rgb(30 41 59);
  color: rgb(226 232 240);
}
html.dark .fo-report__row--open > td {
  background: rgb(13 148 136 / 0.12);
}
html.dark .fo-report__row--header > td {
  background: rgb(30 41 59);
  color: rgb(226 232 240);
}
html.dark .fo-report__row--address > td {
  background: rgb(15 23 42);
}
html.dark .fo-report__address--meta {
  color: rgb(148 163 184);
}
html.dark .fo-report__name {
  color: rgb(248 250 252);
}
html.dark .fo-report__address {
  color: rgb(203 213 225);
}
html.dark .fo-report__detail-row > td {
  background: rgb(15 23 42);
  border-bottom-color: rgb(51 65 85);
}
html.dark .fo-report__detail-summary {
  background: rgb(30 41 59);
  color: rgb(226 232 240);
}
html.dark .fo-report__weeks {
  background: rgb(15 23 42);
  border-color: rgb(51 65 85);
}
html.dark .fo-report__weeks th,
html.dark .fo-report__weeks td {
  border-bottom-color: rgb(30 41 59);
  color: rgb(203 213 225);
}
html.dark .fo-report__weeks th {
  background: rgb(30 41 59);
}

/* Bitrix main.ui.filter-style: search row + anchored popup */
.fi-ta-ctn:has(.fo-bx-ui-filter),
.fi-section:has(.fo-bx-ui-filter),
.fi-ta-ctn:has(.fo-bx-ui-filter) .fi-ta-header-ctn,
.fi-ta-ctn:has(.fo-bx-ui-filter) .fi-ta-header-toolbar {
  overflow: visible !important;
}
.fo-bx-ui-filter {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 36rem;
  min-width: 14rem;
}
.fo-bx-ui-filter__search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border: 1px solid rgb(198 205 211);
  border-radius: 0.5rem;
  background: #fff;
  cursor: text;
  outline: none;
  box-shadow: none;
}
.fo-bx-ui-filter__search.is-open,
.fo-bx-ui-filter__search:focus-within {
  border-color: rgb(148 163 184);
  outline: none;
  box-shadow: none;
}
.fo-bx-ui-filter__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.fo-bx-ui-filter__input {
  flex: 1 1 8rem;
  min-width: 5rem;
  height: 2rem;
  border: 0;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  color: rgb(15 23 42);
  font: inherit;
  font-size: 0.9375rem;
}
.fo-bx-ui-filter__input:focus,
.fo-bx-ui-filter__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.fo-bx-ui-filter__input::placeholder {
  color: rgb(148 163 184);
}
.fo-bx-ui-filter__icons {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
}
.fo-bx-ui-filter__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: rgb(100 116 139);
  cursor: pointer;
}
.fo-bx-ui-filter__icon-btn:hover {
  background: rgb(241 245 249);
  color: rgb(15 23 42);
}
.fo-bx-ui-filter__icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}
.fo-bx-ui-filter__badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 9999px;
  background: rgb(13 148 136);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}
.fo-bx-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex: 0 1 auto;
  max-width: none;
  padding: 0.1rem 0.15rem 0.1rem 0.5rem;
  border: 0;
  border-radius: 0.35rem;
  background: rgb(204 251 241);
  color: rgb(15 118 110);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
}
.fo-bx-chip__text {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.fo-bx-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: rgb(13 148 136);
  cursor: pointer;
}
.fo-bx-chip__remove:hover {
  background: rgb(153 246 228);
}
.fo-bx-chip__remove svg {
  width: 0.85rem;
  height: 0.85rem;
}
.fo-bx-ui-filter__popup {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: auto;
  width: min(36rem, calc(100vw - 2.5rem));
  max-width: 100%;
  border: 1px solid rgb(198 205 211);
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.14);
  z-index: 50;
}
.fo-bx-ui-filter__popup-inner {
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.fo-bx-ui-filter__body {
  flex: 0 1 auto;
  overflow: visible;
}
.fo-bx-ui-filter__section {
  padding: 0.9rem 1rem 0.5rem;
}
.fo-bx-ui-filter__fields .fi-fo-component-ctn,
.fo-bx-ui-filter__columns .fi-fo-component-ctn {
  gap: 0.75rem !important;
}
/* Date row: Filament 12-col grid (mode full / mode+exact / mode+from+until) */
.fo-bx-ui-filter__fields .fo-bx-date-inline > .fi-fo-component-ctn {
  align-items: end;
  column-gap: 0.85rem !important;
  row-gap: 0.5rem !important;
}
.fo-bx-ui-filter__fields .fo-bx-date-from,
.fo-bx-ui-filter__fields .fo-bx-date-until {
  position: relative;
  min-width: 0;
  width: 100%;
}
.fo-bx-ui-filter__fields .fo-bx-date-from .fi-input-wrp,
.fo-bx-ui-filter__fields .fo-bx-date-until .fi-input-wrp,
.fo-bx-ui-filter__fields .fo-bx-date-from .fi-fo-date-time-picker,
.fo-bx-ui-filter__fields .fo-bx-date-until .fi-fo-date-time-picker {
  width: 100%;
}
/* Dash centered in the gap between from and until */
.fo-bx-ui-filter__fields .fo-bx-date-from::after {
  content: '—';
  position: absolute;
  top: 50%;
  left: calc(100% + 0.425rem);
  transform: translate(-50%, -50%);
  color: rgb(100 116 139);
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: none;
}
/* Mode select: keep one readable line */
.fo-bx-ui-filter .fo-bx-date-mode .choices__inner {
  display: block !important;
  overflow: hidden !important;
  min-height: 2.5rem;
  padding: 0 2rem 0 0.75rem !important;
  line-height: 2.5rem !important;
}
.fo-bx-ui-filter .fo-bx-date-mode .choices__list--single {
  display: block !important;
  width: 100%;
  padding: 0 !important;
  overflow: hidden;
}
.fo-bx-ui-filter .fo-bx-date-mode .choices__list--single .choices__item {
  display: block !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 2.5rem !important;
  padding: 0 !important;
  margin: 0 !important;
}
.fo-bx-ui-filter .fo-bx-date-mode .choices__placeholder {
  display: none !important;
}
.fo-bx-ui-filter .fo-bx-date-mode .choices[data-type*='select-one'] .choices__button {
  display: none !important;
}
.fo-bx-ui-filter .fo-bx-date-mode .choices[data-type*='select-one']::after {
  right: 0.65rem;
  margin-top: 0;
  top: 50%;
  transform: translateY(-50%);
}
.fo-bx-ui-filter__fields .fi-fo-field-wrp-label span,
.fo-bx-ui-filter__columns .fi-fo-field-wrp-label span {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: rgb(71 85 105) !important;
}
/* Vertically center Choices selected value inside filter selects */
.fo-bx-ui-filter .fi-fo-select .choices__inner {
  display: flex !important;
  align-items: center !important;
  min-height: 2.5rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1.25rem;
}
.fo-bx-ui-filter .fi-fo-select .choices__list--single {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 !important;
  line-height: 1.25rem;
}
.fo-bx-ui-filter .fi-fo-select .choices__list--single .choices__item {
  display: flex;
  align-items: center;
  line-height: 1.25rem;
  padding: 0 !important;
  margin: 0 !important;
}
.fo-bx-ui-filter .fi-fo-select .choices[data-type*='select-one']::after {
  margin-top: 0;
  top: 50%;
  transform: translateY(-50%);
  margin-bottom: 0;
}
.fo-bx-ui-filter__add {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.fo-bx-ui-filter__add-btn {
  border: 0;
  background: transparent;
  color: rgb(14 124 138);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.fo-bx-ui-filter__add-btn:hover {
  color: rgb(15 118 110);
  text-decoration: underline;
}
.fo-bx-ui-filter__fields-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  top: auto;
  z-index: 70;
  width: min(18rem, calc(100vw - 3rem));
  max-height: 16rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgb(198 205 211);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.12);
}
.fo-bx-ui-filter__columns,
.fo-bx-ui-filter__filter-toggles {
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.fo-bx-ui-filter__toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.15rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: rgb(51 65 85);
  cursor: pointer;
  user-select: none;
  border-radius: 0.35rem;
}
.fo-bx-ui-filter__toggle-row:hover {
  background: rgb(241 245 249);
}
.fo-bx-ui-filter__toggle-check:focus-visible {
  outline: 2px solid rgb(45 212 191);
  outline-offset: 2px;
}
.fo-bx-col-gear-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.fo-bx-col-gear-host--inline {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.fo-bx-col-gear.fo-bx-ui-filter__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: rgb(148 163 184);
}
.fo-bx-col-gear.fo-bx-ui-filter__icon-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}
.fo-bx-col-gear.fo-bx-ui-filter__icon-btn.is-active,
.fo-bx-col-gear.fo-bx-ui-filter__icon-btn:hover {
  color: rgb(100 116 139);
  background: rgb(241 245 249);
}
.fo-bx-col-gear__panel {
  position: fixed;
  z-index: 80;
  width: 15.5rem;
  max-height: min(22rem, calc(100vh - 2rem));
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(203 213 225);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}
.fo-bx-col-gear__title {
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(15 23 42);
}
.fo-bx-col-gear__form .fi-fo-component-ctn {
  gap: 0.35rem;
}
/* Filament column checkboxes in the gear panel */
.fo-bx-col-gear__form .fi-fo-checkbox {
  gap: 0.55rem;
}
.fo-bx-ui-filter__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  padding: 0.75rem 1rem 0.9rem;
  border-top: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  border-radius: 0 0 0.65rem 0.65rem;
  overflow: visible;
}
.fo-bx-ui-filter__footer--simple {
  justify-content: flex-end;
}
.fo-bx-ui-filter__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.fo-bx-ui-filter__find {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 0.4rem;
  background: rgb(14 124 138);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.fo-bx-ui-filter__find:hover {
  background: rgb(15 118 110);
}
.fo-bx-ui-filter__find svg {
  width: 1rem;
  height: 1rem;
}
.fo-bx-ui-filter__reset {
  border: 0;
  background: transparent;
  color: rgb(71 85 105);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.fo-bx-ui-filter__reset:hover {
  color: rgb(15 23 42);
  text-decoration: underline;
}
.fo-bx-ui-filter ~ .fi-ta-search-field,
.fi-ta-actions .fo-bx-col-toggle-hidden,
button.fo-bx-col-toggle-hidden {
  display: none !important;
}
html.dark .fo-bx-ui-filter__search {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
}
html.dark .fo-bx-ui-filter__search.is-open,
html.dark .fo-bx-ui-filter__search:focus-within {
  border-color: rgb(71 85 105);
  box-shadow: none;
}
html.dark .fo-bx-ui-filter__input {
  color: rgb(226 232 240);
}
html.dark .fo-bx-ui-filter__popup {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.4);
}
html.dark .fo-bx-ui-filter__footer {
  border-top-color: rgb(51 65 85);
  background: rgb(30 41 59);
}
html.dark .fo-bx-ui-filter__add-btn {
  color: rgb(45 212 191);
}
html.dark .fo-bx-ui-filter__fields-menu {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.35);
}
html.dark .fo-bx-col-gear__panel {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}
html.dark .fo-bx-col-gear__title {
  color: rgb(248 250 252);
}
html.dark .fo-bx-col-gear.fo-bx-ui-filter__icon-btn {
  color: rgb(148 163 184);
}
html.dark .fo-bx-col-gear.fo-bx-ui-filter__icon-btn.is-active,
html.dark .fo-bx-col-gear.fo-bx-ui-filter__icon-btn:hover {
  background: rgb(30 41 59);
  color: rgb(203 213 225);
}
html.dark .fo-bx-ui-filter__toggle-row {
  color: rgb(203 213 225);
}
html.dark .fo-bx-ui-filter__toggle-row:hover {
  background: rgb(30 41 59);
}
html.dark .fo-bx-chip {
  background: rgb(19 78 74 / 0.45);
  color: rgb(153 246 228);
}
html.dark .fo-bx-ui-filter__find {
  background: rgb(13 148 136);
}
@media (max-width: 1023px) {
  /* Filament mobile sidebar/backdrop use z-30; filter bar stays below topbar (z-20). */
  .fo-bx-ui-filter {
    z-index: 10;
  }
  .fo-bx-ui-filter__popup,
  .fo-bx-col-gear__panel {
    z-index: 35;
  }
}
@media (max-width: 640px) {
  .fo-bx-ui-filter {
    width: 100%;
  }
  .fo-bx-ui-filter__popup {
    /* Fixed panel below sticky topbar + iOS safe area (not over the header). */
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--fo-topbar-height, 4rem) + 0.35rem);
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: none;
    z-index: 35;

    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--fo-topbar-height, 4rem) - 1.25rem);
    overflow: auto;
  }

  .fo-bx-ui-filter__popup-inner {
    max-height: inherit;
  }

  .fo-bx-ui-filter__body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fo-bx-ui-filter__popup .fi-fo-date-time-picker input[type='date'],
  .fo-bx-ui-filter__popup .fi-input[type='date'],
  .fo-bx-report-date .fi-input[type='date'],
  .fo-bx-report-date input[type='date'] {
    min-height: 2.75rem;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    touch-action: manipulation;
  }
  .fo-bx-ui-filter__popup .fi-fo-date-time-picker > button {
    min-height: 2.75rem;
    touch-action: manipulation;
    cursor: pointer;
  }
  .fo-bx-ui-filter__popup:has(.fi-fo-date-time-picker-panel[style*='display: block']) {
    overflow: visible;
  }
  .fo-bx-ui-filter__popup-inner:has(.fi-fo-date-time-picker-panel[style*='display: block']),
  .fo-bx-ui-filter__body:has(.fi-fo-date-time-picker-panel[style*='display: block']) {
    overflow: visible;
  }
  .fo-bx-ui-filter__popup .fi-fo-date-time-picker-panel {
    z-index: 120 !important;
  }
  .fo-bx-ui-filter__popup .fi-fo-date-time-picker-backdrop {
    z-index: 115 !important;
  }
}

/* ===== Create trip (vyezd) — mockup-aligned ===== */
.fo-check,
.fo-bx-ui-filter__toggle-check,
.fo-bx-col-gear__form input[type='checkbox'],
.fo-vyezd-work input[type='checkbox'],
.fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox'],
.fi-fo-checkbox .fi-checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: none;
  flex-shrink: 0;
  border: 1.5px solid rgb(148 163 184);
  border-radius: 0.3rem;
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.fo-check:hover,
.fo-bx-ui-filter__toggle-check:hover,
.fo-bx-col-gear__form input[type='checkbox']:hover,
.fo-vyezd-work input[type='checkbox']:hover,
.fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox']:hover,
.fi-fo-checkbox .fi-checkbox-input:hover {
  border-color: rgb(13 148 136);
}
.fo-check:checked,
.fo-bx-ui-filter__toggle-check:checked,
.fo-bx-col-gear__form input[type='checkbox']:checked,
.fo-vyezd-work input[type='checkbox']:checked,
.fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox']:checked,
.fi-fo-checkbox .fi-checkbox-input:checked {
  border-color: rgb(13 148 136);
  background: rgb(13 148 136);
  color: #fff;
}
.fo-check:checked::before,
.fo-bx-ui-filter__toggle-check:checked::before,
.fo-bx-col-gear__form input[type='checkbox']:checked::before,
.fo-vyezd-work input[type='checkbox']:checked::before,
.fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox']:checked::before,
.fi-fo-checkbox .fi-checkbox-input:checked::before {
  content: '';
  width: 0.55rem;
  height: 0.32rem;
  margin-top: -0.1rem;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.fo-check:focus-visible,
.fi-fo-checkbox .fi-checkbox-input:focus-visible {
  outline: 2px solid rgb(45 212 191);
  outline-offset: 2px;
}

.fo-radio,
.fo-vyezd-addr-opt input[type='radio'],
.fo-vyezd-periodic-freq__opt input[type='radio'] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: none;
  flex-shrink: 0;
  border: 1.5px solid rgb(148 163 184);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.fo-radio:hover,
.fo-vyezd-addr-opt input[type='radio']:hover,
.fo-vyezd-periodic-freq__opt input[type='radio']:hover {
  border-color: rgb(13 148 136);
}
.fo-radio:checked,
.fo-vyezd-addr-opt input[type='radio']:checked,
.fo-vyezd-periodic-freq__opt input[type='radio']:checked {
  border-color: rgb(13 148 136);
  background: #fff;
  box-shadow: inset 0 0 0 3px rgb(13 148 136);
}
.fo-radio:focus-visible {
  outline: 2px solid rgb(45 212 191);
  outline-offset: 2px;
}

html.dark .fo-check,
html.dark .fo-bx-ui-filter__toggle-check,
html.dark .fo-bx-col-gear__form input[type='checkbox'],
html.dark .fo-vyezd-work input[type='checkbox'],
html.dark .fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox'],
html.dark .fi-fo-checkbox .fi-checkbox-input,
html.dark .fo-radio,
html.dark .fo-vyezd-addr-opt input[type='radio'],
html.dark .fo-vyezd-periodic-freq__opt input[type='radio'] {
  border-color: rgb(100 116 139);
  background: rgb(15 23 42);
}
html.dark .fo-check:hover,
html.dark .fo-bx-ui-filter__toggle-check:hover,
html.dark .fo-bx-col-gear__form input[type='checkbox']:hover,
html.dark .fo-vyezd-work input[type='checkbox']:hover,
html.dark .fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox']:hover,
html.dark .fi-fo-checkbox .fi-checkbox-input:hover,
html.dark .fo-radio:hover,
html.dark .fo-vyezd-addr-opt input[type='radio']:hover,
html.dark .fo-vyezd-periodic-freq__opt input[type='radio']:hover {
  border-color: rgb(45 212 191);
}
html.dark .fo-check:checked,
html.dark .fo-bx-ui-filter__toggle-check:checked,
html.dark .fo-bx-col-gear__form input[type='checkbox']:checked,
html.dark .fo-vyezd-work input[type='checkbox']:checked,
html.dark .fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox']:checked,
html.dark .fi-fo-checkbox .fi-checkbox-input:checked {
  border-color: rgb(13 148 136);
  background: rgb(13 148 136);
}
html.dark .fo-radio:checked,
html.dark .fo-vyezd-addr-opt input[type='radio']:checked,
html.dark .fo-vyezd-periodic-freq__opt input[type='radio']:checked {
  border-color: rgb(45 212 191);
  background: rgb(15 23 42);
  box-shadow: inset 0 0 0 3px rgb(45 212 191);
}

/* Clickable date field trigger */
.fo-date-field .fi-input-wrp {
  cursor: pointer;
  position: relative;
  border-radius: 10px !important;
  border: 1.5px solid var(--fo-v-line-strong, #cfd8e3) !important;
  background: #f8fbfa !important;
  box-shadow: none !important;
  padding-inline-end: 2.35rem;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}
.fo-date-field .fi-input-wrp:hover {
  border-color: var(--fo-v-accent, rgb(13 148 136)) !important;
  background: var(--fo-v-accent-soft, #e8f5f0) !important;
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.1) !important;
}
.fo-date-field .fi-input-wrp:focus-within {
  border-color: var(--fo-v-accent, rgb(13 148 136)) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px var(--fo-v-accent-soft, #e8f5f0) !important;
}
.fo-date-field .fi-input-wrp-prefix {
  border-right: 1px solid rgb(13 148 136 / 0.12);
  margin-right: 0.15rem;
  padding-right: 0.55rem;
}
.fo-date-field .fi-input-wrp-icon {
  color: var(--fo-v-accent-ink, rgb(15 118 110)) !important;
}
.fo-date-field .fi-fo-date-time-picker {
  width: 100%;
  max-width: none;
}
.fo-date-field .fi-fo-date-time-picker > button {
  width: 100%;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 2.5rem;
}
.fo-date-field .fi-fo-date-time-picker-display-text-input {
  pointer-events: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--fo-v-ink, #17233b);
}
.fo-date-field .fi-fo-date-time-picker-display-text-input::placeholder {
  font-weight: 400;
  color: var(--fo-v-muted, #7b8798);
}
.fo-date-field .fi-input-wrp::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--fo-v-accent-ink, rgb(15 118 110));
  border-bottom: 2px solid var(--fo-v-accent-ink, rgb(15 118 110));
  transform: translateY(-65%) rotate(45deg);
  opacity: 0.72;
  pointer-events: none;
}

.fo-vyezd {
  --fo-v-bg: #f3f5f9;
  --fo-v-surface: #fff;
  --fo-v-line: #e4e9f0;
  --fo-v-line-strong: #cfd8e3;
  --fo-v-ink: #17233b;
  --fo-v-ink-2: #43526b;
  --fo-v-muted: #7b8798;
  --fo-v-accent: rgb(13 148 136);
  --fo-v-accent-ink: rgb(15 118 110);
  --fo-v-accent-soft: #e8f5f0;
  --fo-v-r: 10px;
  width: 100%;
  max-width: none;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-page-header,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-page-header,
.fi-resource-create-record-page:has(.fo-vyezd) .fi-header,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-header {
  max-width: none;
  width: 100%;
}
.fo-vyezd .fi-section {
  border: 1px solid var(--fo-v-line);
  border-radius: var(--fo-v-r);
  box-shadow: 0 1px 2px rgba(23, 35, 59, 0.05), 0 1px 12px rgba(23, 35, 59, 0.04);
}
.fo-vyezd .fi-section-content-ctn {
  padding: 1.15rem 1.25rem;
}
.fo-vyezd .fi-fo-field-wrp-label span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink-2);
}
.fo-vyezd .fi-fo-toggle-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fo-vyezd .fi-fo-toggle-buttons .fi-btn {
  border-radius: 8px !important;
  border: 1px solid var(--fo-v-line-strong) !important;
  background: #fff !important;
  color: var(--fo-v-ink-2) !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  padding: 0.55rem 1rem !important;
}
.fo-vyezd .fi-fo-toggle-buttons .fi-btn:hover {
  border-color: #a9b6c6 !important;
  color: var(--fo-v-ink) !important;
}
.fo-vyezd .fi-fo-toggle-buttons .fi-btn[aria-checked="true"],
.fo-vyezd .fi-fo-toggle-buttons label:has(input:checked) .fi-btn,
.fo-vyezd .fi-fo-toggle-buttons .fi-btn-color-primary {
  background: var(--fo-v-accent) !important;
  border-color: var(--fo-v-accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.3) !important;
}
.fo-vyezd-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--fo-v-muted);
}
/* Quiet «Периодический» marker — secondary, not a hero control */
.fo-vyezd-periodic {
  margin-top: -0.15rem;
  margin-bottom: 0.15rem;
}
.fo-vyezd-periodic .fi-fo-field-wrp-label,
.fo-vyezd-periodic .fi-fo-toggle-label,
.fo-vyezd-periodic label {
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: var(--fo-v-muted) !important;
}
.fo-vyezd-periodic .fi-fo-toggle {
  gap: 0.55rem;
}
.fo-vyezd-periodic button[role="switch"] {
  transform: scale(0.88);
  transform-origin: left center;
  opacity: 0.85;
}
.fo-vyezd-periodic-panel {
  margin: 0.35rem 0 0.85rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid var(--fo-v-line);
  border-radius: 10px;
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fo-vyezd-periodic-panel__content {
  display: block;
}
.fo-vyezd-periodic-end-field {
  margin-top: 0.85rem !important;
  padding-top: 0.9rem;
  border-top: 1px solid #eef1f5;
}
.fo-vyezd-periodic-end-field .fi-input[type='date'],
.fo-vyezd-periodic-end-field input[type='date'] {
  min-height: 2.75rem;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
}
.fo-vyezd-periodic-end-field .fi-fo-field-wrp-label span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink-2);
}
.fo-vyezd-periodic-end-field .fi-fo-field-wrp-hint {
  font-size: 0.75rem;
  color: var(--fo-v-muted);
  margin-top: 0.35rem;
}
.fo-vyezd-periodic-end-field .fi-fo-date-time-picker-panel {
  z-index: 50;
}
.fo-vyezd-periodic-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.fo-vyezd-periodic-panel__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink);
}
.fo-vyezd-periodic-panel__sub {
  font-size: 0.75rem;
  color: var(--fo-v-muted);
}
.fo-vyezd-periodic-freq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.fo-vyezd-periodic-freq__opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--fo-v-line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--fo-v-ink-2);
}
.fo-vyezd-periodic-freq__opt:hover { border-color: #a9b6c6; }
.fo-vyezd-periodic-freq__opt.is-on {
  border-color: var(--fo-v-accent);
  background: #fbfefd;
  box-shadow: inset 0 0 0 1px var(--fo-v-accent);
  color: var(--fo-v-ink);
  font-weight: 600;
}
.fo-vyezd-periodic-days__label,
.fo-vyezd-periodic-month__label,
.fo-vyezd-periodic-end__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink-2);
}
.fo-vyezd-periodic-days__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fo-vyezd-periodic-day {
  min-width: 2.4rem;
  border: 1px solid var(--fo-v-line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink-2);
  cursor: pointer;
}
.fo-vyezd-periodic-day:hover { border-color: #a9b6c6; }
.fo-vyezd-periodic-day.is-on {
  border-color: var(--fo-v-accent);
  background: var(--fo-v-accent-soft);
  color: var(--fo-v-accent-ink);
}
.fo-vyezd-periodic-hint {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--fo-v-muted);
}
.fo-vyezd-periodic-hint--monthly {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: rgb(240 253 250);
  color: rgb(15 118 110);
  line-height: 1.45;
}
.fo-vyezd-periodic-month { margin-bottom: 0.85rem; }
.fo-vyezd-periodic-month__select {
  width: 100%;
  max-width: 14rem;
  border: 1px solid var(--fo-v-line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--fo-v-ink);
  background: #fff;
}
.fo-vyezd-periodic-month { margin-bottom: 0.85rem; }
@media (max-width: 640px) {
  .fo-vyezd-periodic-freq { grid-template-columns: 1fr; }
}
.fo-vyezd-combo { position: relative; }
.fo-vyezd-combo__input-wrap { position: relative; }
.fo-vyezd-combo__ico {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--fo-v-ink);
  opacity: 0.55;
  pointer-events: none;
}
.fo-vyezd-combo__input {
  width: 100%;
  font: inherit;
  color: var(--fo-v-ink);
  background: #fff;
  border: 1px solid var(--fo-v-line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  outline: none;
}
.fo-vyezd-combo__input:focus {
  border-color: var(--fo-v-accent);
  box-shadow: 0 0 0 3px var(--fo-v-accent-soft);
}
.fo-vyezd-combo__results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--fo-v-line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(23, 35, 59, 0.13);
  max-height: 330px;
  overflow: auto;
  padding: 5px;
}
.fo-vyezd-combo__res {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font: inherit;
  color: inherit;
}
.fo-vyezd-combo__res:hover,
.fo-vyezd-combo__res.is-active {
  background: #f2f7f5;
}
.fo-vyezd-combo__badge {
  flex: none;
  align-self: center;
  line-height: 1.2;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: #eef1f6;
  color: #6a7789;
}
.fo-vyezd-combo__badge.is-addr {
  background: var(--fo-v-accent-soft);
  color: var(--fo-v-accent-ink);
}
.fo-vyezd-combo__txt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}
.fo-vyezd-combo__nm {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fo-v-ink);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fo-vyezd-combo__contract-inline {
  font-weight: 500;
  color: var(--fo-v-muted);
}
.fo-vyezd-combo__ad {
  display: block;
  font-size: 0.78rem;
  color: var(--fo-v-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fo-vyezd-combo__hl {
  background: #ffe59a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.fo-vyezd-combo__empty {
  padding: 1rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--fo-v-muted);
  text-align: center;
}
.fo-vyezd-combo__empty a {
  color: var(--fo-v-accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.fo-vyezd-picked {
  border: 1px solid var(--fo-v-line-strong);
  border-radius: 10px;
  overflow: hidden;
}
.fo-vyezd-picked__top {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.8rem 0.95rem;
  background: #fafcfb;
  border-bottom: 1px solid var(--fo-v-line);
}
.fo-vyezd-picked__name {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--fo-v-ink);
}
.fo-vyezd-picked__meta {
  font-size: 0.78rem;
  color: var(--fo-v-muted);
}
.fo-vyezd-linkbtn {
  font: inherit;
  font-size: 0.78rem;
  background: none;
  border: none;
  padding: 2px 0;
  color: var(--fo-v-accent-ink);
  cursor: pointer;
  font-weight: 600;
  flex: none;
}
.fo-vyezd-linkbtn:hover { text-decoration: underline; }
.fo-vyezd-picked__addr { padding: 0.8rem 0.95rem; }
.fo-vyezd-picked__addr-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fo-v-ink-2);
  margin-bottom: 0.5rem;
}
.fo-vyezd-addr-list { display: flex; flex-direction: column; gap: 0.4rem; }
.fo-vyezd-addr-opt {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--fo-v-line);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--fo-v-ink-2);
}
.fo-vyezd-addr-opt:hover { border-color: #a9b6c6; }
.fo-vyezd-addr-opt.is-on {
  border-color: var(--fo-v-accent);
  background: var(--fo-v-accent-soft);
  color: var(--fo-v-ink);
  font-weight: 500;
}
.fo-vyezd-addr-solo { font-size: 0.84rem; color: var(--fo-v-ink-2); }
.fo-vyezd-divider {
  height: 1px;
  background: var(--fo-v-line);
  margin: 0.25rem -1.25rem 1.15rem;
}
.fo-vyezd-dyn__head {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.fo-vyezd-dyn__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-v-ink);
}
.fo-vyezd-dyn__sub { font-size: 0.75rem; color: var(--fo-v-muted); }
.fo-vyezd-works { display: flex; flex-direction: column; gap: 0.5rem; }
.fo-vyezd-work {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--fo-v-line);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  margin: 0;
}
.fo-vyezd-work:hover { border-color: #a9b6c6; }
.fo-vyezd-work.is-on {
  border-color: var(--fo-v-accent);
  background: #fbfefd;
}
.fo-vyezd-work__name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fo-v-ink);
}
.fo-vyezd-work.is-on .fo-vyezd-work__name { font-weight: 600; }
.fo-vyezd-qty {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.fo-vyezd-qty button {
  width: 30px;
  height: 32px;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--fo-v-line-strong);
  color: var(--fo-v-ink-2);
  cursor: pointer;
  padding: 0;
}
.fo-vyezd-qty button:first-of-type { border-radius: 7px 0 0 7px; }
.fo-vyezd-qty button:last-of-type { border-radius: 0 7px 7px 0; }
.fo-vyezd-qty button:hover {
  background: #f2f7f5;
  color: var(--fo-v-accent-ink);
}
.fo-vyezd-qty input[type="number"] {
  width: 52px;
  height: 32px;
  text-align: center;
  padding: 0;
  border-radius: 0;
  border: 1px solid var(--fo-v-line-strong);
  border-left: none;
  border-right: none;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font: inherit;
  color: var(--fo-v-ink);
  background: #fff;
}
.fo-vyezd-qty__un {
  font-size: 0.75rem;
  color: var(--fo-v-muted);
  margin-left: 0.55rem;
  width: 22px;
}
.fo-vyezd-qty--volume {
  gap: 0;
}
.fo-vyezd-qty__volume {
  width: 72px !important;
  border-radius: 7px !important;
  border-left: 1px solid var(--fo-v-line-strong) !important;
  border-right: 1px solid var(--fo-v-line-strong) !important;
}
.fo-vyezd-qty--volume .fo-vyezd-qty__un {
  width: auto;
  min-width: 22px;
}
.fo-vyezd-cargo {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.fo-vyezd-cargo__name {
  flex: 1;
  font: inherit;
  color: var(--fo-v-ink);
  background: #fff;
  border: 1px solid var(--fo-v-line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  outline: none;
}
.fo-vyezd-cargo__name:focus {
  border-color: var(--fo-v-accent);
  box-shadow: 0 0 0 3px var(--fo-v-accent-soft);
}

/* Create trip/contractor — one card + footer (same as fo-user) */
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form {
  gap: 0 !important;
  row-gap: 0 !important;
  column-gap: 0 !important;
  background: #fff !important;
  border: 1px solid #e4e9f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(23, 35, 59, 0.05), 0 1px 12px rgba(23, 35, 59, 0.04) !important;
  /* visible: date picker panels near the bottom of the form must not be clipped */
  overflow: visible !important;
}
.fo-vyezd-periodic-panel {
  overflow: visible;
  position: relative;
  z-index: 1;
}
.fo-vyezd-periodic-end-field {
  position: relative;
  z-index: 2;
}

/* Rental tasks: close button under table body (tfoot), pagination untouched */
.fi-ta-table tfoot:has(.fo-rental-close-selected) {
  background: #fff !important;
  border-top: 1px solid rgb(226 232 240);
}
html.dark .fi-ta-table tfoot:has(.fo-rental-close-selected) {
  background: rgb(17 24 39) !important;
  border-top-color: rgb(51 65 85);
}
.fo-rental-close-selected {
  padding: 0.75rem 1rem !important;
  text-align: left !important;
  vertical-align: middle !important;
}
@media (min-width: 640px) {
  .fo-rental-close-selected {
    padding-inline: 1.5rem !important;
  }
}
.fo-rental-close-selected__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgb(13 148 136);
  border-radius: 0.55rem;
  background: rgb(240 253 250);
  color: rgb(15 118 110);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.fo-rental-close-selected__btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.fo-rental-close-selected__btn:hover:not(:disabled) {
  background: rgb(13 148 136);
  color: #fff;
}
.fo-rental-close-selected__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgb(148 163 184);
  background: rgb(248 250 252);
  color: rgb(100 116 139);
}
html.dark .fo-rental-close-selected__btn {
  background: rgb(19 78 74);
  border-color: rgb(45 212 191);
  color: rgb(153 246 228);
}
html.dark .fo-rental-close-selected__btn:hover:not(:disabled) {
  background: rgb(13 148 136);
  color: #fff;
}
html.dark .fo-rental-close-selected__btn:disabled {
  background: rgb(30 41 59);
  border-color: rgb(71 85 105);
  color: rgb(148 163 184);
}
/* Hide Filament toolbar bulk actions — footer button is the only control */
.fi-ta-ctn:has(.fo-rental-close-selected) .fi-ta-header-toolbar .fi-ta-actions {
  display: none !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form > .fi-fo-component-ctn,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form > .fi-fo-component-ctn {
  gap: 0 !important;
  row-gap: 0 !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-content-ctn > .fi-fo-component-ctn,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section-content-ctn > .fi-fo-component-ctn {
  gap: 1.15rem !important;
  row-gap: 1.15rem !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-grid,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-grid {
  gap: 1rem 1.25rem !important;
}
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fo-vyezd-divider {
  height: 1px;
  margin: 0.35rem 0 0.25rem;
  background: #e4e9f0;
}
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fo-kontr-addr {
  margin-top: 0.85rem;
  padding-top: 1.1rem;
  border-top: 1px solid #eef1f5;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd,
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd > *,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr > * {
  margin: 0 !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section,
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-content-ctn,
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-header,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section-content-ctn,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section-header {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-content-ctn,
.fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section-content-ctn {
  padding: 1.25rem 1.25rem 1.1rem !important;
}

.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions {
  position: relative !important;
  z-index: 1;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.9rem 1.25rem !important;
  display: block !important;
  background: #fbfcfd !important;
  backdrop-filter: none !important;
  border: 0 !important;
  border-top: 1px solid #e4e9f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-ac,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-ac,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-ac,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-ac {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  width: 100%;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn {
  border-radius: 8px !important;
  padding: 0.55rem 1.15rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary {
  background: #fff !important;
  color: #43526b !important;
  border: 1px solid #cfd8e3 !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover {
  border-color: #a9b6c6 !important;
  background: #fff !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-primary,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-primary,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-primary,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-primary {
  background: #0e8a68 !important;
  border: 1px solid #0e8a68 !important;
  color: #fff !important;
}
.fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-primary:hover,
.fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-primary:hover,
.fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-primary:hover,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-primary:hover {
  background: #0a6b51 !important;
  border-color: #0a6b51 !important;
}

/* Widen create pages + drop duplicate footer line under actions */
.fi-main:has(.fo-vyezd),
.fi-main:has(.fo-kontr),
.fi-main:has(.fo-user) {
  max-width: 90rem !important; /* ~1440px, шире стандартного 7xl */
}
.fi-main-ctn:has(.fo-vyezd) > .fi-footer,
.fi-main-ctn:has(.fo-kontr) > .fi-footer,
.fi-main-ctn:has(.fo-user) > .fi-footer,
body:has(.fo-vyezd) .fi-footer,
body:has(.fo-kontr) .fi-footer,
body:has(.fo-user) .fi-footer {
  border-top: 0;
}
@media (max-width: 720px) {
  .fo-vyezd-cargo { flex-wrap: wrap; }
  .fo-vyezd-cargo__name { flex-basis: 100%; }
}

.fo-vyezd-cargo-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.fo-vyezd-cargo__remove {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--fo-v-line-strong, #cfd8e3);
  border-radius: 8px;
  background: #fff;
  color: #7b8798;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.fo-vyezd-cargo__add {
  align-self: flex-start;
  margin-top: 0.25rem;
  border: 1px dashed var(--fo-v-line-strong, #cfd8e3);
  border-radius: 8px;
  background: transparent;
  color: var(--fo-v-accent-ink, rgb(15 118 110));
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

@media (max-width: 1023px) {
  .fi-wi-stats-overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .fi-wi-table-widget .fi-ta-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Report: horizontal scroll + capped text columns (no full-width addresses). */
  .fo-report__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .fo-report__table {
    width: max-content;
    min-width: 52rem;
    max-width: none;
    table-layout: fixed;
  }
  .fo-report__table col:not(.fo-report__col-expand) {
    width: 7.5rem !important;
  }
  .fo-report__table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fo-report__table th,
  .fo-report__table td {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fo-report__name {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
    max-width: 10rem;
  }
  .fo-report__address,
  .fo-report__document {
    max-width: 11rem;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .fi-wi-stats-overview-stats {
    grid-template-columns: 1fr !important;
  }
  .fo-vyezd-periodic-freq {
    grid-template-columns: 1fr !important;
  }
}

/* ===== Create contractor (kontragent) ===== */
.fo-kontr {
  --fo-k-line: #e4e9f0;
  --fo-k-line-strong: #cfd8e3;
  --fo-k-ink: #17233b;
  --fo-k-ink-2: #43526b;
  --fo-k-muted: #7b8798;
  --fo-k-accent: rgb(13 148 136);
  --fo-k-accent-ink: rgb(15 118 110);
  --fo-k-accent-soft: #e8f5f0;
  --fo-k-req: #d0453f;
  width: 100%;
  max-width: none;
}
.fi-resource-create-record-page:has(.fo-kontr) .fi-page-header,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-page-header,
.fi-resource-create-record-page:has(.fo-kontr) .fi-header,
.fi-resource-edit-record-page:has(.fo-kontr) .fi-header {
  max-width: none;
  width: 100%;
}
.fo-kontr .fi-section {
  border: 1px solid var(--fo-k-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(23, 35, 59, 0.05), 0 1px 12px rgba(23, 35, 59, 0.04);
}
.fo-kontr .fi-section-content-ctn {
  padding: 1.15rem 1.25rem;
}
.fo-kontr .fo-vyezd-divider {
  background: var(--fo-k-line);
  margin: 0.25rem -1.25rem 1.15rem;
}
.fo-kontr .fi-fo-field-wrp-label span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-k-ink-2);
}
.fo-kontr-num { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.fo-kontr-sec-head {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.fo-kontr-sec-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-k-ink);
}
.fo-kontr-sec-sub { font-size: 0.75rem; color: var(--fo-k-muted); }
.fo-kontr-hint {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.75rem;
  color: var(--fo-k-muted);
}
.fo-kontr-hint--error { color: var(--fo-k-req); }
.fo-kontr-addr__grid {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 400px);
  gap: 1.25rem;
  align-items: start;
}
.fo-kontr-geo { position: relative; margin-bottom: 0.85rem; }
.fo-kontr-geo__ico {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  opacity: 0.55;
  pointer-events: none;
  color: var(--fo-k-ink);
}
.fo-kontr-geo__input {
  width: 100%;
  font: inherit;
  color: var(--fo-k-ink);
  background: #fff;
  border: 1px solid var(--fo-k-line-strong);
  border-radius: 8px;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  outline: none;
}
.fo-kontr-geo__input:focus {
  border-color: var(--fo-k-accent);
  box-shadow: 0 0 0 3px var(--fo-k-accent-soft);
}
.fo-kontr-geo__sugg {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--fo-k-line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(23, 35, 59, 0.13);
  max-height: 250px;
  overflow: auto;
  padding: 5px;
}
.fo-kontr-geo__sg {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.84rem;
  color: var(--fo-k-ink-2);
  cursor: pointer;
  line-height: 1.35;
}
.fo-kontr-geo__sg:hover,
.fo-kontr-geo__sg.is-active {
  background: #f2f7f5;
  color: var(--fo-k-ink);
}
.fo-kontr-geo__empty {
  padding: 0.85rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--fo-k-muted);
  text-align: center;
  line-height: 1.5;
}
.fo-kontr-alist { display: flex; flex-direction: column; gap: 0.5rem; }
.fo-kontr-aitem {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border: 1px solid var(--fo-k-line);
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  transition: 0.12s;
}
.fo-kontr-aitem:hover,
.fo-kontr-aitem.is-hot {
  border-color: var(--fo-k-accent);
  background: #fbfefd;
}
.fo-kontr-pin-n {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--fo-k-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.fo-kontr-at { flex: 1; min-width: 0; }
.fo-kontr-atx {
  display: block;
  font-size: 0.84rem;
  color: var(--fo-k-ink);
  line-height: 1.35;
}
.fo-kontr-acd {
  display: block;
  font-size: 0.72rem;
  color: var(--fo-k-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.fo-kontr-del {
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  color: #a9b6c6;
  line-height: 0;
}
.fo-kontr-del:hover {
  color: var(--fo-k-req);
  background: #fdf1f0;
}
.fo-kontr-aempty {
  border: 1px dashed var(--fo-k-line-strong);
  border-radius: 9px;
  padding: 1.1rem 0.85rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--fo-k-muted);
  line-height: 1.5;
}
.fo-kontr-mapbox {
  position: relative;
  border: 1px solid var(--fo-k-line-strong);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #eaf0ea;
}
.fo-kontr-map { width: 100%; height: 100%; min-height: 240px; }
.fo-kontr-maptip {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 500;
  background: rgba(23, 35, 59, 0.82);
  color: #fff;
  font-size: 0.72rem;
  padding: 5px 9px;
  border-radius: 6px;
  pointer-events: none;
}
.fo-kontr-mapctl {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 500;
  display: flex;
  gap: 8px;
}
.fo-kontr-mapbtn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--fo-k-line-strong);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
  color: var(--fo-k-ink-2);
  box-shadow: 0 1px 4px rgba(23, 35, 59, 0.12);
}
.fo-kontr-mapbtn:hover {
  color: var(--fo-k-accent-ink);
  border-color: var(--fo-k-accent);
}
.fo-kontr-mapbtn:disabled { opacity: 0.65; cursor: wait; }
.fo-kontr-attr {
  position: absolute;
  right: 6px;
  bottom: 5px;
  z-index: 500;
  font-size: 10px;
  color: #7b8798;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 5px;
  border-radius: 4px;
}
.fo-kontr-attr a { color: inherit; }
.fo-kontr-leaflet-pin { background: transparent !important; border: 0 !important; }
.fo-kontr-leaflet-pin__inner {
  width: 26px;
  height: 34px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='34' viewBox='0 0 26 34'><path d='M13 0C5.8 0 0 5.8 0 13c0 9.7 13 21 13 21s13-11.3 13-21C26 5.8 20.2 0 13 0z' fill='%230d9488'/></svg>") center / contain no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  filter: drop-shadow(0 2px 3px rgba(23, 35, 59, 0.35));
}
.fo-kontr-leaflet-pin__inner span {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.fo-kontr-leaflet-pin.is-hot .fo-kontr-leaflet-pin__inner {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='34' viewBox='0 0 26 34'><path d='M13 0C5.8 0 0 5.8 0 13c0 9.7 13 21 13 21s13-11.3 13-21C26 5.8 20.2 0 13 0z' fill='%2317233b'/></svg>");
}
@media (max-width: 820px) {
  .fo-kontr-addr__grid { grid-template-columns: 1fr; }
  .fo-kontr-mapbox { aspect-ratio: 4 / 3; }
}


/* ===== Create user — one continuous card (fields + actions) ===== */
.fo-user {
  --fo-u-line: #e4e9f0;
  --fo-u-line-strong: #cfd8e3;
  --fo-u-ink: #17233b;
  --fo-u-ink-2: #43526b;
  --fo-u-muted: #7b8798;
  --fo-u-accent: #0e8a68;
  --fo-u-accent-ink: #0a6b51;
  --fo-u-accent-soft: #e8f5f0;
  width: 100%;
  max-width: none;
}
.fi-resource-create-record-page:has(.fo-user) .fi-page-header,
.fi-resource-create-record-page:has(.fo-user) .fi-header {
  max-width: none;
  width: 100%;
}

/* Outer shell wraps fields + buttons as ONE card */
.fi-resource-create-record-page:has(.fo-user) .fi-form {
  gap: 0 !important;
  row-gap: 0 !important;
  column-gap: 0 !important;
  background: #fff !important;
  border: 1px solid #e4e9f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(23, 35, 59, 0.05), 0 1px 12px rgba(23, 35, 59, 0.04) !important;
  overflow: hidden !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form > .fi-fo-component-ctn {
  gap: 0 !important;
  row-gap: 0 !important;
}
.fi-resource-create-record-page:has(.fo-user) .fo-user .fi-section-content-ctn > .fi-fo-component-ctn {
  gap: 1.15rem !important;
  row-gap: 1.15rem !important;
}
.fi-resource-create-record-page:has(.fo-user) .fo-user,
.fi-resource-create-record-page:has(.fo-user) .fo-user > * {
  margin: 0 !important;
}

/* Inner section: no own frame */
.fi-resource-create-record-page:has(.fo-user) .fo-user .fi-section,
.fi-resource-create-record-page:has(.fo-user) .fo-user .fi-section-content-ctn,
.fi-resource-create-record-page:has(.fo-user) .fo-user .fi-section-header {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
}
.fi-resource-create-record-page:has(.fo-user) .fo-user .fi-section-content-ctn {
  padding: 1.25rem 1.25rem 1.1rem !important;
}
.fo-user .fi-fo-field-wrp-label span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fo-u-ink-2);
}
.fo-user .fi-fo-field-wrp-hint {
  font-size: 0.75rem;
  color: var(--fo-u-muted);
}
.fo-user-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 0.875rem !important;
  letter-spacing: 0.02em;
}

/* Role cards */
.fo-user-roles .fi-fo-checkbox-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  row-gap: 12px !important;
  column-gap: 12px !important;
  margin-top: 0 !important;
  column-count: 1 !important;
}
.fo-user-roles .fi-fo-checkbox-list > div {
  padding-top: 0 !important;
  margin: 0 !important;
  break-inside: avoid !important;
  height: 100%;
  min-width: 0;
}
.fo-user-roles .fi-fo-checkbox-list-option-label {
  display: flex !important;
  height: 100%;
  min-height: 5.75rem;
  align-items: flex-start;
  gap: 0.7rem;
  border: 1px solid var(--fo-u-line);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
  box-sizing: border-box;
}
.fo-user-roles .fi-fo-checkbox-list-option-label input[type='checkbox'] {
  margin-top: 0.15rem;
}
.fo-user-roles .fi-fo-checkbox-list-option-label:hover { border-color: #a9b6c6; }
.fo-user-roles .fi-fo-checkbox-list-option-label:has(input:checked) {
  border-color: var(--fo-u-accent);
  background: #fbfefd;
  box-shadow: inset 0 0 0 1px var(--fo-u-accent);
}
.fo-user-roles .fi-fo-checkbox-list-option-label > div { min-width: 0; flex: 1; }
.fo-user-role__name {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem;
  margin-bottom: 0.15rem; font-size: 0.875rem; font-weight: 600;
  color: var(--fo-u-ink); line-height: 1.3;
}
.fo-user-chan {
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.12rem 0.4rem; border-radius: 4px; background: #eef1f6; color: #6a7789;
}
.fo-user-chan--app { background: #eaf0fb; color: #3c5a99; }
.fo-user-chan--web { background: var(--fo-u-accent-soft); color: var(--fo-u-accent-ink); }
.fo-user-roles .fi-fo-checkbox-list-option-description {
  margin-top: 0.15rem; font-size: 0.78rem !important; line-height: 1.4; color: var(--fo-u-muted) !important;
}
.fo-user-sec-head { display: flex; align-items: baseline; gap: 0.65rem; margin: 0.35rem 0 0.5rem; }
.fo-user-sec-title { font-size: 0.8125rem; font-weight: 600; color: var(--fo-u-ink); }
.fo-user-sec-sub { font-size: 0.75rem; color: var(--fo-u-muted); }
.fo-user-creds {
  margin-top: 0.5rem; border: 1px dashed var(--fo-u-line-strong); border-radius: 10px;
  padding: 0.85rem 0.95rem; display: flex; align-items: center; gap: 0.9rem; background: #fbfcfd;
}
.fo-user-creds__body { flex: 1; min-width: 0; }
.fo-user-creds__label { font-size: 0.75rem; color: var(--fo-u-muted); margin-bottom: 0.25rem; }
.fo-user-creds__value {
  font-size: 0.84rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--fo-u-ink); word-break: break-all;
}
.fo-user-iconbtn {
  font: inherit; font-size: 0.8125rem; background: #fff; border: 1px solid var(--fo-u-line-strong);
  border-radius: 8px; padding: 0.45rem 0.75rem; cursor: pointer; color: var(--fo-u-ink-2);
  white-space: nowrap; flex: none;
}
.fo-user-iconbtn:hover { border-color: var(--fo-u-accent); color: var(--fo-u-accent-ink); }

/* Footer: inside same card, only a top divider — no second outline */
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions {
  position: relative !important;
  z-index: 1;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.9rem 1.25rem !important;
  display: block !important;
  background: #fbfcfd !important;
  backdrop-filter: none !important;
  border: 0 !important;
  border-top: 1px solid #e4e9f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-ac {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  width: 100%;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn {
  border-radius: 8px !important;
  padding: 0.55rem 1.15rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-user-btn-secondary):not(.fo-create-btn-secondary),
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-user-btn-secondary,
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-create-btn-secondary {
  background: #fff !important;
  color: #43526b !important;
  border: 1px solid #cfd8e3 !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-user-btn-secondary):not(.fo-create-btn-secondary):hover,
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-user-btn-secondary:hover,
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover {
  border-color: #a9b6c6 !important;
  background: #fff !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-primary {
  background: #0e8a68 !important;
  border: 1px solid #0e8a68 !important;
  color: #fff !important;
}
.fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-primary:hover {
  background: #0a6b51 !important;
  border-color: #0a6b51 !important;
}

@media (max-width: 760px) {
  .fo-user-roles .fi-fo-checkbox-list { grid-template-columns: 1fr !important; }
  .fo-user-creds { flex-direction: column; align-items: stretch; }
  .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn,
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn { flex: 1 1 auto; }
}

/* ===== Dark theme: create/edit forms (kontr / vyezd / user) ===== */
html.dark .fo-kontr {
  --fo-k-line: rgb(51 65 85);
  --fo-k-line-strong: rgb(71 85 105);
  --fo-k-ink: rgb(226 232 240);
  --fo-k-ink-2: rgb(203 213 225);
  --fo-k-muted: rgb(148 163 184);
  --fo-k-accent-soft: rgb(19 78 74 / 0.45);
}
html.dark .fo-vyezd {
  --fo-v-bg: rgb(15 23 42);
  --fo-v-surface: rgb(15 23 42);
  --fo-v-line: rgb(51 65 85);
  --fo-v-line-strong: rgb(71 85 105);
  --fo-v-ink: rgb(226 232 240);
  --fo-v-ink-2: rgb(203 213 225);
  --fo-v-muted: rgb(148 163 184);
  --fo-v-accent-soft: rgb(19 78 74 / 0.45);
}
html.dark .fo-user {
  --fo-u-line: rgb(51 65 85);
  --fo-u-line-strong: rgb(71 85 105);
  --fo-u-ink: rgb(226 232 240);
  --fo-u-ink-2: rgb(203 213 225);
  --fo-u-muted: rgb(148 163 184);
  --fo-u-accent-soft: rgb(19 78 74 / 0.45);
}

html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form,
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form {
  background: rgb(15 23 42) !important;
  border-color: rgb(51 65 85) !important;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 1px 12px rgb(0 0 0 / 0.2) !important;
}

html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions,
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions {
  background: rgb(15 23 42) !important;
  border-top-color: rgb(51 65 85) !important;
}

html.dark .fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fo-vyezd-divider,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fo-kontr .fo-vyezd-divider,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fo-kontr-addr {
  background: transparent;
  border-top-color: rgb(51 65 85);
}

html.dark .fo-kontr .fi-fo-checkbox .fi-checkbox-input,
html.dark .fo-vyezd .fi-fo-checkbox .fi-checkbox-input,
html.dark .fo-user .fi-fo-checkbox .fi-checkbox-input {
  flex-shrink: 0;
  min-width: 1.05rem;
  min-height: 1.05rem;
  opacity: 1 !important;
  visibility: visible !important;
}

html.dark .fo-kontr .fi-input-wrp,
html.dark .fo-vyezd .fi-input-wrp,
html.dark .fo-user .fi-input-wrp {
  background-color: rgb(15 23 42) !important;
  --tw-ring-color: rgb(51 65 85) !important;
}
html.dark .fo-kontr .fi-input-wrp input,
html.dark .fo-kontr .fi-input-wrp textarea,
html.dark .fo-vyezd .fi-input-wrp input,
html.dark .fo-vyezd .fi-input-wrp textarea,
html.dark .fo-user .fi-input-wrp input,
html.dark .fo-user .fi-input-wrp textarea {
  color: rgb(226 232 240) !important;
  background: transparent !important;
}
html.dark .fo-kontr .fi-input-wrp input::placeholder,
html.dark .fo-vyezd .fi-input-wrp input::placeholder,
html.dark .fo-user .fi-input-wrp input::placeholder {
  color: rgb(100 116 139) !important;
}

html.dark .fo-kontr-geo__input,
html.dark .fo-vyezd-combo__input,
html.dark .fo-vyezd-cargo__name,
html.dark .fo-vyezd-qty input[type='number'],
html.dark .fo-vyezd-periodic-month__select {
  background: rgb(15 23 42) !important;
  border-color: rgb(71 85 105) !important;
  color: rgb(226 232 240) !important;
}
html.dark .fo-kontr-geo__sugg,
html.dark .fo-vyezd-combo__results {
  background: rgb(15 23 42) !important;
  border-color: rgb(51 65 85) !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35) !important;
}
html.dark .fo-kontr-geo__sg,
html.dark .fo-vyezd-combo__res {
  color: rgb(226 232 240);
}
html.dark .fo-kontr-geo__sg:hover,
html.dark .fo-kontr-geo__sg.is-active,
html.dark .fo-vyezd-combo__res:hover,
html.dark .fo-vyezd-combo__res.is-active {
  background: rgb(30 41 59) !important;
}
html.dark .fo-kontr-aitem,
html.dark .fo-kontr-aempty,
html.dark .fo-vyezd-work,
html.dark .fo-vyezd-addr-opt,
html.dark .fo-vyezd-periodic-freq__opt,
html.dark .fo-vyezd-periodic-day,
html.dark .fo-vyezd-picked,
html.dark .fo-vyezd-periodic-panel {
  background: rgb(15 23 42) !important;
  border-color: rgb(51 65 85) !important;
}
html.dark .fo-vyezd-picked__top {
  background: rgb(15 23 42) !important;
  border-bottom-color: rgb(51 65 85) !important;
}
html.dark .fo-vyezd-picked__name {
  color: rgb(226 232 240) !important;
}
html.dark .fo-vyezd-picked__meta,
html.dark .fo-vyezd-picked__addr-title,
html.dark .fo-vyezd-addr-solo {
  color: rgb(148 163 184) !important;
}
html.dark .fo-vyezd-linkbtn {
  color: rgb(45 212 191) !important;
}
html.dark .fo-kontr-aitem:hover,
html.dark .fo-kontr-aitem.is-hot,
html.dark .fo-vyezd-work:hover,
html.dark .fo-vyezd-work.is-on,
html.dark .fo-vyezd-addr-opt.is-on,
html.dark .fo-vyezd-periodic-freq__opt.is-on,
html.dark .fo-vyezd-periodic-day.is-on {
  border-color: rgb(45 212 191) !important;
  background: rgb(19 78 74 / 0.35) !important;
}
html.dark .fo-kontr-mapbox {
  border-color: rgb(51 65 85) !important;
}
html.dark .fo-kontr-mapbtn,
html.dark .fo-vyezd-qty button {
  background: rgb(15 23 42) !important;
  border-color: rgb(71 85 105) !important;
  color: rgb(203 213 225) !important;
}
html.dark .fo-vyezd .fi-fo-toggle-buttons .fi-btn {
  background: rgb(15 23 42) !important;
  border-color: rgb(51 65 85) !important;
  color: rgb(203 213 225) !important;
}
html.dark .fo-vyezd .fi-fo-toggle-buttons .fi-btn[aria-checked='true'],
html.dark .fo-vyezd .fi-fo-toggle-buttons label:has(input:checked) .fi-btn,
html.dark .fo-vyezd .fi-fo-toggle-buttons .fi-btn-color-primary {
  background: rgb(13 148 136) !important;
  border-color: rgb(13 148 136) !important;
  color: #fff !important;
}
html.dark .fo-vyezd-divider {
  background: rgb(51 65 85) !important;
}

html.dark .fo-user-roles .fi-fo-checkbox-list-option-label {
  background: rgb(15 23 42) !important;
  border-color: rgb(51 65 85) !important;
}
html.dark .fo-user-roles .fi-fo-checkbox-list-option-label:hover {
  border-color: rgb(100 116 139) !important;
}
html.dark .fo-user-roles .fi-fo-checkbox-list-option-label:has(input:checked) {
  background: rgb(19 78 74 / 0.35) !important;
  border-color: rgb(13 148 136) !important;
}
html.dark .fo-user-chan {
  background: rgb(30 41 59) !important;
  color: rgb(148 163 184) !important;
}
html.dark .fo-user-chan--app {
  background: rgb(30 58 138 / 0.35) !important;
  color: rgb(147 197 253) !important;
}
html.dark .fo-user-chan--web {
  background: rgb(19 78 74 / 0.45) !important;
  color: rgb(153 246 228) !important;
}
html.dark .fo-user-creds {
  background: rgb(15 23 42) !important;
  border-color: rgb(71 85 105) !important;
}
html.dark .fo-user-iconbtn {
  background: rgb(15 23 42) !important;
  border-color: rgb(71 85 105) !important;
  color: rgb(203 213 225) !important;
}

html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary),
html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary,
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-user-btn-secondary):not(.fo-create-btn-secondary),
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-user-btn-secondary,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-create-btn-secondary {
  background: rgb(15 23 42) !important;
  color: rgb(203 213 225) !important;
  border-color: rgb(71 85 105) !important;
}
html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-create-btn-secondary):hover,
html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
html.dark .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
html.dark .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fi-btn-color-gray:not(.fo-user-btn-secondary):not(.fo-create-btn-secondary):hover,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-user-btn-secondary:hover,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-form-actions .fi-btn.fo-create-btn-secondary:hover {
  background: rgb(30 41 59) !important;
  border-color: rgb(100 116 139) !important;
}

html.dark .fo-vyezd .fi-fo-select .choices__inner,
html.dark .fo-kontr .fi-fo-select .choices__inner,
html.dark .fo-user .fi-fo-select .choices__inner {
  color: rgb(226 232 240) !important;
}

html.dark .fi-resource-create-record-page:has(.fo-vyezd) .fi-fo-select .choices,
html.dark .fi-resource-create-record-page:has(.fo-kontr) .fi-fo-select .choices,
html.dark .fi-resource-create-record-page:has(.fo-user) .fi-fo-select .choices {
  min-height: 2.25rem;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== Mobile: list pages & tables ===== */
@media (max-width: 768px) {
  .fi-main-ctn .fi-main {
    padding-inline: 0.65rem;
  }

  .fi-header {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .fi-header-heading {
    font-size: 1.35rem;
  }
  .fi-header-actions {
    width: 100%;
    margin-inline-start: 0 !important;
  }
  .fi-header-actions .fi-ac-btn-action {
    flex: 1 1 auto;
    justify-content: center;
  }

  .fi-ta-ctn:has(.fo-bx-ui-filter) .fi-ta-content,
  .fi-ta-ctn:has(.fo-bx-ui-filter) > div:has(.fi-ta-table),
  .fi-resource-list-records-page .fi-ta-content {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
  }

  .fi-resource-list-records-page .fi-ta-ctn,
  .fi-ta-ctn:has(.fo-bx-ui-filter) {
    overflow: hidden;
  }

  .fi-resource-list-records-page .fi-ta-table,
  .fi-ta-ctn:has(.fo-bx-ui-filter) .fi-ta-table {
    min-width: 34rem;
    width: max-content;
  }

  .fi-ta-text-item-label {
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 14rem;
    display: inline-block;
    vertical-align: bottom;
  }

  .fi-ta-header-toolbar:has(.fo-bx-ui-filter) > .ms-auto {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .fi-ta-header-toolbar .fo-bx-ui-filter {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .fi-ta-header-toolbar .fo-ta-toolbar-actions {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .fo-bx-ui-filter__search {
    flex-wrap: wrap;
    min-height: auto;
    padding-block: 0.35rem;
  }
  .fo-bx-ui-filter__chips {
    flex: 1 1 100%;
    min-width: 0;
  }
  .fo-bx-chip {
    max-width: 100%;
  }
  .fo-bx-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
  }
  .fo-bx-ui-filter__input {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Keep filter visible while scrolling, but always below the topbar */
  .fi-ta-header-toolbar:has(.fo-bx-ui-filter),
  .fo-report__toolbar:has(.fo-bx-ui-filter) {
    position: sticky;
    top: calc(env(safe-area-inset-top, 0px) + var(--fo-topbar-height, 4rem));
    z-index: 15;
    background: #fff;
    padding-block: 0.35rem;
  }
  html.dark .fi-ta-header-toolbar:has(.fo-bx-ui-filter),
  html.dark .fo-report__toolbar:has(.fo-bx-ui-filter) {
    background: rgb(17 24 39);
  }

  /* Profile menu: keep inside viewport on narrow screens */
  .fi-dropdown-panel:has(.fi-theme-switcher) {
    width: min(14rem, calc(100vw - 1rem)) !important;
    max-width: min(14rem, calc(100vw - 1rem)) !important;
  }

  /* Reporting: horizontal scroll instead of squashed columns */
  .fo-report__card {
    overflow: hidden;
  }
  .fo-report__title {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .fo-report__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
  }
  .fo-report__table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  .fo-report__table th,
  .fo-report__table td {
    min-width: 4.25rem;
    max-width: none;
  }
  .fo-report__table th {
    white-space: nowrap;
    font-size: 0.72rem;
  }
  .fo-report__address,
  .fo-report__document {
    max-width: none;
    min-width: 7.5rem;
  }
  .fo-report__name {
    min-width: 6.5rem;
  }
  .fo-report__detail {
    padding-inline: 0.85rem;
    padding-left: 1rem;
  }
  .fo-report__weeks {
    max-width: none;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Create trip / contractor: consistent full-width fields */
  .fi-main:has(.fo-vyezd),
  .fi-main:has(.fo-kontr) {
    max-width: none !important;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-content-ctn,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fo-vyezd .fi-section-content-ctn,
  .fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-section-content-ctn,
  .fi-resource-edit-record-page:has(.fo-kontr) .fo-kontr .fi-section-content-ctn {
    padding: 1rem 0.85rem !important;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fo-vyezd .fi-grid,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fo-vyezd .fi-grid,
  .fi-resource-create-record-page:has(.fo-kontr) .fo-kontr .fi-grid,
  .fi-resource-edit-record-page:has(.fo-kontr) .fo-kontr .fi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-fo-component-ctn,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-fo-component-ctn,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-fo-component-ctn,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-fo-component-ctn {
    align-items: stretch !important;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-input-wrp,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-input-wrp,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-input-wrp,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-input-wrp,
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-fo-select .choices,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-fo-select .choices,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-fo-select .choices,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-fo-select .choices,
  .fo-vyezd-combo,
  .fo-vyezd-combo__input-wrap,
  .fo-vyezd-combo__input {
    width: 100%;
    max-width: 100%;
  }
  .fo-vyezd .fi-fo-toggle-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
  }
  .fo-vyezd .fi-fo-toggle-buttons .fi-btn {
    width: 100%;
    justify-content: center;
    padding-inline: 0.45rem !important;
    font-size: 0.8125rem !important;
    text-align: center;
  }
  .fo-vyezd-dyn__head,
  .fo-vyezd-periodic-panel__head,
  .fo-kontr-sec-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .fo-vyezd-dyn__sub,
  .fo-vyezd-periodic-panel__sub,
  .fo-kontr-sec-sub {
    line-height: 1.35;
  }
  .fo-vyezd-work {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .fo-vyezd-qty,
  .fo-vyezd-qty--volume {
    margin-left: auto;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-ac,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-ac,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-ac,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-ac {
    flex-direction: column;
    align-items: stretch !important;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions .fi-btn,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions .fi-btn,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions .fi-btn {
    width: 100%;
    justify-content: center;
  }
  .fi-resource-create-record-page:has(.fo-vyezd) .fi-form-actions,
  .fi-resource-edit-record-page:has(.fo-vyezd) .fi-form-actions,
  .fi-resource-create-record-page:has(.fo-kontr) .fi-form-actions,
  .fi-resource-edit-record-page:has(.fo-kontr) .fi-form-actions {
    padding-inline: 0.85rem !important;
  }
}

/*
 * Phone + tablet pagination: Filament hides page numbers until ~56rem container,
 * so tablets (800–1280 CSS px) only saw «Предыдущая / Следующая». Force numbers.
 */
@media (max-width: 1280px) {
  .fi-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.55rem !important;
    width: 100%;
  }
  .fi-pagination-overview {
    display: none !important;
  }
  .fi-pagination > .col-start-2 {
    flex: 1 1 100%;
    display: flex !important;
    justify-content: center !important;
    order: 1;
  }
  .fi-pagination-records-per-page-select.fi-compact,
  .fo-per-page-picker--compact {
    display: none !important;
  }
  .fi-pagination-records-per-page-select:not(.fi-compact),
  .fo-per-page-picker--full {
    display: inline-flex !important;
  }
  .fi-pagination:not(.fi-simple) > .fi-pagination-previous-btn,
  .fi-pagination:not(.fi-simple) > .fi-pagination-next-btn {
    display: none !important;
  }
  .fi-pagination-items {
    display: flex !important;
    order: 2;
    flex: 0 1 auto;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    justify-self: center !important;
  }
  .fi-pagination.fi-simple {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
  }
  .fi-pagination.fi-simple > .fi-pagination-previous-btn {
    display: inline-flex !important;
    grid-column: 1;
    justify-self: start;
    order: 0;
  }
  .fi-pagination.fi-simple > .col-start-2 {
    grid-column: 2;
    flex: none;
    order: 0;
  }
  .fi-pagination.fi-simple > .fi-pagination-next-btn {
    display: inline-flex !important;
    grid-column: 3;
    justify-self: end;
    order: 0;
  }
}

@media (max-width: 480px) {
  .fi-resource-list-records-page .fi-ta-table,
  .fi-ta-ctn:has(.fo-bx-ui-filter) .fi-ta-table {
    min-width: 30rem;
  }
  .fo-bx-chip__text {
    max-width: 10rem;
  }
}

.fo-field-has-error .fi-input-wrp,
.fo-field-has-error .fo-vyezd-combo__input,
.fo-field-has-error .fo-vyezd-dyn,
.fo-field-has-error .fo-vyezd-periodic-panel {
  outline: 2px solid rgb(220 38 38 / 0.45);
  outline-offset: 2px;
  border-radius: 0.5rem;
}
