:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --ink: #17233a;
  --ink-soft: #5a6b85;
  --line: #dfe5ef;
  --brand: #1f3b5c;
  --brand-soft: #2b5286;
  --accent: #2f6fd0;
  --accent-soft: #eaf1fd;
  --ok: #1f8a5b;
  --ok-soft: #e6f6ee;
  --warn: #b8730a;
  --warn-soft: #fdf2e0;
  --bad: #c0392b;
  --bad-soft: #fdeceb;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(23, 35, 58, .06), 0 10px 30px rgba(23, 35, 58, .05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.mobile-only { display: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 20% -10%, #dce8fb, transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px;
  padding: 30px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-card h1 { font-size: 20px; margin: 18px 0 14px; }
.login-hint { color: var(--bad); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #1f3b5c, #17293f);
  color: #e8eef8; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { font-size: 26px; }
.brand b { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { display: block; font-size: 11.5px; opacity: .7; }
.brand.big { padding: 0 0 6px; }
.brand.big b { color: var(--ink); font-size: 17px; }

#nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
#nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #cddbef; font-size: 14.5px; font-weight: 500;
}
#nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
#nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
#nav a .ico { width: 20px; text-align: center; font-size: 15px; }
#nav a .cnt { margin-left: auto; background: var(--bad); color: #fff; border-radius: 20px;
  padding: 1px 7px; font-size: 11.5px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar .btn { color: #e8eef8; border-color: rgba(255, 255, 255, .28); background: transparent; }
.sidebar .btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.user-chip { font-size: 13px; padding: 6px 8px 10px; color: #e8eef8; }
.user-chip b { display: block; font-size: 14px; }
.user-chip span { opacity: .7; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 16px 26px;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 20px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.view { padding: 22px 26px 60px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c3cee0; background: #f8fafd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2a63ba; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #197a4e; }
.btn.danger { color: var(--bad); border-color: #f0cdc9; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 9px 11px; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- inputs */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .btn:focus-visible {
  outline: 2px solid #b9d1f5; outline-offset: 1px; border-color: var(--accent);
}
.field textarea { min-height: 62px; resize: vertical; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { padding-left: 36px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .5; }

/* ---------------------------------------------------------------- cards / grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select { padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font: inherit; color: var(--ink); }
.grid-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi .card { padding: 16px; }
.kpi .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi .t { color: var(--ink-soft); font-size: 13px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
  background: #f8fafd; font-weight: 650; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
td.right, th.right { text-align: right; }
td.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- tool row */
.tool-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tool-row:last-child { border-bottom: 0; }
.tool-row:hover { background: #fafcff; }
.tool-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700;
  background: var(--accent-soft); color: var(--brand-soft); padding: 4px 8px; border-radius: 8px;
  font-size: 13px; white-space: nowrap; }
.tool-main { min-width: 0; flex: 1; }
.tool-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-main small { color: var(--ink-soft); font-size: 12.5px; display: block; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tool-act { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.stock { background: var(--ok-soft); color: var(--ok); }
.badge.issued { background: var(--warn-soft); color: var(--warn); }
.badge.repair { background: #eef0f6; color: #4c5a75; }
.badge.lost, .badge.overdue { background: var(--bad-soft); color: var(--bad); }
.badge.off { background: #eef0f6; color: #6b7791; }

/* ---------------------------------------------------------------- modal */
.dim { position: fixed; inset: 0; background: rgba(16, 26, 44, .45); z-index: 190;
  backdrop-filter: blur(2px); }
.modal {
  position: fixed; z-index: 200; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(16, 26, 44, .28);
}
.modal.wide { width: min(860px, calc(100vw - 28px)); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.modal-head h3 { font-size: 17px; }
.modal-head .sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.modal-head .x { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--ink-soft); padding: 2px 6px; border-radius: 8px; }
.modal-head .x:hover { background: #f2f4f8; }
.modal-body { padding: 4px 20px 8px; display: flex; flex-direction: column; gap: 13px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px 20px; flex-wrap: wrap; }
.modal-foot .right { margin-left: auto; display: flex; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------------- photos */
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip img, .photo-upload {
  width: 78px; height: 78px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line);
}
.photo-upload { display: grid; place-items: center; color: var(--accent); background: var(--accent-soft);
  cursor: pointer; font-size: 22px; border-style: dashed; }
.photo-upload input { display: none; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 400; display: flex;
  flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #17233a; color: #fff; padding: 11px 15px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(16, 26, 44, .3); animation: fade .2s ease-out; max-width: 380px; }
.toast.err { background: #a2302a; }
.toast.ok { background: #1f7a53; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; color: var(--ink-soft); padding: 40px 10px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .6; }
.muted { color: var(--ink-soft); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.hint { font-size: 12.5px; color: var(--ink-soft); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px;
  font: inherit; color: var(--ink-soft); cursor: pointer; font-weight: 550; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.scan-box { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18% 14%; border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.spec { white-space: pre-line; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

/* ---------------------------------------------------------------- главный поиск */
.hero-search { margin-bottom: 14px; }
.hero-search input {
  width: 100%; height: 56px; font-size: 17px; padding: 0 18px 0 52px;
  border-radius: 16px; border: 2px solid #cfdcf0; background: #fff;
  box-shadow: 0 4px 16px rgba(23, 35, 58, .07); transition: .15s;
}
.hero-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.hero-search .ico { left: 18px; font-size: 18px; opacity: .55; top: 50%; }
.hero-search .counter { position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-soft); background: #f2f5fa; padding: 3px 9px; border-radius: 20px; }

/* ---------------------------------------------------------------- корзина выдачи */
.cart-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: #17233a; color: #fff; border-radius: 16px; box-shadow: 0 16px 40px rgba(16, 26, 44, .35);
  max-width: calc(100vw - 24px);
}
.cart-bar .cb-text { font-size: 14px; }
.cart-bar .cb-text b { font-size: 15px; }
.cart-bar .btn { border-color: rgba(255,255,255,.3); color: #fff; background: rgba(255,255,255,.1); }
.cart-bar .btn.primary { background: var(--accent); border-color: var(--accent); }
.cart-bar .btn:hover { background: rgba(255,255,255,.2); }

/* ---------------------------------------------------------------- мастер выдачи */
.steps { display: flex; gap: 6px; margin: 0 0 14px; }
.steps div { flex: 1; text-align: center; font-size: 12px; color: var(--ink-soft); padding: 7px 4px;
  border-radius: 9px; background: #f2f5fa; }
.steps div.on { background: var(--accent-soft); color: var(--brand-soft); font-weight: 650; }
.steps div.done { background: var(--ok-soft); color: var(--ok); }

.cart-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; }
.cart-item .ci-main { flex: 1; min-width: 0; }
.cart-item .ci-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cart-item .ci-main small { color: var(--ink-soft); font-size: 12px; }
.cart-item .rm { border: 0; background: transparent; color: var(--bad); font-size: 18px; cursor: pointer;
  padding: 0 4px; line-height: 1; }

.suggest { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; margin-top: 6px; }
.suggest button { text-align: left; padding: 9px 11px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; font: inherit; }
.suggest button:hover { background: var(--accent-soft); border-color: #bcd2f3; }
.suggest .s-code { font-family: ui-monospace, Consolas, monospace; font-weight: 700; margin-right: 8px; }
.suggest .s-cat { color: var(--ink-soft); font-size: 12px; }

/* ---------------------------------------------------------------- комплекты в «кто что держит» */
.batch { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; }
.batch-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; }
.batch-head .bh-main { flex: 1; min-width: 180px; }
.batch-head .bh-main b { font-size: 15px; }
.batch-head .bh-main small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.batch-body .tool-row { padding: 9px 14px; }
.batch-empty { padding: 12px 14px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- список: миниатюры и группы */
.hero-search .scan-inside { position: absolute; right: 108px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--accent-soft); color: var(--brand-soft); width: 36px; height: 36px;
  border-radius: 10px; cursor: pointer; font-size: 16px; }
.hero-search .scan-inside:hover { background: #dbe8fb; }
.tool-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); background: #fff; }
.tool-thumb.no-photo { display: grid; place-items: center; font-size: 18px; opacity: .45; background: #f7f9fc; }
.tick { display: flex; align-items: center; padding-right: 2px; }
.tick input { width: 17px; height: 17px; cursor: pointer; }
.group-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: #eef3fb; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--brand-soft); text-transform: uppercase; letter-spacing: .04em; }
.group-head .hint { margin-left: auto; text-transform: none; letter-spacing: 0; }
.bulk-bar { position: sticky; top: 62px; z-index: 15; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 10px; border-radius: 12px; background: #17233a; color: #fff;
  box-shadow: 0 8px 24px rgba(16, 26, 44, .25); flex-wrap: wrap; }
.bulk-bar .hint { color: #cdd8ea; }
.bulk-bar .btn { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.08); }
.bulk-bar .btn:hover { background: rgba(255,255,255,.18); }
.bulk-bar .btn.danger { color: #ffb4aa; border-color: rgba(255,120,100,.45); }

/* ---------------------------------------------------------------- галерея */
.gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.gal-item { position: relative; width: 108px; }
.gal-item img { width: 108px; height: 108px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; display: block; }
.gal-meta { font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 4px; line-height: 1.25; }
.gal-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--bad); cursor: pointer; line-height: 1;
  font-size: 14px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.gal-del:hover { background: var(--bad-soft); }

/* ---------------------------------------------------------------- меню действий */
.menu { position: absolute; right: 18px; margin-top: 46px; z-index: 40; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(16,26,44,.18);
  padding: 6px; min-width: 190px; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--ink); }
.menu-item:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------------- карточка товара */
.prod-card { padding: 18px; }
.prod-grid { display: grid; grid-template-columns: 78px minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.prod-thumbs { display: flex; flex-direction: column; gap: 8px; }
.thumb-wrap { position: relative; }
.prod-thumbs .thumb-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--bad); cursor: pointer;
  font-size: 13px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.12); display: none; }
.thumb-wrap:hover .thumb-del { display: block; }
.prod-thumbs .thumb { width: 72px; height: 72px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: #fff; cursor: pointer; }
.prod-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-thumbs .thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.prod-thumbs .thumb.add { display: grid; place-items: center; border-style: dashed; color: var(--accent);
  font-size: 22px; background: #fbfcfe; }
.prod-thumbs .thumb.add:hover { background: var(--accent-soft); }

.prod-main { min-width: 0; }
.prod-photo { display: grid; place-items: center; min-height: 320px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; padding: 12px; }
.prod-photo img { max-width: 100%; max-height: 380px; object-fit: contain; }
.prod-photo-empty { display: grid; place-items: center; gap: 8px; color: var(--ink-soft); font-size: 40px; }
.prod-photo-empty span { font-size: 13px; }
.prod-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.prod-spec { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.prod-spec-head { margin-bottom: 6px; }
.spec-text { font-size: 14px; white-space: pre-line; line-height: 1.5; }
.spec-text.is-empty { color: var(--ink-soft); font-style: italic; }
.prod-spec-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.prod-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 16px;
  border-top: 1px solid var(--line); padding-top: 14px; font-size: 13.5px; }
.prod-meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prod-meta b { font-weight: 600; overflow-wrap: anywhere; }

.prod-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 78px; }
.prod-price, .prod-link { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfcfe; }
.price-big { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0 2px; }
.prod-side-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.prod-side-actions .btn { width: 100%; justify-content: center; }
.link-url { font-size: 13px; word-break: break-all; margin-top: 2px; }
.link-url a { text-decoration: underline; }
.side-input { display: flex; flex-direction: column; align-items: stretch;
  gap: 6px; margin-top: 8px; }
.side-input input { width: 100%; box-sizing: border-box; }
.side-input .btn { width: 100%; justify-content: center; }
.side-input .hint { margin-top: 2px; }
.side-input input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; }
.menu-sep { font-size: 11.5px; color: var(--ink-soft); padding: 8px 12px 4px; text-transform: uppercase;
  letter-spacing: .04em; }

@media (max-width: 1180px) {
  .prod-grid { grid-template-columns: 70px minmax(0, 1fr); }
  .prod-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; position: static; }
  .prod-side > div { flex: 1 1 260px; }
}
@media (max-width: 760px) {
  .prod-grid { grid-template-columns: 1fr; }
  .prod-thumbs { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .prod-thumbs .thumb { width: 62px; height: 62px; flex: 0 0 auto; }
  .prod-photo { min-height: 220px; }
  .prod-meta { grid-template-columns: 1fr 1fr; }
  .price-big { font-size: 26px; }
}

/* ---------------------------------------------------------------- фото инструмента */
.photo-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfe;
  margin-top: 14px; }
.photo-box .pb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.photo-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.photo-row img.tool-photo { width: 150px; height: 150px; object-fit: contain; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; }
.photo-empty { width: 150px; height: 150px; border-radius: 12px; border: 1px dashed #c3cfe2;
  display: grid; place-items: center; font-size: 32px; opacity: .5; background: #fff; }
.photo-row .btn.small { width: 100%; }

/* ---------------------------------------------------------------- ссылка на товар */
.link-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfcfe;
  margin-top: 14px; }
.link-box .lb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.link-box .lb-url { font-size: 13px; word-break: break-all; }
.link-box .lb-url a { text-decoration: underline; }
.link-box .lb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.badge.link-ok { background: var(--ok-soft); color: var(--ok); }
.badge.link-wait { background: var(--warn-soft); color: var(--warn); }
.badge.link-no { background: #eef0f6; color: #6b7791; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .cart-bar { bottom: 10px; left: 10px; right: 10px; transform: none; max-width: none; }
  .hero-search input { height: 48px; font-size: 15.5px; }
}

/* ---------------------------------------------------------------- labels */
.labels { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.label-card { border: 1px dashed #b9c4d6; border-radius: 12px; padding: 10px; background: #fff;
  display: flex; gap: 10px; align-items: center; break-inside: avoid; }
.label-card .qr { width: 84px; height: 84px; flex-shrink: 0; }
.label-card .qr svg { width: 100%; height: 100%; display: block; }
.label-card .lb-code { font-weight: 800; font-size: 15px; font-family: ui-monospace, Consolas, monospace; }
.label-card .lb-name { font-size: 11.5px; color: var(--ink-soft); line-height: 1.3; margin-top: 2px; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toolbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .view { padding: 0; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .label-card { border: 1px solid #999; }
}

@media (min-width: 861px) {
  .mobile-only { display: none !important; }
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 264px; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-flex; }
  .view { padding: 14px 12px 80px; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { font-size: 17px; flex: 1 1 auto; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .topbar-actions .btn { flex: 1; justify-content: center; }
  .row2 { grid-template-columns: 1fr; }
  .tool-row { flex-wrap: wrap; }
  .tool-act { width: 100%; }
  .tool-act .btn { flex: 1; justify-content: center; }
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 92vh;
    border-radius: 18px 18px 0 0; }
  table { font-size: 13px; }
  th, td { padding: 9px 8px; }
}

/* ---------------------------------------------------------------- обновления */
.upd-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fbfcfe; }
.upd-card.new { border-color: #bcd8ff; background: #f4f9ff; }
.upd-card b { font-size: 14px; display: block; margin-bottom: 4px; }
/* ---------------------------------------------------------------- финансы */
.fin-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-kpi-item { background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fin-kpi-item .t { display: block; font-size: 12px; color: var(--soft); }
.fin-kpi-item b { display: block; font-size: 18px; letter-spacing: -.02em; margin: 2px 0; }
.fin-kpi-item b.bad { color: var(--bad); }
.fin-kpi-item small { color: var(--soft); font-size: 11.5px; }
.fin-kpi-item.total { background: #eef4fd; border-color: #c9dcf7; }
.fin-table td, .fin-table th { white-space: nowrap; }
.fin-table tfoot td { border-top: 2px solid var(--line); background: #f8fafd; }
/* ---------------------------------------------------------------- подключение телефона */
.qr { width: 200px; flex: 0 0 auto; }
.qr svg { width: 180px; height: 180px; display: block; margin: 0 auto; }
@media (max-width: 640px) { .qr { width: 100%; } .qr svg { width: 220px; height: 220px; } }
/* ---------------------------------------------------------------- логотип */
.brand-name { font-size: 12.5px; font-weight: 700; color: #fff; line-height: 1.25; letter-spacing: -.01em; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 18px; }
.brand-mark { font-size: 22px; }
@media (max-width: 1180px) { .brand-name { font-size: 13.5px; } }
/* ---------------------------------------------------------------- карточка-оверлей */
.overlay-open { overflow: hidden; }
.tool-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(16, 26, 44, .55);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.tool-overlay-panel { position: relative; width: min(1120px, 100%); }
.tool-overlay-close { position: fixed; top: 18px; right: 22px; z-index: 90; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: #fff; font-size: 24px; line-height: 1; color: var(--soft);
  box-shadow: 0 6px 20px rgba(16,26,44,.25); cursor: pointer; }
.tool-overlay-close:hover { color: var(--ink); }

.tool-line { display: flex; align-items: baseline; gap: 12px; }
.tool-line b { font-size: 14.5px; }
.tool-price { margin-left: auto; font-weight: 700; white-space: nowrap; color: var(--ink); }

/* ---------------------------------------------------------------- фото на весь экран */
.photo-view { position: fixed; inset: 0; z-index: 120; background: rgba(8, 14, 26, .92);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.photo-view img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 10px; }
.photo-close { position: fixed; top: 16px; right: 20px; width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); font-size: 24px; cursor: pointer; }

.tool-thumb { cursor: zoom-in; }
/* ---------------------------------------------------------------- список на подтверждение */
.pending-list { display: flex; flex-direction: column; }
.pending-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.pending-row:hover { background: #f8fafd; }
.pending-name { flex: 1; min-width: 0; }
.pending-name b { display: block; font-size: 14px; font-weight: 600; }
.pending-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.pending-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.pending-row .tool-code { flex: 0 0 auto; }

/* выпадающее меню поверх карточки, не обрезается контейнером */
.menu.floating { position: fixed; right: auto; margin-top: 0; z-index: 250; max-height: 72vh; overflow-y: auto; }


/* блок «нельзя заказать» в корзине */
.manual-block { margin-top: 18px; border-top: 2px solid #f1cdc8; padding-top: 14px; }
.manual-head { background: var(--bad2); color: #8a2b21; border: 1px solid #f1cdc8;
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 12px; }
.manual-head b { color: var(--bad); }


/* текущие цены поставщиков под ценой закупа */
.price-current { font-size: 11.5px; color: var(--soft); line-height: 1.5; margin: 4px 0 6px; }
.price-current b { color: var(--ink); font-weight: 600; }


/* скачивание приложений в сайдбаре */
.dl-block { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.dl-btn { display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: #dbe4f0; font-size: 11.5px;
  line-height: 1.25; text-align: left; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s; font-family: inherit; }
.dl-btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.3); }
.dl-ico { font-size: 15px; flex: none; }

.copyright { font-size: 10.5px; color: #7f8ea6; line-height: 1.4;
  padding: 8px 0 10px; border-top: 1px solid rgba(255,255,255,.07); margin-bottom: 8px; }
.copyright a { color: #9db4d6; text-decoration: none; border-bottom: 1px dotted #5b6f8e; }
.copyright a:hover { color: #fff; border-bottom-color: #9db4d6; }


/* «Запомнить меня» на входе */
.check { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px;
  font-size: 13px; color: var(--soft); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }


/* ---------- наклейки: правка на месте и предпросмотр ---------- */
.label-card { flex-direction: column; align-items: stretch; gap: 8px; }
.lb-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lb-preview .lb-code-input { text-align: center; }
.lb-preview .lb-name-input { text-align: center; }
.lb-qr { margin: 2px auto; }
.lb-preview .qr { flex: none; }
.lb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-code-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 7px; font: 700 13px ui-monospace, Consolas, monospace; }
.lb-name-input { width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 7px; font: 11.5px/1.3 "Segoe UI", system-ui, sans-serif;
  color: var(--ink-soft); resize: vertical; min-height: 46px; }
.lb-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lb-tools select { flex: 1; min-width: 110px; padding: 5px 7px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px; background: #fff; }

.label-preview { display: flex; justify-content: center; padding: 8px 0 12px; }
.label-mock { display: flex; gap: 8px; align-items: center; border: 1px dashed #b9c4d6;
  border-radius: 8px; padding: 8px; background: #fff; }
.label-mock-qr svg { width: 100%; height: 100%; display: block; }
.label-mock-code { font: 800 15px ui-monospace, Consolas, monospace; line-height: 1.1; }
.label-mock-name { color: var(--ink-soft); line-height: 1.2; margin-top: 3px;
  white-space: pre-wrap; word-break: break-word; }

@media print {
  .labels { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label-card { border: 1px solid #999; padding: 4mm; }
  .lb-code-input, .lb-name-input, .lb-tools { display: none; }
  .label-card .lb-code { display: block; }
  .label-card .lb-name { display: block; }
}


/* панель шаблонов наклеек */
.tpl-bar { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.tpl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tpl-row input, .tpl-row select { padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; background: #fff; }
.tpl-row input { min-width: 220px; flex: 1; }
.tpl-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; font-size: 12px; }
.tpl-x { border: none; background: none; cursor: pointer; color: var(--bad); font-size: 14px;
  line-height: 1; padding: 0 2px; }
.label-mock { flex-direction: column; align-items: center; text-align: center;
  padding: 10px 12px; box-sizing: border-box; }
.label-mock-code { text-align: center; }


/* предпросмотр массовых операций */
.pv-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  margin: 10px 0 4px; background: #fbfcff; }
.pv-head { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; background: #f4f8ff; }
.pv-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 12px;
  border-bottom: 1px solid #eef2f8; font-size: 13px; }
.pv-row:last-child { border-bottom: none; }
.pv-num { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid;
  place-items: center; font-size: 12px; font-weight: 700; }
.pv-num.ok { background: #e6f6ec; color: #1f7a45; }
.pv-num.skip { background: #fdecea; color: #b2362a; }
.pv-list { padding: 0 12px 6px; }
.pv-list .pv-row { padding: 6px 0; border-bottom: none; font-size: 12.5px; color: var(--soft); }
.pv-reason { color: #b2362a; font-size: 12px; margin-top: 2px; }


/* массовый выбор инструмента */
.sel-all { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer;
  font-size: 13px; color: var(--ink-soft); }
.sel-all input { width: 16px; height: 16px; accent-color: var(--brand); }
.sel-all:hover { background: #f7f9fc; }

.sel-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--soft); background: #f4f8ff; border: 1px solid #dbe6f8;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.sel-hint.hidden { display: none; }

.tool-tr.picked { background: #eef4ff; }
.tool-tr .tick { width: 30px; justify-content: center; }
.tool-tr .tick input { width: 19px; height: 19px; accent-color: var(--brand); }


/* ---------- чипы статусов и таблица склада ---------- */
.status-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 7px 13px; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.chip b { color: var(--ink); font-weight: 700; margin-left: 4px; }
.chip:hover { background: #f6f9ff; }
.chip.active { background: #e8f0ff; border-color: #b9cdf5; color: var(--brand2); }
.chip.active b { color: var(--brand2); }

.tools-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  overflow: auto; max-height: calc(100vh - 250px); }
.tools-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tools-table thead th { position: sticky; top: 0; z-index: 5; background: #fafcff;
  text-align: left; font-weight: 600; color: var(--soft); font-size: 12.5px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tools-table tbody td { padding: 8px 12px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.tools-table tbody tr:hover { background: #f7faff; }
.tools-table .chk { width: 38px; text-align: center; }
.tools-table .col-name { min-width: 280px; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-text { min-width: 0; }
.name-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 46ch; }
.name-text small { color: var(--soft); font-size: 12px; }
.tools-table .tool-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover;
  flex: none; }
.tools-table .tool-thumb.no-photo { display: grid; place-items: center; background: #eef2f8;
  font-size: 16px; }
.tools-table .st-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  font-weight: 600; }
.tools-table .st-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.tools-table .muted { color: #9aa7b8; }
.tools-table .col-act { text-align: right; }
.table-foot { padding: 9px 14px; color: var(--soft); font-size: 12.5px; }


/* заголовки групп в таблице */
.tools-table .group-row td { background: #eef3fa; padding: 7px 12px; border-bottom: 1px solid var(--line);
  position: sticky; top: 37px; z-index: 4; }
.tools-table .group-row .gname { font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  text-transform: uppercase; color: #47597a; }
.tools-table .group-row .gcount { float: right; color: var(--soft); font-size: 12px; font-weight: 600; }
.tools-table thead th { position: sticky; top: 0; z-index: 6; }


.labels-more { display: flex; justify-content: center; margin: 14px 0 4px; }
.pv-note { padding: 9px 12px; background: #fff8e6; border-bottom: 1px solid #f0d9a8;
  color: #7a5a10; font-size: 12.5px; }


/* печать листом A4 */
.a4-preview-box { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #f7faff; font-size: 13px; line-height: 1.6; }


.a4-grid-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 700px) { .a4-grid-fields { grid-template-columns: repeat(2, 1fr); } }


/* отчёт по маркировке */
.mk-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.mk-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.mk-tile b { font-size: 26px; display: block; margin-top: 4px; }
.mk-tile.good b { color: #1a7f37; }
.mk-tile.warn b { color: #b54708; }
.mk-bar { height: 8px; background: #e6ecf5; border-radius: 5px; margin-top: 8px; overflow: hidden; }
.mk-bar span { display: block; height: 100%; background: #1f6feb; }
.mk-cats td.num, .mk-cats th.num { text-align: right; }
.mk-cats .okc { color: #1a7f37; font-weight: 700; }
.mk-row { cursor: pointer; }
.mk-row:hover td { background: #f6f9ff; }
.mk-ico { display: inline-block; width: 30px; height: 30px; margin-right: 8px; vertical-align: middle; }
.mk-ico img { width: 30px; height: 30px; object-fit: contain; }
.chip.ok { background: #e8f5ec; color: #1a7f37; border-color: #bfe3c8; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }


.thumb-wrap { position: relative; }
.thumb-cap { display: block; font-size: 10px; color: var(--soft); text-align: center;
  margin-top: 2px; max-width: 64px; line-height: 1.2; }


/* NAV_ICON_CSS — иконки в меню */
#nav a .ico { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex: 0 0 22px; }
#nav a .ico svg { width: 20px; height: 20px; opacity: .85; }
#nav a.active .ico svg, #nav a:hover .ico svg { opacity: 1; }


/* журнал действий */
.journal-table td { vertical-align: top; }
.journal-table .nowrap { white-space: nowrap; color: var(--soft); }
.j-act { display: inline-block; padding: 2px 9px; border-radius: 20px; background: #eef3fb; font-size: 12px; }
.jf-period { display: flex; gap: 6px; }
.view-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.view-row .view-name { font-weight: 600; }
.col-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.col-row .col-pos { width: 18px; color: var(--soft); text-align: right; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brand); }


/* сотрудники */
.emp-table td { vertical-align: middle; }
.emp-row { cursor: pointer; }
.emp-row:hover td { background: #f6f9ff; }
.emp-name { display: flex; align-items: center; gap: 10px; }
.emp-ava { width: 34px; height: 34px; border-radius: 50%; background: #eaf1fb; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.emp-name small { display: block; color: var(--soft); font-size: 11.5px; }
.emp-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.emp-st { background: #f7fafe; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.emp-st span { display: block; font-size: 11.5px; color: var(--soft); }
.emp-st b { font-size: 20px; }
.emp-st.warn b { color: #b54708; }
.emp-st.bad b { color: #b42318; }
.emp-h { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); }
.emp-inner { font-size: 13px; }
.emp-hist-wrap { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }

/* поиск в тулбаре — не сжимается */
.toolbar .search { min-width: 240px; flex: 1 1 240px; }


/* справочники */
.ref-list { display: flex; flex-direction: column; gap: 2px; }
.ref-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ref-row .ref-name { flex: 1; min-width: 120px; border: 1px solid transparent; background: transparent;
  padding: 7px 8px; border-radius: 8px; font-size: 13.5px; }
.ref-row .ref-name:hover, .ref-row .ref-name:focus { border-color: var(--line); background: #fff; }
.ref-row .ref-addr { width: 170px; border: 1px solid transparent; background: transparent;
  padding: 7px 8px; border-radius: 8px; font-size: 12.5px; color: var(--soft); }
.ref-row .ref-addr:hover, .ref-row .ref-addr:focus { border-color: var(--line); background: #fff; color: #17202a; }
.ref-add { display: flex; gap: 8px; margin-top: 12px; }
.ref-add input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-chip { padding: 5px 11px; border-radius: 20px; background: #eef3fb; font-size: 12.5px; }


/* аватары сотрудников */
.emp-ava { overflow: hidden; flex: 0 0 auto; }
.emp-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emp-ava.big { width: 64px; height: 64px; font-size: 20px; }
.emp-head { display: flex; align-items: center; gap: 14px; }
.emp-photo-btns { display: flex; gap: 6px; margin-top: 6px; }


/* роли и права */
.roles-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .roles-wrap { grid-template-columns: 1fr; } }
.role-items { display: flex; flex-direction: column; gap: 4px; }
.role-item { text-align: left; border: 1px solid transparent; background: transparent; padding: 9px 11px;
  border-radius: 10px; cursor: pointer; }
.role-item b { display: block; font-size: 13.5px; }
.role-item small { color: var(--soft); font-size: 11.5px; }
.role-item:hover { background: #f4f8ff; }
.role-item.on { background: #eaf1fb; border-color: #cfdff7; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
@media (max-width: 700px) { .perm-grid { grid-template-columns: 1fr; } }
.perm-group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--soft); margin-bottom: 4px; }
.perm-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.perm-row input { width: 16px; height: 16px; }

.ref-row .ref-prefix { width: 64px; text-align: center; border: 1px solid transparent;
  background: transparent; padding: 7px 6px; border-radius: 8px; font-size: 12.5px;
  color: var(--brand); font-weight: 700; text-transform: uppercase; }
.ref-row .ref-prefix:hover, .ref-row .ref-prefix:focus { border-color: var(--line); background: #fff; }

.lb-tools .btn.small { padding: 7px 10px; gap: 6px; line-height: 1; }
.lb-print { display: inline-flex; align-items: center; white-space: nowrap; }
.lb-print svg { flex: 0 0 14px; }
.lb-tools .hint { min-width: 0; }
