/* ───────── Основа ───────── */
:root {
  --bg: #f1f4f2;
  --surface: #ffffff;
  --ink: #17211f;
  --muted: #5b6866;
  --line: #d7dfdc;
  --navy: #0e6762;          /* основной цвет действий */
  --navy-hover: #0a504c;
  --side: #12302f;          /* боковое меню */
  --side-ink: #c4d8d5;
  --side-hover: #1b4543;
  --mark: #e5a823;          /* отметка активного раздела */
  --link: #0b6a8a;
  --focus: #1a73c9;
  --danger: #b3261e;

  /* Цвет статуса — главный носитель смысла в интерфейсе */
  --st-new: #b86a00;
  --st-assigned: #2563c9;
  --st-in_progress: #0c8465;
  --st-closed: #6b7785;

  --radius: 8px;
  --gap: 16px;
  --field-h: 42px;          /* высота всех полей и основных кнопок */
  --side-w: 264px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin-bottom: 12px; }
p { margin: 0 0 12px; }
.muted, .hint, .sub { color: var(--muted); }
.hint { font-size: 0.86rem; }
.sub { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ───────── Каркас: меню слева, содержимое справа ───────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--side); color: var(--side-ink);
}
.brand {
  display: block; padding: 22px 22px 18px; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.side-nav { flex: 1; padding: 10px 12px 16px; }
.nav-group { margin-top: 14px; }
.nav-group-title { padding: 0 10px 6px; font-size: 0.8rem; color: #8eaaa6; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 1px 0;
  color: var(--side-ink); text-decoration: none; border-radius: var(--radius);
  border-left: 3px solid transparent;
}
.side-nav a svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover { background: var(--side-hover); color: #fff; }
.side-nav a.active { background: var(--side-hover); color: #fff; border-left-color: var(--mark); font-weight: 600; }
.side-nav .count-badge { margin-left: auto; }
.side-user { padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-user-row { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; margin-bottom: 10px; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  background: #2b5e5a; color: #fff;
}
.side-user-name { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.side-user-role { font-size: 0.82rem; color: #8eaaa6; }
.side-user form { margin: 0; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.1); }

.mobile-bar { display: none; }
.scrim { display: none; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 30px 36px 64px; }
body.anon .container { max-width: 520px; padding-top: 48px; }
.anon-brand { text-align: center; font-weight: 700; font-size: 1.3rem; margin: 40px 0 0; }

/* ───────── Кнопки ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--field-h); font: inherit; font-weight: 600; line-height: 1.2;
  padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
}
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.88rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: #b4c0bd; }
.btn-ghost:hover { background: #eef3f1; }
.btn-link-danger { background: none; color: var(--danger); border-color: transparent; }
.btn-link-danger:hover { background: #fbeceb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d17; }
.btn:disabled, .btn.is-busy { opacity: 0.6; cursor: progress; }

/* ───────── Карточки и сообщения ───────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: var(--gap);
}
.flash {
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: var(--gap);
  border: 1px solid; background: var(--surface);
}
.flash ul { margin: 0; padding-left: 18px; }
.flash.ok { border-color: #9bd0b5; background: #eaf7f0; color: #0f5b38; }
.flash.err { border-color: #eab0ac; background: #fdeeed; color: #8f1d17; }
.flash.warn { border-color: #e6cf93; background: #fff7e0; color: #6b4a00; }

.page-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--gap); flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.back { margin-bottom: 8px; font-size: 0.9rem; }

/* ───────── Формы: все поля одной высоты и на всю ширину колонки ───────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1 1 240px; }
.field label { font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; width: 100%;
  border: 1px solid #a9b6b3; border-radius: var(--radius); padding: 0 12px;
}
input:not([type="checkbox"]):not([type="radio"]), select { height: var(--field-h); }
select { padding-right: 8px; }
textarea { padding: 10px 12px; min-height: 130px; resize: vertical; }
input[type="file"] { padding: 6px 8px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input[readonly] { background: #f3f6f5; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-wide { max-width: 820px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form-inline-actions { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.form-inline-actions a { font-size: 0.9rem; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1 1 auto; }
.input-with-btn .btn { flex: none; }
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rename-form form { margin: 0; }
/* Компактные поля внутри таблиц */
.rename-form input, .rename-form select, table.list input, table.list select { height: 34px; padding: 0 10px; }
.rename-form input { max-width: 320px; }
.rename-form select { width: auto; min-width: 160px; }
.upload-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-input { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

/* ───────── Вход и регистрация ───────── */
.auth-card { max-width: 440px; margin: 24px auto; }
.auth-card h1 { margin-bottom: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; font-size: 0.92rem; }
.error-card { text-align: center; }
.error-code { font-size: 3rem; font-weight: 700; color: var(--muted); margin: 0; line-height: 1; }
.error-card h1 { margin: 10px 0 18px; font-size: 1.25rem; }

/* ───────── Статусы ───────── */
.chip {
  display: inline-block; font-size: 0.82rem; font-weight: 650; line-height: 1.3;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  color: var(--st); background: color-mix(in srgb, var(--st) 13%, #fff);
  border: 1px solid color-mix(in srgb, var(--st) 35%, #fff);
}
.s-new { --st: var(--st-new); }
.s-assigned { --st: var(--st-assigned); }
.s-in_progress { --st: var(--st-in_progress); }
.s-closed { --st: var(--st-closed); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--gap); }
.tab {
  display: inline-flex; gap: 7px; align-items: baseline; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem;
}
.tab:hover { background: #f3f6f9; }
.tab .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab.active .count { color: #c9d7ea; }
.tab-new { border-bottom: 3px solid var(--st-new); }
.tab-assigned { border-bottom: 3px solid var(--st-assigned); }
.tab-in_progress { border-bottom: 3px solid var(--st-in_progress); }
.tab-closed { border-bottom: 3px solid var(--st-closed); }

/* ───────── Фильтры ───────── */
.filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 16px 18px; }
.filters .field { flex: 0 1 200px; }
.filters .field.grow { flex: 1 1 260px; }
.filter-actions { display: flex; gap: 8px; }

/* ───────── Таблица ───────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; margin-bottom: var(--gap); }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 0.85rem; color: var(--muted); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f7f9fb;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid #e6eaef; vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #f8fafc; }
td.num { font-variant-numeric: tabular-nums; }
.row-title { font-weight: 650; color: var(--ink); text-decoration: none; }
.row-title:hover { text-decoration: underline; }
tr.is-muted td { color: var(--muted); }
/* Цветная кромка слева — статус заявки виден до чтения текста */
tr.st-new td:first-child { box-shadow: inset 4px 0 0 var(--st-new); }
tr.st-assigned td:first-child { box-shadow: inset 4px 0 0 var(--st-assigned); }
tr.st-in_progress td:first-child { box-shadow: inset 4px 0 0 var(--st-in_progress); }
tr.st-closed td:first-child { box-shadow: inset 4px 0 0 var(--st-closed); }
.access-state { margin-right: 8px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pager-info { color: var(--muted); font-size: 0.9rem; }
.total-line { margin: 0; }
.empty { text-align: center; padding: 36px 20px; }
.empty p { color: var(--muted); }

/* ───────── Карточка заявки ───────── */
.steps {
  list-style: none; display: flex; gap: 0; padding: 0; margin: 0 0 var(--gap);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.steps li {
  flex: 1; text-align: center; padding: 9px 6px; font-size: 0.9rem; color: var(--muted);
  border-right: 1px solid var(--line);
}
.steps li:last-child { border-right: 0; }
.steps li.done { color: var(--ink); background: #f3f6f9; }
.steps li.current { color: #fff; font-weight: 650; background: var(--st-new); }
.steps-assigned li.current { background: var(--st-assigned); }
.steps-in_progress li.current { background: var(--st-in_progress); }
.steps-closed li.current { background: var(--st-closed); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.detail-main, .detail-side { min-width: 0; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.82rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 500; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e6eaef; }
.files li:last-child { border-bottom: 0; }
.files form { margin: 0; }
.file-main { display: flex; flex-direction: column; min-width: 0; }
.file-main a { overflow-wrap: anywhere; font-weight: 600; }

.events { list-style: none; margin: 0; padding: 0; }
.events li {
  display: grid; grid-template-columns: 130px 1fr; column-gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #e6eaef;
}
.events li:last-child { border-bottom: 0; }
.event-time { color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.event-text { overflow-wrap: anywhere; }
.event-who { grid-column: 2; color: var(--muted); font-size: 0.84rem; }

/* ───────── Телефоны и узкие экраны ───────── */
@media (max-width: 900px) {
  .detail { display: flex; flex-direction: column; }
  .detail-side { order: -1; width: 100%; }

  .shell { display: block; }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
    padding: 8px 14px; background: var(--side); color: #fff;
  }
  .mobile-bar .brand-sm { font-weight: 700; color: #fff; text-decoration: none; }
  .menu-btn {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
    background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius);
  }
  .menu-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    transform: translateX(-102%); transition: transform 0.18s ease;
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; z-index: 30; inset: 0; background: rgba(8, 20, 19, 0.5); }
  .container { padding: 20px 16px 48px; }
}

@media (max-width: 760px) {
  .field-row, .field-row.cols-3, .facts { grid-template-columns: 1fr; }
  .steps li { font-size: 0.78rem; padding: 8px 2px; }
  .events li { grid-template-columns: 1fr; }
  .event-who { grid-column: 1; }

  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap { background: none; border: 0; overflow: visible; }
  table.list tr {
    background: var(--surface); border: 1px solid var(--line); border-left-width: 4px;
    border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0;
  }
  table.list tr.st-new { border-left-color: var(--st-new); }
  table.list tr.st-assigned { border-left-color: var(--st-assigned); }
  table.list tr.st-in_progress { border-left-color: var(--st-in_progress); }
  table.list tr.st-closed { border-left-color: var(--st-closed); }
  table.list tr td, table.list tr.st-new td:first-child, table.list tr.st-assigned td:first-child,
  table.list tr.st-in_progress td:first-child, table.list tr.st-closed td:first-child {
    box-shadow: none; border-bottom: 0; padding: 5px 14px;
  }
  table.list td[data-label]:not([data-label=""])::before {
    content: attr(data-label); display: block; font-size: 0.78rem; color: var(--muted);
  }
  .rename-form input { max-width: none; flex: 1 1 160px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.count-badge{display:inline-block;min-width:1.3em;padding:0 .35em;border-radius:999px;background:#d9480f;color:#fff;font-size:.75rem;line-height:1.4;text-align:center}
.check{display:flex;gap:.5rem;align-items:flex-start;cursor:pointer}
.check input{margin-top:.25rem}
.card h3{margin:1.25rem 0 .5rem}

/* ───────── Клиенты ───────── */
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 650; line-height: 1.3;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.b-c-green { color: #0b5a3c; background: #e1f5ec; border-color: #9bd0b5; }
.b-c-amber { color: #7a4a00; background: #fff1d6; border-color: #e6cf93; }
.b-c-blue { color: #0b3f7a; background: #e1eefb; border-color: #9fc3ea; }
.b-c-red { color: #8a1f17; background: #fde7e4; border-color: #eeaaa3; }
.b-c-violet { color: #51308a; background: #eee8fa; border-color: #c4b3ea; }
.b-c-teal { color: #0b5a5a; background: #dff4f3; border-color: #94d2cf; }
.b-c-gray { color: #3d4a49; background: #eceff0; border-color: #c5cdcf; }
.b-inactive { color: #555f6b; background: #eceff2; border-color: #c5ccd3; }
.sub-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.client-box-old { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.client-box-old legend { font-weight: 700; padding: 0 6px; }
.client-inn-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.client-inn-row .field { flex: 1 1 200px; }
.client-found { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.client-status { min-height: 1.2em; font-size: 0.9rem; }
.client-status.err { color: #8f1d17; }
.client-status.ok { color: #0f5b38; }
.client-panel { border: 1px dashed #aab5c0; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.client-panel[hidden], .client-found[hidden], .client-outlet[hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link, #1d5fa8); text-decoration: underline; cursor: pointer; font: inherit; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.import-report dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.import-report dt { color: var(--muted); }
.import-report dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.visually-hidden-inline { position: absolute; left: -9999px; }
@media (max-width: 760px) { .card-grid { grid-template-columns: 1fr; } }

/* Пользователи: все кнопки действий в одной колонке */
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; display: flex; gap: 8px; align-items: center; }
.row-actions select { width: auto; min-width: 150px; }
.users-table td[data-label="Действия"] { white-space: nowrap; }

/* Удалённый доступ */
.remote-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.remote-list li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.remote-field { display: inline-flex; gap: 6px; align-items: baseline; }
.remote-field code { font-family: ui-monospace, Menlo, Consolas, monospace; background: #eef2f1; padding: 1px 6px; border-radius: 4px; }
.remote-note { color: var(--muted, #5b6b6a); }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }
.access-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; background: #fafcfb; }
.access-item > summary { cursor: pointer; list-style: none; }
.access-item[open] > summary { margin-bottom: 12px; }
.access-item form + form { margin-top: 10px; }

.badge.b-visit { color: #7a2e00; background: #ffe9d6; border-color: #f0b98a; }
label.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; font-weight: 600; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--navy); }

/* Подсказки адреса */
.suggest-host { position: relative; }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% - 2px); margin: 0; padding: 4px;
  list-style: none; background: #fff; border: 1px solid var(--navy); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(14, 40, 39, .18); max-height: 280px; overflow-y: auto;
}
.suggest li { padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: .95rem; line-height: 1.35; }
.suggest li:hover, .suggest li.active { background: #e3f1ef; }

/* ───────── Формы: секции, акценты, поиск ───────── */
.form .fsec { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #f7fbfa 0, #fff 64px); }
.form .fsec::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--navy); }
.form .fsec:nth-of-type(2)::before { background: var(--mark); }
.form .fsec:nth-of-type(3)::before { background: var(--link); }
.form .fsec:nth-of-type(4)::before { background: var(--st-in_progress); }
.fsec-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.fsec-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 0.85rem; font-weight: 700; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea { transition: border-color .15s, box-shadow .15s, background-color .15s; }
.form input:not([type=checkbox]):not([type=file]):focus, .form select:focus, .form textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14,103,98,.18); background: #fbfffe; outline: none; }
.form .field label { color: #26413e; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed #b7c7c4; border-radius: 8px; background: #f7fbfa; cursor: pointer; }
.check:has(input:checked) { border-style: solid; border-color: var(--navy); background: #e8f4f2; }

.search-box { display: flex; flex-direction: column; gap: 8px; }
.search-box[hidden] { display: none; }
.results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 6px 18px rgba(18,48,47,.08); max-height: 340px; overflow-y: auto; }
.results[hidden] { display: none; }
.results li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #edf1f0; }
.results li:last-child { border-bottom: 0; }
.results li:hover, .results li.active { background: #e8f4f2; }
.results .r-name { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.results .r-sub { font-size: 0.85rem; color: var(--muted); }
.results .r-more { cursor: default; color: var(--muted); font-size: 0.85rem; }
.client-found { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: #e8f4f2; border: 1px solid #b6d8d3; }
.client-found-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-found-name { font-weight: 700; font-size: 1.05rem; }
.client-found-inn { color: var(--muted); font-size: 0.9rem; }
.client-found-actions { display: flex; gap: 12px; align-items: center; }
.client-found[hidden] { display: none; }
.client-status { min-height: 1.2em; font-size: 0.9rem; }
.client-status.err { color: #8f1d17; }
.client-status.ok { color: #0f5b38; }
.client-outlet { display: flex; flex-direction: column; gap: 10px; }
.client-outlet[hidden], .client-panel[hidden] { display: none; }
.client-panel { border: 1px dashed #8fb5b0; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #f7fbfa; }

.side-version { margin-top: 10px; text-align: center; font-size: 0.78rem; color: var(--side-ink); opacity: .7; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }
.codebox { background: #12302f; color: #d9ece9; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 0.85rem; }
