/* Shared responsive layer. Loaded after page styles; desktop and print keep their layouts. */
@media screen {
  .content-body, .content-body > .row, .content-body > .row > [class*="col-"],
  .wm, .wm-shell, .wm-panel, .wm-item-layout > *, .wm-split > *, .sch { min-width: 0; }
  .ecas-nav-backdrop { display: none; }
  .sidebar-header button.sidebar-toggle { border: 0; color: inherit; cursor: pointer; font: inherit; }
  .toggle-sidebar-left:focus-visible, .ecas-nav-backdrop:focus-visible { outline: 3px solid #0073ea; outline-offset: -3px; }
  .content-body img:not(.profile-picture img), .content-body video, .content-body audio { max-width: 100%; }
  .content-body textarea { max-width: 100%; }
  .wm .wm-table-wrap, .sch .sch-grid-wrap, .table-responsive { max-width: 100%; -webkit-overflow-scrolling: touch; }
}
@media screen and (max-width: 991px) {
  .wm .wm-item-layout, .wm .wm-split { grid-template-columns: minmax(0, 1fr); }
  .wm .wm-grid, .wm .am-grid, .wm .am-cards, .sch .sch-fields, .sch .sch-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  }
  .wm .wm-grid > *, .sch .sch-fields > *, .wm .am-grid > * { min-width: 0; }
}
@media screen and (max-width: 767px) {
  html, body { width: 100%; min-width: 0; }
  html .inner-wrapper, html .content-body { width: auto; min-width: 0; margin-left: 0; }
  html .content-body { padding: 0 12px 20px; }
  .content-body > .row { margin-left: -12px; margin-right: -12px; }
  .content-body > .row > [class*="col-"] { padding-left: 12px; padding-right: 12px; }
  html .page-header { margin: 0 -12px 16px; height: auto; min-height: 50px; }
  html .page-header h2 { float: none; max-width: 100%; height: auto; padding: 12px; line-height: 1.4; font-size: 19px; overflow-wrap: anywhere; }
  .header .logo-container { background: #fff; border-top: 0; }
  .header .logo img { max-width: calc(100vw - 90px); object-fit: contain; }
  .header .header-right { display: flex; align-items: center; justify-content: flex-end; min-width: 0; padding: 0 8px; }
  .header .userbox { margin: 0 0 0 8px; max-width: calc(100vw - 100px); }
  .header .userbox > a { display: flex; align-items: center; min-width: 0; max-width: 100%; }
  .header .userbox .profile-info { min-width: 0; max-width: 140px; margin: 0 8px; }
  .header .userbox .name, .header .userbox .role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header .header-right > .separator, .header .userbox::after { display: none; }
  html .header .toggle-sidebar-left { display: inline-flex; align-items: center; justify-content: center; position: absolute; top: 50%; right: max(12px, env(safe-area-inset-right)); transform: translateY(-50%); width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 6px; line-height: 1; cursor: pointer; color: #fff; }
  html .header .toggle-sidebar-left i { display: block; font-size: 18px; line-height: 1; margin: 0; }
  html #sidebar-left { min-width: 0; width: min(320px, 88vw); max-width: 100vw; left: 0; margin-left: 0; transform: translateX(-100%); overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  html.sidebar-left-opened #sidebar-left { left: 0; margin-left: 0; transform: translateX(0); }
  html #sidebar-left .nano { position: relative; height: auto; overflow: visible; width: 100%; }
  html #sidebar-left .nano > .nano-content { position: static; height: auto; overflow: visible !important; margin-right: 0 !important; padding-bottom: 24px; }
  html #sidebar-left .nano > .nano-pane { display: none; }
  html.sidebar-left-opened .ecas-nav-backdrop { display: block; position: fixed; inset: 60px 0 0; z-index: 97; border: 0; background: rgba(15, 23, 42, .45); width: 100%; }
  .sidebar-left a { min-height: 44px; }
  .header .notifications .dropdown-menu { position: fixed; left: 12px; right: 12px; top: 115px; width: auto; max-width: calc(100vw - 24px); }
  .header .dropdown-menu { max-height: 70vh; overflow-y: auto; }
  .header .userbox.show .dropdown-menu { left: auto !important; right: 0; width: min(240px, calc(100vw - 24px)); min-width: 0; }
  .content-body .card, .content-body .card-body, .content-body .panel, .content-body .panel-body { min-width: 0; }
  .content-body .card-body, .content-body .panel-body { padding: 12px; }
  .content-body .card-header, .content-body .panel-heading { overflow-wrap: anywhere; }
  .content-body .form-inline, .content-body .input-group, .content-body .btn-toolbar { max-width: 100%; flex-wrap: wrap; }
  .content-body .form-inline .form-group { width: 100%; margin-right: 0; }
  .content-body .form-control, .content-body .custom-select, .wm .wm-field input, .wm .wm-field select,
  .wm .wm-field textarea, .wm .wm-filters input, .wm .wm-filters select, .wm .mt-act-form input,
  .wm .mt-act-form select, .wm .mt-lang select, .sch .sch-field input, .sch .sch-field select { font-size: 16px; min-height: 44px; max-width: 100%; }
  .content-body .form-control, .content-body .custom-select { min-width: 0; }
  .content-body input[type=file] { max-width: 100%; }
  .content-body .select2-container { max-width: 100%; }
  .content-body .select2-container .select2-selection--single { min-height: 44px; height: auto; }
  .content-body .select2-selection__rendered { white-space: normal; overflow-wrap: anywhere; }
  .content-body .btn, .wm .wm-btn, .wm .wm-tab, .wm .am-action, .wm .mt-action,
  .wm .mt-att-btns button, .sch .sch-seg button { min-height: 44px; white-space: normal; }
  .content-body .btn-group { max-width: 100%; flex-wrap: wrap; }
  .content-body .pagination { flex-wrap: wrap; gap: 2px; }
  .content-body .page-link { min-width: 40px; min-height: 44px; }
  .content-body .nav-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .content-body .nav-tabs > li { flex: 0 0 auto; }
  .content-body table:not(.dataTable):not(.wm-table):not(.sch-grid):not(.table-responsive table):not(.wm-table-wrap table):not(.sch-grid-wrap table):not(.dataTables_scroll table) {
    display: block; width: 100%; min-width: 0 !important; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .content-body .dataTables_wrapper { min-width: 0; max-width: 100%; }
  .content-body .dataTables_wrapper > .row { margin-left: 0; margin-right: 0; }
  .content-body .dataTables_wrapper .dataTables_filter input { width: min(100%, 220px); margin-left: 0; }
  .content-body .dataTables_wrapper .dt-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
  .content-body table.dataTable { display: block; max-width: 100%; overflow-x: auto; }
  .content-body .dataTables_scroll table.dataTable { display: table; max-width: none; }
  .wm .wm-shell { padding: 10px; }
  .wm .wm-panel { padding: 12px; }
  .wm .wm-head { gap: 8px; }
  .wm .wm-head h2 { font-size: 20px; overflow-wrap: anywhere; }
  .wm .wm-head .wm-spacer { display: none; }
  .wm .wm-head .wm-btn { flex: 1 1 auto; justify-content: center; }
  .wm .wm-tabs, .wm .am-nav, .sch .sch-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .wm .wm-tabs > *, .wm .am-nav > *, .sch .sch-nav > * { flex-shrink: 0; white-space: nowrap; }
  .wm .wm-filters > input, .wm .wm-filters > select { flex: 1 1 160px; max-width: 100%; min-width: 0; }
  .wm .wm-grid, .wm .am-grid, .wm .am-cards, .sch .sch-fields, .sch .sch-cards, .sch .sch-route-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .wm .wm-grid > *, .sch .sch-fields > * { grid-column: auto !important; }
  .wm .wm-field .wm-check { align-items: center; min-height: 40px; font-size: 15px; }
  .wm .wm-field input[type=checkbox], .wm .wm-field input[type=radio] { width: 20px; height: 20px; margin: 0; }
  .wm .wm-ticklist { grid-template-columns: minmax(0, 1fr); gap: 0; max-height: 50vh; }
  .wm .wm-stats, .wm .wm-tiles, .sch .sch-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm .wm-stat { min-width: 0; padding: 10px; }
  .wm .wm-stat span, .wm .wm-meta, .wm .mt-text, .wm .wm-alert, .wm .wm-sub { overflow-wrap: anywhere; }
  .wm .wm-kanban { max-width: 100%; scroll-snap-type: x proximity; }
  .wm .wm-col { width: min(270px, 80vw); min-width: min(270px, 80vw); scroll-snap-align: start; }
  .wm .wm-modal-back { padding: 12px; }
  .wm .wm-modal { max-width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .wm .wm-modal-head, .wm .wm-modal-body, .wm .wm-modal-foot { padding: 12px; }
  .wm .wm-modal-foot { flex-wrap: wrap; }
  .wm .mt-lang { gap: 10px; }
  .wm .mt-lang label { width: 100%; flex-direction: column; align-items: stretch; min-width: 0; }
  .wm .mt-lang select { width: 100%; min-width: 0; max-width: 100%; }
  .wm .mt-recorder > div:first-child { align-items: stretch !important; }
  .wm .mt-recorder h4 { min-width: 0 !important; flex-basis: 100% !important; }
  .wm .mt-recorder .wm-btn { flex: 1 1 100%; justify-content: center; }
  .wm .mt-act-form { grid-template-columns: minmax(0, 1fr); }
  .wm .mt-act-form > * { grid-column: auto !important; }
  .wm .mt-suggest { flex-wrap: wrap; }
  .wm .mt-att-btns { flex-wrap: wrap; }
  .wm .fs-tree ul { padding-left: 12px; margin-left: 4px; }
  .sch .sch-toolbar > * { max-width: 100%; }
  .sch .sch-seg { flex-wrap: wrap; }
  .sch .sch-drawer { width: 100%; max-height: 100dvh; }
  .sch .sch-panel { top: 12px; width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .modal-dialog { width: auto !important; max-width: calc(100% - 24px) !important; margin: 12px auto; }
  .modal-content { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .modal-body { min-width: 0; overflow-x: auto; }
  .modal-footer { flex-wrap: wrap; gap: 6px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .mfp-container { padding-left: 12px; padding-right: 12px; }
  .modal-block { width: 100% !important; max-width: 100%; margin: 12px auto; }
  .body-sign { width: 100%; max-width: 100%; padding: 12px; }
  .body-sign .panel-sign { width: 100%; min-width: 0; }
  .body-sign .panel-body { padding: 20px 16px; }
  .body-sign input:not([type=checkbox]):not([type=radio]) { max-width: 100%; font-size: 16px; min-height: 44px; }
  .body-sign .btn { min-height: 44px; }
}
@media screen and (max-width: 374px) {
  .wm .wm-stats, .wm .wm-tiles, .sch .sch-kpis { grid-template-columns: minmax(0, 1fr); }
  .header .userbox .profile-info { max-width: 100px; }
}
