.global-search__trigger,
.global-search__close,
.global-search__backdrop { display: none; }
.global-search__panel { position: relative; }
.global-search__results { max-height: 65vh; }

@media (max-width: 640px) {
  .crm-header { gap: 6px; padding-inline: 8px; }
  .crm-header > :last-child { gap: 4px; min-width: 0; }
  .crm-header > :last-child > * { flex-shrink: 0; }
  .crm-header .header-issues__label { display: none; }
  .crm-header .header-issues { gap: 3px; padding-inline: 5px; }
  .crm-header .global-search { flex: 0 0 auto; }
  .global-search__trigger { display: inline-flex; width: 40px; height: 40px; padding: 0; }
  .global-search__panel { display: none; }
  .global-search[data-mobile-open='true'] .global-search__panel {
    display: block;
    position: fixed;
    top: calc(var(--kop-header-h) + 8px);
    left: 8px;
    right: 8px;
    z-index: 52;
    padding-right: 42px;
    border-radius: var(--r-control);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
  }
  .global-search__panel > svg { top: 22px; }
  .global-search__panel > input { min-height: 44px; font-size: 16px; }
  .global-search__close { display: inline-flex; position: absolute; right: 0; top: 0; width: 42px; min-height: 44px; padding: 0; }
  .global-search__backdrop {
    display: block;
    position: fixed;
    inset: var(--kop-header-h) 0 0;
    z-index: 51;
    border: 0;
    background: rgb(0 0 0 / 28%);
  }
  .global-search .global-search__results { max-height: min(60dvh, calc(100dvh - var(--kop-header-h) - 76px)); overscroll-behavior: contain; }
  .global-search__results button { min-height: 44px; align-items: flex-start; }
  .global-search__results button > span:first-child { white-space: normal; overflow-wrap: anywhere; }
  .global-search__results button > span:last-child { min-width: 0; overflow-wrap: anywhere; }
}

/* Phone controls retain the existing filters, totals and pagination actions. */
@media (max-width: 640px) {
  .pager { width: 100%; min-width: 0; gap: 8px; justify-content: flex-start; }
  .pager > span:first-child { flex: 1 0 100%; white-space: normal; overflow-wrap: anywhere; }
  .pager > .grow:empty { display: none; }
  .pager > button { flex: 1 1 100px; min-height: 40px; max-width: 100%; white-space: normal; }
  .pager > span { max-width: 100%; overflow-wrap: anywhere; }
  .filters { gap: 8px; }
  .filters > :is(.field, .fld, .search-input, .searchable-select) { flex: 1 1 160px; max-width: 100%; }
  .filters :is(input, select, .fld) { min-height: 40px; }
  .filters .seg { max-width: 100%; }
  .filters .seg > button { min-height: 36px; }
}

/* Colors and SVGs from the owner's KopirkaCRM-brandbook.html, Visual system 02. */
:root[data-theme]{--bad:var(--crit);--page:#f5f6f8;--surface:#fff;--surface2:#f1f2f4;--ink:#24262b;--ink2:#454a55;--muted:#636b78;--grid:#e0e3e9;--axis:#c9ccd2;--s1:#ff7900;--s1-ink:#a34700;--s1-wash:#fff0e3;--brand:#ff7900;--brand-ink:#a34700;--brand-wash:#fff0e3;--on-brand:#24262b;--good:#136d4a;--good-bg:#e8f5ed;--info:#2457a6;--info-bg:#edf2fc;--warn-ink:#914000;--warn-bg:#fff0e3;--ring:#e0e3e9;--brand-loading:url('/assets/brand-ui_repairs_20260911T220218Z_08d96b00/KopirkaCRM-loading-light.svg')}
:root[data-theme='dark'],:root[data-theme='kopirka-dark']{--page:#15171c;--surface:#1e2128;--surface2:#252a33;--ink:#f5f6f8;--ink2:#c2c8d2;--muted:#a5adbb;--grid:#343944;--axis:#626a78;--s1-ink:#ffab66;--s1-wash:#35281f;--brand-ink:#ffab66;--brand-wash:#35281f;--good:#85dab0;--good-bg:#20382d;--info:#9fc3ff;--info-bg:#24334c;--warn-ink:#ffba80;--warn-bg:#392a1f;--ring:#343944;--brand-loading:url('/assets/brand-ui_repairs_20260911T220218Z_08d96b00/KopirkaCRM-loading-dark.svg')}
:root .btn.pri,:root .seg button.on{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
:root .nav a.on,:root .nav button.on,:root .nav [aria-current='page']{background:var(--brand-wash);color:var(--brand-ink)}
.crm-brand-header{display:block;width:206px;height:46px;object-fit:contain}.crm-brand-dark{display:none}.crm-brand-mobile{display:none}
:root[data-theme='dark'] .crm-brand-light,:root[data-theme='kopirka-dark'] .crm-brand-light{display:none}
:root[data-theme='dark'] .crm-brand-dark,:root[data-theme='kopirka-dark'] .crm-brand-dark{display:block}
.crm-header .logo.crm-brand-icon{background:transparent!important;border:0;box-shadow:none;object-fit:contain;flex-shrink:0}
.crm-login-title img{width:230px;max-width:100%;height:auto;margin:auto}.crm-login-mark:has(.crm-brand-icon){background:transparent!important;box-shadow:none}
.crm-login-logo.crm-brand-icon{object-fit:contain}.crm-brand-loading{min-height:100svh;display:grid;align-content:center;justify-items:center;background:var(--page);color:var(--muted);padding:24px;box-sizing:border-box}.crm-brand-loading img{width:min(280px,80vw);height:auto}.crm-brand-loading p{margin:8px 0;font-size:13px}
:root .spin{border:0!important;border-radius:0;animation:none!important;background:transparent url('/assets/brand-ui_repairs_20260911T220218Z_08d96b00/KopirkaCRM-loader.svg') center/contain no-repeat}
@media(max-width:640px){.crm-header .crm-brand-header{display:none!important}.crm-header .crm-brand-mobile{display:block;width:40px;height:40px}.crm-login-title img{width:210px}}
