/*
 * CRM-ТО 2.37.7 — universal staged mobile filters and mobile tables.
 * Loaded after er-front.css and er-theme-fix.css.
 * This file intentionally overrides the legacy mobile "table -> cards" rules
 * for tables and filter panels throughout the CRM.
 */

.er-mobile-table-shell{position:relative;min-width:0}
.er-mobile-table-toolbar,.er-mobile-filter-summary,.er-mobile-filter-backdrop,.er-mobile-filter-sheet{display:none}
.er-mobile-table-scale-layer{width:100%;min-width:0;transform-origin:top left}

@media (max-width:1024px){
  html,body{max-width:100%;overflow-x:hidden}
  body.er-mobile-table-fullscreen-open,
  body.er-mobile-filter-sheet-open{overflow:hidden!important;overscroll-behavior:none!important}
  body.er-mobile-filter-sheet-open .er-app{position:relative!important;z-index:1!important}
  body.er-mobile-table-fullscreen-open .er-app{z-index:2147483001!important}

  /* Keep the two requested sections compact. */
  .er-app .er-view[data-er-view="records"]>.er-card,
  .er-app .er-view[data-er-view="agents_report"]>.er-card{padding:10px!important;overflow:visible!important}
  .er-app .er-view[data-er-view="records"] .er-block-head,
  .er-app .er-view[data-er-view="agents_report"] .er-block-head{margin-bottom:8px!important}
  .er-app .er-view[data-er-view="records"] .er-block-head .er-hint,
  .er-app .er-view[data-er-view="agents_report"] .er-block-head .er-hint{display:none!important}

  /* A real, unmistakable Filters button. */
  .er-app .er-mobile-filter-summary{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;
    width:100%!important;margin:0 0 10px!important;padding:8px!important;border:1px solid rgba(148,163,184,.34)!important;
    border-radius:15px!important;background:#fff!important;box-shadow:0 6px 18px rgba(15,23,42,.06)!important;box-sizing:border-box!important
  }
  .er-mobile-filter-open-button{
    display:flex!important;width:100%!important;min-width:0!important;min-height:52px!important;align-items:center!important;gap:10px!important;
    padding:8px 12px!important;border:1px solid #1d4ed8!important;border-radius:13px!important;background:linear-gradient(180deg,#2f6fea,#1d56d8)!important;
    color:#fff!important;box-shadow:0 5px 12px rgba(37,99,235,.22)!important;text-align:left!important
  }
  .er-mobile-filter-open-button:active{transform:translateY(1px)!important;box-shadow:0 2px 7px rgba(37,99,235,.20)!important}
  .er-mobile-filter-open-button__icon{display:inline-flex!important;width:30px!important;height:30px!important;flex:0 0 30px!important;align-items:center!important;justify-content:center!important;border-radius:9px!important;background:rgba(255,255,255,.17)!important}
  .er-mobile-filter-open-button__icon svg{width:20px!important;height:20px!important}
  .er-mobile-filter-open-button__text{display:flex!important;min-width:0!important;flex:1 1 auto!important;flex-direction:column!important}
  .er-mobile-filter-open-button__text strong{font-size:15px!important;line-height:1.15!important;font-weight:900!important;color:#fff!important}
  .er-mobile-filter-open-button__text small{display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;margin-top:3px!important;font-size:10px!important;line-height:1.2!important;color:rgba(255,255,255,.82)!important}
  .er-mobile-filter-open-button__count{display:inline-flex!important;min-width:25px!important;height:25px!important;align-items:center!important;justify-content:center!important;padding:0 7px!important;border-radius:999px!important;background:#fff!important;color:#1d4ed8!important;font-size:11px!important;font-weight:900!important}
  .er-mobile-filter-open-button__count[hidden]{display:none!important}
  .er-mobile-filter-open-button__arrow{font-size:25px!important;line-height:1!important;color:rgba(255,255,255,.9)!important}
  .er-mobile-filter-result{display:inline-flex!important;min-height:36px!important;align-items:center!important;justify-content:center!important;padding:7px 10px!important;border-radius:12px!important;background:#f1f5f9!important;color:#475569!important;font-size:11px!important;font-weight:900!important;white-space:nowrap!important}
  .er-mobile-filter-result[hidden]{display:none!important}
  .er-mobile-filter-chips{display:flex!important;grid-column:1/-1!important;gap:6px!important;overflow-x:auto!important;padding:0 1px 1px!important;scrollbar-width:none!important}
  .er-mobile-filter-chips::-webkit-scrollbar{display:none!important}
  .er-mobile-filter-chips:empty{display:none!important}
  .er-mobile-filter-chip{flex:0 0 auto!important;max-width:260px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;padding:5px 8px!important;border:1px solid rgba(37,99,235,.16)!important;border-radius:999px!important;background:#eff6ff!important;color:#1d4ed8!important;font-size:10px!important;font-weight:800!important}

  /* The real source filter remains hidden. Editing happens in a staged sheet. */
  .er-app [data-er-filters].er-mobile-filter-panel{display:none!important}
  .er-mobile-filter-backdrop.is-open{display:block!important;position:fixed!important;inset:0!important;z-index:2147482500!important;background:rgba(15,23,42,.52)!important;backdrop-filter:blur(2px)!important}
  body>.er-mobile-filter-sheet.is-open{
    display:flex!important;position:fixed!important;z-index:2147482501!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;
    width:100%!important;max-width:760px!important;max-height:92dvh!important;margin:0 auto!important;flex-direction:column!important;overflow:hidden!important;
    border:1px solid rgba(148,163,184,.35)!important;border-bottom:0!important;border-radius:24px 24px 0 0!important;background:#fff!important;
    box-shadow:0 -24px 80px rgba(15,23,42,.32)!important;box-sizing:border-box!important
  }
  .er-mobile-filter-sheet__head{
    display:flex!important;position:relative!important;z-index:3!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important;
    padding:16px 16px 13px!important;border-bottom:1px solid rgba(148,163,184,.22)!important;background:#fff!important
  }
  .er-mobile-filter-sheet__head>div{display:flex!important;min-width:0!important;flex-direction:column!important}
  .er-mobile-filter-sheet__head strong{font-size:19px!important;line-height:1.2!important;color:#0f172a!important;font-weight:900!important}
  .er-mobile-filter-sheet__head small{margin-top:4px!important;font-size:11px!important;line-height:1.35!important;color:#64748b!important}
  .er-mobile-filter-sheet-close{display:inline-flex!important;width:40px!important;height:40px!important;flex:0 0 40px!important;align-items:center!important;justify-content:center!important;border:1px solid rgba(148,163,184,.35)!important;border-radius:12px!important;background:#f8fafc!important;color:#0f172a!important;font-size:25px!important;line-height:1!important}
  .er-mobile-filter-sheet__body{min-height:0!important;flex:1 1 auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;padding:14px 16px 18px!important;background:#f8fafc!important}
  .er-mobile-filter-sheet .er-filters-row,.er-mobile-filter-sheet .er-mobile-filter-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  .er-mobile-filter-sheet .er-field,.er-mobile-filter-sheet .er-field-inline{display:flex!important;min-width:0!important;flex-direction:column!important;gap:6px!important;margin:0!important}
  .er-mobile-filter-sheet .er-field label,.er-mobile-filter-sheet .er-field-inline label{margin:0!important;font-size:12px!important;line-height:1.2!important;color:#334155!important;font-weight:850!important}
  .er-mobile-filter-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.er-mobile-filter-sheet select,.er-mobile-filter-sheet textarea{width:100%!important;min-width:0!important;max-width:none!important;min-height:48px!important;height:48px!important;padding:9px 12px!important;border:1px solid #cbd5e1!important;border-radius:12px!important;background:#fff!important;color:#0f172a!important;font-size:15px!important;box-sizing:border-box!important;box-shadow:none!important}
  .er-mobile-filter-sheet select[multiple]{height:auto!important;min-height:170px!important;padding:6px!important}
  .er-mobile-filter-sheet textarea{height:auto!important;min-height:96px!important;resize:vertical!important}
  .er-mobile-filter-sheet input:not([type="checkbox"]):not([type="radio"]):focus,.er-mobile-filter-sheet select:focus,.er-mobile-filter-sheet textarea:focus{outline:3px solid rgba(37,99,235,.15)!important;border-color:#2563eb!important}
  .er-mobile-filter-sheet input[type="hidden"]{display:none!important}
  .er-mobile-filter-sheet input[type="checkbox"],.er-mobile-filter-sheet input[type="radio"]{width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;flex:0 0 20px!important;margin:0!important;accent-color:#2563eb!important}
  .er-mobile-filter-sheet .er-cash-filter-period,.er-mobile-filter-sheet .er-cash-filter-grid,.er-mobile-filter-sheet .er-shift-controlbar-month,.er-mobile-filter-sheet .er-shift-controlbar-filters,.er-mobile-filter-sheet .er-filters-left,.er-mobile-filter-sheet .er-dashboard-filter-fields,.er-mobile-filter-sheet .er-toolbar-row{display:contents!important}
  .er-mobile-filter-sheet [data-er-multi-check-group]{display:flex!important;grid-column:1/-1!important;min-width:0!important;flex-direction:column!important;gap:8px!important;padding:11px!important;border:1px solid #dbe3ee!important;border-radius:14px!important;background:#fff!important}
  .er-mobile-filter-sheet .er-cash-filter-section__title,.er-mobile-filter-sheet .er-cash-check-title{font-size:12px!important;font-weight:900!important;color:#334155!important}
  .er-mobile-filter-sheet .er-cash-check-options{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .er-mobile-filter-sheet .er-cash-check-option{display:flex!important;min-width:0!important;align-items:center!important;gap:8px!important;padding:9px!important;border:1px solid #dbe3ee!important;border-radius:11px!important;background:#f8fafc!important;color:#334155!important;font-size:12px!important;font-weight:750!important}
  .er-mobile-filter-sheet .er-cash-check-option.is-checked{border-color:#93c5fd!important;background:#eff6ff!important;color:#1d4ed8!important}
  .er-mobile-filter-sheet .er-dashboard-quick-periods,.er-mobile-filter-sheet .er-period-presets{display:grid!important;grid-column:1/-1!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;margin:0!important;padding:10px!important;border:1px solid #dbeafe!important;border-radius:14px!important;background:#eff6ff!important}
  .er-mobile-filter-sheet .er-dashboard-filter-summary,.er-mobile-filter-sheet .er-records-filter-head,.er-mobile-filter-sheet .er-cash-history-hero{display:none!important}
  .er-mobile-filter-preset{display:inline-flex!important;min-width:0!important;min-height:38px!important;align-items:center!important;justify-content:center!important;padding:6px 7px!important;border:1px solid #bfdbfe!important;border-radius:10px!important;background:#fff!important;color:#1d4ed8!important;font-size:11px!important;font-weight:850!important;line-height:1.15!important;text-align:center!important}
  .er-mobile-filter-preset.is-active{border-color:#2563eb!important;background:#2563eb!important;color:#fff!important}
  .er-mobile-filter-sheet__footer{display:grid!important;position:relative!important;z-index:3!important;grid-template-columns:minmax(110px,.8fr) minmax(160px,1.4fr)!important;gap:10px!important;padding:12px 16px calc(12px + env(safe-area-inset-bottom))!important;border-top:1px solid rgba(148,163,184,.26)!important;background:#fff!important}
  .er-mobile-filter-reset,.er-mobile-filter-apply{display:inline-flex!important;min-height:52px!important;align-items:center!important;justify-content:center!important;padding:10px 14px!important;border-radius:13px!important;font-size:14px!important;font-weight:900!important}
  .er-mobile-filter-reset{border:1px solid #cbd5e1!important;background:#fff!important;color:#334155!important}
  .er-mobile-filter-apply{border:1px solid #1d4ed8!important;background:linear-gradient(180deg,#2f6fea,#1d56d8)!important;color:#fff!important;box-shadow:0 5px 12px rgba(37,99,235,.20)!important}

  /* Toolbar above the scrollable table. */
  .er-app .er-mobile-table-toolbar{
    display:flex!important;position:relative!important;z-index:10!important;align-items:center!important;justify-content:space-between!important;
    flex-wrap:wrap!important;gap:6px!important;margin:0 0 7px!important;padding:7px!important;border:1px solid rgba(148,163,184,.34)!important;
    border-radius:13px!important;background:#fff!important;box-shadow:0 5px 16px rgba(15,23,42,.05)!important;box-sizing:border-box!important
  }
  .er-mobile-table-toolbar__context{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important;flex:1 1 150px!important}
  .er-mobile-table-toolbar__context>div{display:flex!important;min-width:0!important;flex-direction:column!important;line-height:1.1!important}
  .er-mobile-table-toolbar__context strong{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important;color:#0f172a!important}
  .er-mobile-table-toolbar__context small{margin-top:2px!important;font-size:10px!important;color:#64748b!important}
  .er-mobile-table-back{display:none!important;width:34px!important;height:34px!important;align-items:center!important;justify-content:center!important;border:1px solid rgba(148,163,184,.35)!important;border-radius:9px!important;background:#fff!important;font-size:19px!important;font-weight:900!important}
  .er-mobile-table-toolbar__main,.er-mobile-table-toolbar__side{display:flex!important;align-items:center!important;gap:5px!important}
  .er-mobile-table-tool,.er-mobile-table-scale-label{display:inline-flex!important;min-width:34px!important;width:auto!important;height:34px!important;min-height:34px!important;align-items:center!important;justify-content:center!important;padding:5px 8px!important;border:1px solid rgba(148,163,184,.38)!important;border-radius:9px!important;background:#fff!important;color:#0f172a!important;font-size:12px!important;line-height:1!important;font-weight:900!important;white-space:nowrap!important}
  .er-mobile-table-scale-label{min-width:52px!important;background:#eff6ff!important;border-color:rgba(37,99,235,.24)!important;color:#1d4ed8!important}
  .er-mobile-table-tool--text{font-size:10px!important}

  /* The critical fallback: real table even if the main er-front.js has failed. */
  .er-app .er-table-wrap[data-er-mobile-table-wrap],
  .er-app .er-agents-report-table-wrap,
  .er-app .er-mobile-table-viewport{
    display:block!important;position:relative!important;width:100%!important;max-width:100%!important;max-height:72dvh!important;
    overflow:auto!important;overflow-x:auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;touch-action:pan-x pan-y!important;border:1px solid rgba(148,163,184,.30)!important;
    border-radius:12px!important;background:#fff!important;box-sizing:border-box!important
  }
  .er-mobile-table-scale-layer{display:block!important;width:max-content!important;min-width:100%!important;transform-origin:top left!important}

  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table,
  .er-app .er-agents-report-table-wrap table.er-table,
  .er-app .er-mobile-table-shell table.er-table{
    display:table!important;width:max-content!important;min-width:1240px!important;table-layout:auto!important;border-collapse:separate!important;
    border-spacing:0!important;border:0!important;background:#fff!important;margin:0!important
  }
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table-records,
  .er-app .er-mobile-table-shell table.er-table-records{min-width:1480px!important}
  .er-app .er-agents-report-table-wrap table.er-table-agents-report,
  .er-app .er-mobile-table-shell table.er-table-agents-report{min-width:2260px!important;table-layout:fixed!important}

  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table thead,
  .er-app .er-agents-report-table-wrap table.er-table thead,
  .er-app .er-mobile-table-shell table.er-table thead{display:table-header-group!important}
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tbody,
  .er-app .er-agents-report-table-wrap table.er-table tbody,
  .er-app .er-mobile-table-shell table.er-table tbody{display:table-row-group!important}
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tfoot,
  .er-app .er-agents-report-table-wrap table.er-table tfoot,
  .er-app .er-mobile-table-shell table.er-table tfoot{display:table-footer-group!important}

  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tr,
  .er-app .er-agents-report-table-wrap table.er-table tr,
  .er-app .er-mobile-table-shell table.er-table tr{
    display:table-row!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important
  }
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table th,
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table td,
  .er-app .er-agents-report-table-wrap table.er-table th,
  .er-app .er-agents-report-table-wrap table.er-table td,
  .er-app .er-mobile-table-shell table.er-table th,
  .er-app .er-mobile-table-shell table.er-table td{
    display:table-cell!important;width:auto!important;max-width:none!important;min-height:0!important;padding:7px 8px!important;
    border:0!important;border-right:1px solid rgba(148,163,184,.18)!important;border-bottom:1px solid rgba(148,163,184,.22)!important;
    border-radius:0!important;vertical-align:middle!important;text-align:left!important;white-space:nowrap!important;overflow:visible!important;
    text-overflow:clip!important;font-size:12px!important;line-height:1.25!important;color:#172033!important;background:#fff!important;box-sizing:border-box!important
  }
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table td::before,
  .er-app .er-agents-report-table-wrap table.er-table td::before,
  .er-app .er-mobile-table-shell table.er-table td::before{display:none!important;content:none!important}
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table td>*,
  .er-app .er-agents-report-table-wrap table.er-table td>*,
  .er-app .er-mobile-table-shell table.er-table td>*{max-width:none!important}

  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table thead th,
  .er-app .er-agents-report-table-wrap table.er-table thead th,
  .er-app .er-mobile-table-shell table.er-table thead th{
    position:sticky!important;top:0!important;z-index:6!important;background:#eaf2ff!important;color:#25324a!important;font-size:11px!important;font-weight:900!important;box-shadow:0 1px 0 rgba(37,99,235,.18)!important
  }
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tbody tr:nth-child(even) td,
  .er-app .er-agents-report-table-wrap table.er-table tbody tr:nth-child(even) td,
  .er-app .er-mobile-table-shell table.er-table tbody tr:nth-child(even) td{background:#f8fbff!important}
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tfoot th,
  .er-app .er-table-wrap[data-er-mobile-table-wrap] table.er-table tfoot td,
  .er-app .er-agents-report-table-wrap table.er-table tfoot th,
  .er-app .er-agents-report-table-wrap table.er-table tfoot td{
    position:sticky!important;bottom:0!important;z-index:5!important;background:#e8f2ff!important;border-top:2px solid rgba(37,99,235,.28)!important;font-weight:900!important
  }

  /* Sticky identity columns in Records. */
  .er-app table.er-table-records .er-col-check{position:sticky!important;left:0!important;z-index:8!important;width:42px!important;min-width:42px!important;max-width:42px!important;background:#f4f8ff!important;text-align:center!important}
  .er-app table.er-table-records .er-record-id-dk,
  .er-app table.er-table-records .er-col-id-dk{position:sticky!important;left:0!important;z-index:7!important;width:90px!important;min-width:90px!important;max-width:90px!important;background:#f4f8ff!important;box-shadow:3px 0 7px rgba(15,23,42,.08)!important}
  .er-app table.er-table-records:has(.er-col-check) .er-record-id-dk,
  .er-app table.er-table-records:has(.er-col-check) .er-col-id-dk{left:42px!important}
  .er-app table.er-table-records thead .er-col-check,
  .er-app table.er-table-records thead .er-col-id-dk{z-index:10!important;background:#dfeaff!important}
  .er-app table.er-table-records .er-record-branch-employee{min-width:165px!important;white-space:normal!important}
  .er-app table.er-table-records .er-record-agent-pay{min-width:145px!important;white-space:normal!important}
  .er-app .er-record-payment-mismatch{white-space:normal!important}
  .er-app .er-records-live-status{font-size:9px!important;min-height:22px!important;padding:3px 7px!important;margin-left:6px!important}
  .er-app table.er-table-records .er-col-confirm{min-width:125px!important}
  .er-app table.er-table-records .er-col-pdf{min-width:88px!important}
  .er-app table.er-table-records .er-link,
  .er-app table.er-table-records .er-btn,
  .er-app table.er-table-records button{min-height:30px!important;height:auto!important;width:auto!important;font-size:10px!important;padding:5px 7px!important}

  /* Agents report widths and sticky agent/actions columns. */
  .er-app table.er-table-agents-report th:nth-child(1),.er-app table.er-table-agents-report td:nth-child(1){position:sticky!important;left:0!important;z-index:7!important;width:145px!important;min-width:145px!important;background:#f4f8ff!important;box-shadow:3px 0 7px rgba(15,23,42,.08)!important}
  .er-app table.er-table-agents-report thead th:nth-child(1){z-index:10!important;background:#dfeaff!important}
  .er-app table.er-table-agents-report th:nth-child(2),.er-app table.er-table-agents-report td:nth-child(2){width:132px!important;min-width:132px!important}
  .er-app table.er-table-agents-report th:nth-child(3),.er-app table.er-table-agents-report td:nth-child(3){width:122px!important;min-width:122px!important}
  .er-app table.er-table-agents-report th:nth-child(4),.er-app table.er-table-agents-report td:nth-child(4){width:165px!important;min-width:165px!important;white-space:normal!important}
  .er-app table.er-table-agents-report th:nth-child(5),.er-app table.er-table-agents-report td:nth-child(5){width:85px!important;min-width:85px!important;text-align:center!important}
  .er-app table.er-table-agents-report th:nth-child(n+6):nth-child(-n+12),
  .er-app table.er-table-agents-report td:nth-child(n+6):nth-child(-n+12){width:150px!important;min-width:150px!important;text-align:right!important}
  .er-app table.er-table-agents-report th:nth-child(13),.er-app table.er-table-agents-report td:nth-child(13){width:125px!important;min-width:125px!important}
  .er-app table.er-table-agents-report th:nth-child(14),.er-app table.er-table-agents-report td:nth-child(14){width:185px!important;min-width:185px!important;white-space:normal!important}
  .er-app table.er-table-agents-report th:nth-child(15),.er-app table.er-table-agents-report td:nth-child(15){width:210px!important;min-width:210px!important;white-space:normal!important}
  .er-app table.er-table-agents-report th:nth-child(16),.er-app table.er-table-agents-report td:nth-child(16){position:sticky!important;right:0!important;z-index:7!important;width:270px!important;min-width:270px!important;background:#f8fbff!important;box-shadow:-3px 0 7px rgba(15,23,42,.08)!important}
  .er-app table.er-table-agents-report thead th:nth-child(16){z-index:10!important;background:#dfeaff!important}
  .er-app table.er-table-agents-report .er-agent-report-pay{display:grid!important;grid-template-columns:minmax(74px,1fr) auto auto!important;align-items:center!important;gap:4px!important;width:100%!important;min-width:0!important;max-width:none!important}
  .er-app table.er-table-agents-report .er-agent-report-pay__row{display:contents!important}
  .er-app table.er-table-agents-report .er-agent-report-pay__input{grid-column:1!important;width:100%!important;min-width:0!important;min-height:30px!important;height:30px!important;padding:4px 6px!important;font-size:10px!important}
  .er-app table.er-table-agents-report .er-agent-report-pay__row .er-btn-mini{grid-column:2!important;width:auto!important;min-width:82px!important;white-space:nowrap!important}
  .er-app table.er-table-agents-report .er-agent-report-pay__full{grid-column:3!important;width:auto!important;min-width:62px!important;white-space:nowrap!important}
  .er-app table.er-table-agents-report .er-btn-mini,.er-app table.er-table-agents-report .er-agent-report-pay__full{min-height:30px!important;height:30px!important;padding:4px 6px!important;font-size:9px!important}

  /* Full screen table workspace. */
  .er-mobile-table-shell.is-er-table-fullscreen{position:fixed!important;inset:0!important;z-index:2147483000!important;display:flex!important;flex-direction:column!important;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;background:#edf3fb!important}
  .er-mobile-table-shell.is-er-table-fullscreen .er-mobile-table-back{display:inline-flex!important}
  .er-mobile-table-shell.is-er-table-fullscreen .er-mobile-table-toolbar{flex:0 0 auto!important;margin-bottom:7px!important}
  .er-mobile-table-shell.is-er-table-fullscreen .er-mobile-table-viewport{flex:1 1 auto!important;min-height:0!important;max-height:none!important;height:auto!important}

  /* Nothing floats over table cells. The fixed burger is redundant because the top bar has a menu. */
  body.er-mobile-table-view-active .er-fab-menu,
  body.er-mobile-table-view-active .er-mobile-table-floating-helper,
  body.er-mobile-table-fullscreen-open [data-er-assistant],
  body.er-mobile-table-fullscreen-open .er-assistant-widget,
  body.er-mobile-table-fullscreen-open .er-tasks-fab,
  body.er-mobile-table-fullscreen-open iframe[title*="Помощник"]{display:none!important}
  .er-view[data-er-view="records"],.er-view[data-er-view="agents_report"]{overflow-x:clip!important;padding-bottom:18px!important}
}

@media (max-width:620px){
  .er-mobile-table-toolbar__context{flex-basis:100%!important}
  .er-mobile-table-toolbar__main{display:grid!important;grid-template-columns:34px 52px 34px minmax(88px,1fr)!important;flex:1 1 auto!important}
  .er-mobile-table-toolbar__side{width:100%!important;display:grid!important;grid-template-columns:1fr!important}
  .er-app [data-er-filters].er-mobile-filter-panel .er-filters-row{grid-template-columns:1fr!important}
  .er-app [data-er-filters].er-mobile-filter-panel .er-period-presets,
  .er-app [data-er-filters].er-mobile-filter-panel .er-field-actions{grid-column:auto!important}
}


@media (max-width:620px){
  .er-app .er-mobile-filter-summary{grid-template-columns:1fr auto!important}
  .er-mobile-filter-result{font-size:10px!important;padding:6px 8px!important}
  .er-mobile-filter-sheet .er-filters-row,.er-mobile-filter-sheet .er-mobile-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .er-mobile-filter-sheet .er-field,.er-mobile-filter-sheet .er-field-inline{grid-column:1/-1!important}
  .er-mobile-filter-sheet .er-filter-date-from{grid-column:1!important}
  .er-mobile-filter-sheet .er-filter-date-to{grid-column:2!important}
  .er-mobile-filter-sheet .er-period-presets{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

/* Sort indicators for the agents report. */
.er-table-agents-report th.er-mobile-sortable{cursor:pointer;user-select:none}
.er-table-agents-report th.er-mobile-sortable::after{content:' ↕';font-size:10px;opacity:.45}
.er-table-agents-report th.er-mobile-sortable.is-sort-asc::after{content:' ↑';opacity:1}
.er-table-agents-report th.er-mobile-sortable.is-sort-desc::after{content:' ↓';opacity:1}

@media (max-width:620px){
  /* On narrow phones a fixed 270px action column hides financial columns. Keep it in the table flow. */
  .er-app table.er-table-agents-report th:nth-child(16),
  .er-app table.er-table-agents-report td:nth-child(16){position:static!important;right:auto!important;z-index:auto!important;box-shadow:none!important}
}

/* ========================================================================
 * CRM-ТО 2.37.0 — compact agents report controls + restored mobile menu.
 * ======================================================================== */
.er-agents-report-summary{
  display:grid!important;
  gap:12px!important;
  padding:14px!important;
  border:1px solid rgba(148,163,184,.30)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 8px 24px rgba(15,23,42,.05)!important;
}
.er-agents-report-summary-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.er-agents-report-summary-title{font-size:15px;font-weight:900;line-height:1.2;color:#0f172a}
.er-agents-report-summary-period{margin-top:3px;font-size:12px;font-weight:700;color:#64748b}
.er-agents-report-metrics{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr));gap:8px;min-width:0}
.er-agents-report-metric{display:flex;min-width:0;flex-direction:column;gap:3px;padding:9px 10px;border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc}
.er-agents-report-metric span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:800;color:#64748b}
.er-agents-report-metric b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:1.2;color:#0f172a}
.er-agents-report-metric--paid{border-color:#bbf7d0;background:#f0fdf4}
.er-agents-report-metric--paid b{color:#166534}
.er-agents-report-metric--warning{border-color:#fde68a;background:#fffbeb}
.er-agents-report-metric--warning b{color:#92400e}
.er-agents-report-metric--danger{border-color:#fecaca;background:#fef2f2}
.er-agents-report-metric--danger b{color:#b91c1c}
.er-agents-report-export-actions{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:7px!important;margin:0!important}
.er-agents-report-export-actions .er-btn{width:auto!important;min-height:38px!important;padding:7px 11px!important;border-radius:10px!important;font-size:12px!important;line-height:1!important}
.er-agents-report-action-icon{display:inline-flex;min-width:25px;height:22px;align-items:center;justify-content:center;margin-right:5px;border-radius:6px;background:#eff6ff;color:#1d4ed8;font-size:9px;font-weight:900;line-height:1}
.er-agents-report-action-short{display:none}
.er-agents-report-explanation{margin:10px 0!important;border:1px solid rgba(148,163,184,.28)!important;border-radius:12px!important;background:#fff!important;color:#475569!important}
.er-agents-report-explanation>summary{display:flex;min-height:40px;align-items:center;justify-content:space-between;padding:8px 12px;cursor:pointer;list-style:none;font-size:12px;font-weight:900;color:#334155}
.er-agents-report-explanation>summary::-webkit-details-marker{display:none}
.er-agents-report-explanation>summary::after{content:'⌄';font-size:16px;transition:transform .16s ease}
.er-agents-report-explanation[open]>summary::after{transform:rotate(180deg)}
.er-agents-report-explanation>div{padding:0 12px 11px;font-size:12px;line-height:1.55;color:#64748b}

@media (max-width:1024px){
  /* One compact row instead of a two-storey zoom panel. */
  .er-app .er-mobile-table-toolbar{
    flex-wrap:nowrap!important;
    gap:5px!important;
    padding:6px!important;
    min-height:48px!important;
  }
  .er-mobile-table-toolbar__context{flex:1 1 auto!important;min-width:0!important}
  .er-mobile-table-toolbar__context strong{font-size:12px!important}
  .er-mobile-table-toolbar__context small{font-size:9px!important}
  .er-mobile-table-toolbar__main{display:flex!important;flex:0 0 auto!important;gap:4px!important}
  .er-mobile-table-toolbar__side{display:flex!important;flex:0 0 auto!important;width:auto!important}
  .er-mobile-table-tool,.er-mobile-table-scale-label{
    width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:4px!important;border-radius:9px!important
  }
  .er-mobile-table-scale-label{width:48px!important;min-width:48px!important;font-size:11px!important}
  .er-mobile-table-tool--fullscreen{width:38px!important;min-width:38px!important;font-size:18px!important}
  .er-mobile-table-fullscreen-icon{display:inline-flex;align-items:center;justify-content:center;font-size:20px;line-height:1}

  /* Filters remain one short row on a phone. */
  .er-mobile-filter-summary__main{flex:1 1 120px!important;width:auto!important;min-width:0!important}
  .er-mobile-filter-summary__actions{display:flex!important;flex:0 0 auto!important;width:auto!important;gap:5px!important}
  .er-mobile-filter-quick{min-width:68px!important;height:34px!important;padding:5px 8px!important}

  /* Compact summary: swipe metrics horizontally, actions stay in one row. */
  .er-app .er-agents-report-summary{gap:9px!important;padding:10px!important;margin:0 0 8px!important}
  .er-agents-report-summary-title{font-size:14px!important}
  .er-agents-report-summary-period{font-size:11px!important}
  .er-agents-report-metrics{
    display:flex!important;
    gap:6px!important;
    width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain!important;
    scrollbar-width:none!important;
    padding:1px 1px 3px!important;
  }
  .er-agents-report-metrics::-webkit-scrollbar{display:none!important}
  .er-agents-report-metric{flex:0 0 116px!important;padding:7px 8px!important;border-radius:9px!important}
  .er-agents-report-metric span{font-size:9px!important}
  .er-agents-report-metric b{font-size:12px!important}
  .er-agents-report-export-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
    width:100%!important;
  }
  .er-agents-report-export-actions .er-btn{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    min-height:40px!important;
    height:40px!important;
    justify-content:center!important;
    gap:4px!important;
    padding:5px 4px!important;
    border:1px solid rgba(37,99,235,.20)!important;
    border-radius:10px!important;
    background:#eff6ff!important;
    color:#1d4ed8!important;
    box-shadow:none!important;
    font-size:10px!important;
    font-weight:900!important;
  }
  .er-agents-report-action-icon{min-width:20px!important;width:20px!important;height:20px!important;margin:0!important;background:#fff!important;font-size:8px!important}
  .er-agents-report-action-full{display:none!important}
  .er-agents-report-action-short{display:inline!important;white-space:nowrap!important}
  .er-agents-report-explanation{margin:7px 0 8px!important}
  .er-agents-report-explanation>summary{min-height:36px!important;padding:6px 10px!important;font-size:11px!important}
  .er-agents-report-explanation>div{padding:0 10px 9px!important;font-size:11px!important}

  /* Restore the CRM page menu. It was incorrectly hidden in 2.36.4/2.36.5. */
  body.er-mobile-table-view-active .er-fab-menu{
    display:inline-flex!important;
    left:max(10px,env(safe-area-inset-left))!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    width:52px!important;
    height:52px!important;
    border-radius:17px!important;
    z-index:2147482200!important;
  }
  body.er-mobile-filter-sheet-open .er-fab-menu,
  body.er-mobile-table-fullscreen-open .er-fab-menu{display:none!important}

  /* The assistant must not cover table controls or the restored page menu. */
  body.er-mobile-table-view-active .er-mobile-table-floating-helper,
  body.er-mobile-table-view-active [data-er-assistant],
  body.er-mobile-table-view-active .er-assistant-widget,
  body.er-mobile-table-view-active .er-tasks-fab,
  body.er-mobile-table-view-active [aria-label*="Помощник"],
  body.er-mobile-table-view-active [title*="Помощник"],
  body.er-mobile-table-view-active iframe[title*="Помощник"]{display:none!important}

  .er-view[data-er-view="records"],
  .er-view[data-er-view="agents_report"]{padding-bottom:76px!important}
}

@media (max-width:620px){
  .er-mobile-table-toolbar__context{flex-basis:auto!important}
  .er-mobile-table-toolbar__context>div{max-width:76px!important}
  .er-mobile-filter-result{display:none!important}
  .er-mobile-filter-toggle strong{font-size:13px!important}
  .er-mobile-filter-toggle small{max-width:110px!important}
  .er-agents-report-export-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media (max-width:360px){
  .er-mobile-table-toolbar__context>div{max-width:56px!important}
  .er-mobile-table-tool,.er-mobile-table-scale-label{width:32px!important;min-width:32px!important}
  .er-mobile-table-scale-label{width:44px!important;min-width:44px!important}
  .er-agents-report-export-actions .er-btn{font-size:9px!important}
  .er-agents-report-action-icon{display:none!important}
}


/* 2.37.7 — corrected phone layout for the staged records filter sheet. */
@media (max-width:1024px){
  /* The cloned .er-filters-row used to occupy only one cell of the outer grid,
     which reduced all record filters to half of the phone width. */
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row{
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    box-sizing:border-box!important;
  }
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-field,
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-field-inline{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-filter-date-from,
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-filter-date-to{
    grid-column:auto!important;
  }
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-period-presets{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .er-mobile-filter-sheet input[type="date"]{
    min-width:0!important;
    width:100%!important;
    font-size:16px!important;
    letter-spacing:-.01em!important;
  }
}

@media (max-width:480px){
  body>.er-mobile-filter-sheet.is-open{
    max-height:calc(100dvh - 8px)!important;
    border-radius:22px 22px 0 0!important;
  }
  .er-mobile-filter-sheet__head{padding:14px 14px 12px!important}
  .er-mobile-filter-sheet__head strong{font-size:18px!important}
  .er-mobile-filter-sheet__head small{font-size:11px!important}
  .er-mobile-filter-sheet__body{padding:12px 14px 16px!important}
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row{gap:11px!important}
  .er-mobile-filter-sheet .er-period-presets{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    padding:9px!important;
  }
  .er-mobile-filter-preset{
    min-height:42px!important;
    padding:7px 8px!important;
    font-size:12px!important;
    line-height:1.15!important;
    white-space:normal!important;
  }
  .er-mobile-filter-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .er-mobile-filter-sheet select,
  .er-mobile-filter-sheet textarea{
    min-height:50px!important;
    height:50px!important;
    font-size:16px!important;
  }
  .er-mobile-filter-sheet__footer{
    grid-template-columns:minmax(0,.78fr) minmax(0,1.35fr)!important;
    gap:9px!important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important;
  }
  .er-mobile-filter-reset,.er-mobile-filter-apply{
    min-width:0!important;
    min-height:50px!important;
    padding:9px 10px!important;
    font-size:14px!important;
  }
}

@media (max-width:350px){
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row{
    grid-template-columns:1fr!important;
  }
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-filter-date-from,
  .er-mobile-filter-sheet .er-mobile-filter-grid--nested-row>.er-filters-row>.er-filter-date-to{
    grid-column:1/-1!important;
  }
}
