/* UI polish 0.21.0 — loaded last. One consistent layer for buttons, badges, icons,
   dialogs and narrow screens instead of the accumulated per-release overrides.
   Rule: labels never wrap inside a button or badge; whole buttons wrap instead. */

/* ---------- Form controls: one look for every field and dropdown ----------
   Plain selects, searchable selects and text fields share height, border, font,
   chevron and focus ring. Plain selects open the same list as the searchable ones
   (dist/select-menu.js); phones keep the native picker. */
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea,.search-select .search-select__input{border:1px solid #d6dbe4;border-radius:7px;background-color:#fff;color:var(--ink);font-size:13px;line-height:1.45}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,.search-select .search-select__input{min-height:42px}
input::placeholder,textarea::placeholder,.search-select .search-select__input::placeholder{color:#7a8597;opacity:1}
input[type=date]{height:42px}
select:not([multiple]){appearance:none;-webkit-appearance:none;padding-right:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%2369778e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;background-size:18px 18px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;cursor:pointer}
select:not([multiple]):hover,.search-select .search-select__input:hover{border-color:#b9c0d4}
select.is-menu-open{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 12 4-4 4 4' stroke='%233a3c82' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
select:disabled,.search-select.is-disabled .search-select__input{background-color:#f4f5f8;color:#7b879a;cursor:not-allowed}
input:focus,input:focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible,.search-select .search-select__input:focus,select.is-menu-open{outline:none;border-color:#7d7fca;box-shadow:0 0 0 3px #3a3c821c}
.file-picker:focus-within{outline:none;box-shadow:0 0 0 3px #3a3c821c}
.search-select__toggle{top:1px;right:1px;height:40px;width:32px;color:#69778e}
.search-select__toggle svg{width:18px;height:18px}
.search-select__clear{top:1px;right:33px;height:40px}
.search-select.is-open .search-select__toggle{color:var(--blue)}
/* The list: same panel, font and highlight for searchable and plain dropdowns. */
.search-select__popup{font-size:13px;padding:5px;border-color:#dfe3ec;box-shadow:0 12px 32px #1a1d4a1f}
.search-select__status{font-size:12px;padding:8px 10px}
.search-select__option{padding:8px 10px;line-height:1.4;font-size:13px}
.select-menu .search-select__option{display:flex;align-items:center;gap:6px;padding-left:6px}
.select-menu__check{width:18px;height:18px;flex:0 0 18px;color:var(--blue)}
.select-menu__check svg{width:18px;height:18px;display:block}
.select-menu .is-selected{font-weight:600;color:#34367b}
.search-select__option.is-disabled{opacity:.45;cursor:default}
.search-select__option.is-disabled:hover{background:transparent;color:inherit}

/* ---------- Buttons ---------- */
.btn{min-height:38px;padding:8px 14px;gap:8px;border-radius:7px;font-size:13px;font-weight:550;line-height:1.2;white-space:nowrap;flex-shrink:0;max-width:100%;overflow:hidden;transition:background-color .15s,border-color .15s,color .15s}
.btn.sm{min-height:32px;padding:6px 11px;font-size:12px;gap:6px}
.btn svg{width:16px;height:16px;flex:0 0 auto;stroke-width:1.9}
.btn.sm svg{width:15px;height:15px}
.btn:disabled,.btn[disabled]{opacity:.55;cursor:not-allowed}
.btn.danger{color:#b4232c;border-color:#efcbcf;background:#fff}
.btn.danger:hover{background:#fdf2f3;border-color:#e3a7ad}
.btn.soft:hover{background:#e6e7f5}
.text-btn{white-space:nowrap;gap:6px}
.text-btn svg{width:15px;height:15px;stroke-width:1.9}
.actions,.row-actions{gap:8px}
/* Lists of commands that are meant to read as menu rows keep wrapping text. */
.tester-actions .btn,.tg-secondary .btn,.profile-popover .text-btn,.demo-links .text-btn,.scope-actions .text-btn{white-space:normal}

/* ---------- Badges, tabs, counters ---------- */
.badge{white-space:nowrap;min-height:22px;padding:3px 8px;border-radius:5px;font-size:11.5px;line-height:1.3;font-weight:550}
.tab{white-space:nowrap}
.tabs{overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}

/* ---------- Icons ---------- */
.nav-item svg{width:18px;height:18px;flex:0 0 auto;stroke-width:1.85}
.icon-btn{min-width:36px;min-height:36px;padding:8px;color:#4d5a70;border-radius:8px}
.icon-btn svg{width:19px;height:19px;stroke-width:1.85}
.icon-btn:hover{background:#eef0f7;color:var(--blue)}
.metric-icon svg{width:17px;height:17px;stroke-width:1.9}
.device-icon{background:#f1f1f9;color:#4f529a}
.device-icon svg{width:21px;height:21px;stroke-width:1.75}
.top-actions{gap:6px}
.icon-btn.notify{position:relative}
/* The counter sits on the bell's corner without covering the bell. */
.notification-count{position:absolute;top:1px;right:-3px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;font-size:9.5px;font-weight:650;line-height:16px;text-align:center;box-shadow:0 0 0 2px #fff}

/* ---------- Profile menu ---------- */
.profile-popover .text-btn{gap:10px;align-items:center}
.profile-popover .text-btn svg{width:16px;height:16px;flex:0 0 auto;color:#6b7186;stroke-width:1.85}
.profile-popover .text-btn:hover svg{color:var(--blue)}

/* ---------- Page heads and toolbars ---------- */
.page-head>.actions{gap:8px}
.filter-row .text-btn,.toolbar>.text-btn{padding:0 4px}

/* Filter reset sits at the end of the filter grid, level with the fields. */
.employee-list-controls>.text-btn{grid-column:-2/-1;justify-self:end;align-self:center}
@media(min-width:761px){.employee-list-controls>.text-btn{margin-top:24px}}

/* ---------- Dialog language switch: compact RU / UZ next to the close button ---------- */
#drawer .language-switch,#modal .language-switch{padding:2px;gap:2px}
#drawer .language-button,#modal .language-button{font-size:0;min-height:26px;padding:4px 8px}
#drawer .language-button::after,#modal .language-button::after{content:attr(data-language);font-size:11px;font-weight:650;letter-spacing:.05em;text-transform:uppercase}
.drawer-head{position:relative;max-height:none;overflow:visible;z-index:3}
.drawer-language{position:absolute;top:24px;right:66px;margin:0}
.drawer-title-row .grow{padding-right:92px}
.modal-head{position:relative;padding-right:150px}
.modal-head>.actions{position:absolute;top:50%;right:16px;transform:translateY(-50%);margin:0;flex-wrap:nowrap;gap:8px}
.modal-head>.actions>.icon-btn{position:static}
.modal-head h2{padding-right:0}

/* ---------- Drawer actions and the «Ещё» menu (dist/ui.js) ---------- */
.drawer-head>.actions{gap:8px;align-items:center}
.drawer-head>.actions>.btn{flex:0 0 auto}
.action-menu{position:relative}
.action-menu>summary{list-style:none;cursor:pointer}
.action-menu>summary::-webkit-details-marker{display:none}
.action-menu[open]>summary{background:#f4f4fa;border-color:#c9cbe6}
.action-menu-list{position:absolute;z-index:20;top:calc(100% + 6px);right:0;min-width:240px;max-width:min(320px,80vw);padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 32px #1a1d4a1f;display:grid;gap:2px}
.action-menu-list>.btn{justify-content:flex-start;width:100%;border-color:transparent;background:transparent;min-height:36px;white-space:normal;text-align:left}
.action-menu-list>.btn:hover{background:#f4f4fa}
.action-menu-list>.btn.primary{color:var(--blue);background:transparent}
.action-menu-list>.btn.danger{color:#b4232c}
.action-menu-list>.btn:not(.danger)+.btn.danger{margin-top:5px;position:relative}
.action-menu-list>.btn:not(.danger)+.btn.danger::before{content:'';position:absolute;left:6px;right:6px;top:-4px;border-top:1px solid var(--line)}
.action-menu-list>.btn.danger:hover{background:#fdf2f3}

/* ---------- Modal footer ---------- */
.modal-footer{gap:8px;align-items:center}
.modal-footer>.btn{flex:0 0 auto}

/* ---------- Equipment cards (Моя техника) ---------- */
.equipment-card .actions .btn{flex:1 1 auto}

/* ---------- Tablet ---------- */
@media(max-width:1000px){
 .page-head>.actions{max-width:100%}
}

/* ---------- Phone ---------- */
@media(max-width:640px){
 .page-head>.actions>.btn{flex:1 1 auto}
 .drawer-head>.actions>.btn,.drawer-head>.actions>.action-menu{flex:1 1 auto}
 .drawer-head>.actions>.action-menu>summary{width:100%}
 .modal-head{padding-right:132px}
 .modal-footer{flex-direction:column-reverse;align-items:stretch}
 .modal-footer>.btn{width:100%;flex:none}
 .employee-record-actions>.btn{flex:1 1 auto}
 .equipment-card .actions{flex-direction:column;align-items:stretch}
 .top-actions{gap:6px}
 /* Compact RU / UZ in the phone top bar as well, so the icons get room. */
 .top-actions .language-button{font-size:0;min-height:28px;padding:4px 7px}
 .top-actions .language-button::after{content:attr(data-language);font-size:11px;font-weight:650;letter-spacing:.05em;text-transform:uppercase}
 .top-actions .icon-btn{min-width:34px;min-height:34px;padding:7px}
}

/* Telegram notifications switch in «Защита входа» */
.tg-notify{margin:18px 0 4px;padding:14px 16px;border:1px solid var(--line);border-radius:9px;background:#fafbfd}
.tg-notify .check-row{font-weight:600;gap:10px;align-items:center}
.tg-notify .hint{margin:8px 0 0 27px}
