/* ── СБИС → Битрикс24 · дизайн по Figma (Vanilla CSS, без CDN) ───────── */

:root {
  --blue: #2563eb; --blue-500: #3b82f6; --blue-700: #1d4ed8;
  --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe; --blue-300: #93c5fd;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1;
  --slate-400: #94a3b8; --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155;
  --slate-800: #1e293b; --slate-900: #0f172a; --slate-950: #020617;
  --emerald-50: #ecfdf5; --emerald-100: #d1fae5; --emerald-200: #a7f3d0;
  --emerald-500: #10b981; --emerald-600: #059669; --emerald-700: #047857; --emerald-800: #065f46;
  --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-200: #fde68a; --amber-400: #fbbf24;
  --amber-500: #f59e0b; --amber-600: #d97706; --amber-700: #b45309; --amber-800: #92400e;
  --red-50: #fef2f2; --red-100: #fee2e2; --red-200: #fecaca; --red-400: #f87171;
  --red-500: #ef4444; --red-600: #dc2626; --red-800: #991b1b; --red-950: #450a0a;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .1), 0 8px 10px -6px rgba(15, 23, 42, .1);
  --sidebar-w: 224px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--slate-900);
  background: var(--slate-100);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ── Тултип «?» (чистый CSS) ─────────────────────────────────────────── */
.tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; border-radius: 50%;
  background: var(--slate-200); color: var(--slate-500);
  font-size: 10px; font-weight: 700; line-height: 1; cursor: help; user-select: none;
  transition: background .15s, color .15s;
}
.tip:hover, .tip:focus { background: var(--blue-100); color: var(--blue); outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 22px; top: -6px; z-index: 60;
  width: 260px; padding: 10px 12px;
  background: var(--slate-800); color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.55; text-align: left;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(2px);
  transition: opacity .12s, transform .12s; pointer-events: none; white-space: normal;
}
.tip::before {
  content: ""; position: absolute; left: 16px; top: 4px; z-index: 61;
  border: 5px solid transparent; border-right-color: var(--slate-800);
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.tip:hover::after, .tip:focus::after,
.tip:hover::before, .tip:focus::before { opacity: 1; visibility: visible; transform: translateY(0); }
/* На узких экранах тултип — под иконкой, по центру */
@media (max-width: 640px) {
  .tip::after { left: 50%; transform: translate(-50%, 2px); top: 20px; }
  .tip:hover::after, .tip:focus::after { transform: translate(-50%, 0); }
  .tip::before { display: none; }
}

/* ── Экран входа ─────────────────────────────────────────────────────── */
.login {
  min-height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #0b1220 0%, var(--slate-950) 60%);
}
.login-card-wrap { width: 100%; max-width: 360px; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 44px; height: 44px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  background: var(--blue); border-radius: 12px; box-shadow: 0 10px 30px rgba(37, 99, 235, .4);
}
.login-brand h1 { color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.login-brand p { color: var(--slate-500); font-size: 13px; margin-top: 4px; }
.login-card {
  background: var(--slate-900); border: 1px solid var(--slate-800);
  border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-lg);
}

/* ── Приложение: каркас ──────────────────────────────────────────────── */
.app { min-height: 100%; display: flex; }
.main { flex: 1; display: flex; flex-direction: column; min-height: 100%; margin-left: var(--sidebar-w); }
.content { flex: 1; padding: 20px 24px; overflow-y: auto; }
.content > .screen { max-width: 720px; }
.content > .screen.wide { max-width: 960px; }

/* ── Сайдбар ─────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100%; width: var(--sidebar-w);
  background: #0f172a; border-right: 1px solid rgba(30, 41, 59, .6);
  display: flex; flex-direction: column; z-index: 30;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid rgba(30, 41, 59, .6); }
.brand-logo {
  width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--blue); border-radius: 8px;
}
.brand-title { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.brand-sub { color: #475569; font-size: 10px; margin-top: 2px; }
.nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; border-radius: 8px; background: transparent;
  color: var(--slate-400); font-size: 13px; text-align: left; transition: all .15s;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item .nav-ico { color: var(--slate-500); display: inline-flex; }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 500; box-shadow: var(--shadow-sm); }
.nav-item.active .nav-ico { color: #fff; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(30, 41, 59, .6); display: flex; flex-direction: column; gap: 12px; }
.logout {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 12px; border: none; border-radius: 8px; background: transparent;
  color: var(--slate-500); font-size: 13px; transition: all .15s;
}
.logout:hover { color: var(--red-400); background: rgba(239, 68, 68, .1); }

/* Индикатор доступа */
.access { display: flex; align-items: center; gap: 12px; }
.access .acc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--slate-400); }
.access .acc b { font-weight: 500; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-500); display: inline-block; }
.dot.ok { background: var(--emerald-400, #34d399); }
.dot.error { background: var(--red-400); }
.dot.checking { background: var(--amber-400); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Топбар ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-200);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 14px; font-weight: 600; color: var(--slate-800); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .access { color: var(--slate-400); }
.menu-btn {
  display: none; padding: 6px; border: none; border-radius: 8px; background: transparent;
  color: var(--slate-500); align-items: center; justify-content: center;
}
.menu-btn:hover { background: var(--slate-100); }
.logout-link { width: auto; padding: 4px 0; }

/* ── Карточки ────────────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 16px; }
.card + .card, .card + .block, .block + .card { margin-top: 16px; }
.screen { display: flex; flex-direction: column; gap: 16px; }
.card-title {
  font-size: 11px; font-weight: 600; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

/* ── Поля и инпуты ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; align-items: center; }
.field-label label { font-size: 13px; font-weight: 500; color: var(--slate-700); }
.req { color: var(--red-500); margin-left: 2px; }
.input {
  width: 100%; padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-xs);
  background: #fff; color: var(--slate-900); transition: box-shadow .15s, border-color .15s;
}
.input::placeholder { color: var(--slate-300); }
.input:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--blue); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint-text { font-size: 12px; color: var(--slate-400); }

/* ── Кнопки ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-700); }
.btn-secondary { background: var(--slate-100); color: var(--slate-700); }
.btn-secondary:hover:not(:disabled) { background: var(--slate-200); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; font-weight: 600; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btn-lg:hover:not(:disabled) { box-shadow: var(--shadow-lg); }
.link-btn { background: none; border: none; padding: 0; color: var(--blue); font-size: 12px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--slate-500); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }

/* ── Бейджи статусов ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.badge-pending { background: var(--slate-100); color: var(--slate-400); border-color: var(--slate-200); }
.badge-done { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-200); }
.badge-branch { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-200); }
.badge-error { background: var(--red-50); color: var(--red-600); border-color: var(--red-200); }
.badge-skipped { background: var(--slate-50); color: var(--slate-400); border-color: var(--slate-200); }

/* ── Алерты ──────────────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.55; }
.alert .a-ico { flex-shrink: 0; font-size: 15px; line-height: 1.2; }
.alert-warning { background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-800); }
.alert-error { background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-800); }
.alert-error.dark { background: rgba(69, 10, 10, .5); border-color: rgba(153, 27, 27, .6); color: #fca5a5; }
.alert b { font-weight: 600; }
.alert .a-actions { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; }
.alert .btn { background: var(--amber-600); color: #fff; }
.alert .btn:hover { background: var(--amber-700); }
.alert-note { font-size: 12px; background: var(--amber-50); border: 1px solid var(--amber-200); color: var(--amber-800); border-radius: var(--radius-xs); padding: 8px 12px; }

/* ── Чекбоксы-пилюли (типы) ──────────────────────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--slate-200);
  background: #fff; color: var(--slate-500); cursor: pointer; user-select: none; transition: all .15s;
}
.pill:hover { border-color: var(--slate-300); color: var(--slate-700); }
.pill.on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.checks { display: flex; gap: 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate-700); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ── Список документов ───────────────────────────────────────────────── */
.doclist { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; }
.doclist-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--slate-50); border-bottom: 1px solid var(--slate-200); font-size: 12px; }
.doclist-head .l { font-weight: 500; color: var(--slate-500); }
.doclist-head .r { color: var(--slate-400); }
.docrow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .12s; border-bottom: 1px solid var(--slate-100); }
.docrow:last-child { border-bottom: none; }
.docrow:hover { background: rgba(248, 250, 252, .8); }
.docrow.sel { background: rgba(239, 246, 255, .6); }
.docrow input { margin-top: 4px; accent-color: var(--blue); flex-shrink: 0; }
.docrow-body { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px 16px; align-items: center; }
.doc-title { font-size: 13px; font-weight: 500; color: var(--slate-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-num { font-family: var(--mono); font-size: 11px; color: var(--slate-400); margin-top: 2px; }
.doc-cp { font-size: 13px; color: var(--slate-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-inn { font-family: var(--mono); font-size: 11px; color: var(--slate-400); margin-top: 2px; }
.doc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-meta .m { font-size: 12px; color: var(--slate-400); }
.doc-meta .m.mono { font-family: var(--mono); }
.doclist-foot { padding: 12px 16px; border-top: 1px solid var(--slate-200); background: var(--slate-50); display: flex; justify-content: flex-end; }

/* ── Прогон (шаги) ───────────────────────────────────────────────────── */
.doccard { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.progress-wrap { }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--slate-400); margin-bottom: 4px; }
.progress-bar { height: 4px; background: var(--slate-100); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--blue); transition: width .5s ease, background .3s; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 16px; transition: all .2s; }
.step.active { border-color: var(--blue-300); box-shadow: 0 0 0 3px var(--blue-50); }
.step.done { border-color: var(--emerald-200); }
.step.error { border-color: var(--red-200); }
.step.branch { border-color: var(--amber-200); }
.step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.step-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.step-num {
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  background: var(--slate-100); color: var(--slate-400);
}
.step.done .step-num { background: var(--emerald-100); color: var(--emerald-600); }
.step.error .step-num { background: var(--red-100); color: var(--red-600); }
.step.branch .step-num { background: var(--amber-100); color: var(--amber-600); }
.step.skipped .step-num { background: var(--slate-100); color: var(--slate-300); }
.step.active .step-num { background: var(--blue-100); color: var(--blue); }
.step-title { font-size: 13px; font-weight: 500; color: var(--slate-800); display: inline-flex; align-items: center; flex-wrap: wrap; }
.step.skipped .step-title { color: var(--slate-400); }
.step-desc { font-size: 12px; color: var(--slate-400); margin-top: 2px; }
.step-running { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--blue); }
.step-result { margin-top: 8px; font-size: 12px; font-family: var(--mono); line-height: 1.6; border-radius: var(--radius-xs); padding: 8px 12px; }
.step-result.done { background: var(--emerald-50); color: var(--emerald-800); border: 1px solid var(--emerald-100); }
.step-result.error { background: var(--red-50); color: var(--red-800); border: 1px solid var(--red-100); }
.step-result.branch { background: var(--amber-50); color: var(--amber-800); border: 1px solid var(--amber-100); }
.step-result.skipped { background: var(--slate-50); color: var(--slate-400); border: 1px solid var(--slate-100); }
.step-result.pending { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); font-family: var(--font); }
.step-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.step-branch { margin-top: 8px; display: flex; align-items: flex-start; gap: 8px; padding: 10px; background: var(--amber-50); border: 1px solid var(--amber-200); border-radius: var(--radius-xs); font-size: 12px; color: var(--amber-800); }
.final-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.final-status.ok { color: var(--emerald-600); }
.final-status.branch { color: var(--amber-600); }
.final-status.error { color: var(--red-600); }

/* ── Мастер прогона: степпер-индикатор ───────────────────────────────── */
.stepper {
  display: flex; align-items: flex-start; gap: 0;
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 14px 12px;
}
.stepper-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0;
  position: relative; text-align: center;
}
.stepper-item.clickable { cursor: pointer; }
.stepper-item.clickable:hover .stepper-dot { transform: scale(1.08); }
.stepper-item.clickable:focus-visible { outline: none; }
.stepper-item.clickable:focus-visible .stepper-dot { box-shadow: 0 0 0 3px var(--blue-100); }
.stepper-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  background: var(--slate-100); color: var(--slate-400); border: 2px solid var(--slate-200);
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.stepper-label { font-size: 11px; color: var(--slate-400); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper-connector { flex: 1 1 16px; height: 2px; background: var(--slate-200); margin-top: 15px; min-width: 8px; }
.stepper-connector.done { background: var(--emerald-300, #6ee7b7); }
/* статусы сегментов */
.stepper-item.done .stepper-dot { background: var(--emerald-100); color: var(--emerald-600); border-color: var(--emerald-200); }
.stepper-item.done .stepper-label { color: var(--emerald-700); }
.stepper-item.branch .stepper-dot { background: var(--amber-100); color: var(--amber-600); border-color: var(--amber-200); }
.stepper-item.branch .stepper-label { color: var(--amber-700); }
.stepper-item.error .stepper-dot { background: var(--red-100); color: var(--red-600); border-color: var(--red-200); }
.stepper-item.error .stepper-label { color: var(--red-600); }
.stepper-item.active .stepper-dot { background: var(--blue-100); color: var(--blue); border-color: var(--blue-300); box-shadow: 0 0 0 3px var(--blue-50); }
.stepper-item.active .stepper-label { color: var(--blue); font-weight: 600; }

/* ── Мастер прогона: панель навигации ────────────────────────────────── */
.wiz-nav { display: flex; flex-direction: column; gap: 12px; }
.wiz-nav-btns { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wiz-nav-btns .btn-lg { flex: 1 1 auto; }
.wiz-hint { font-size: 12px; color: var(--slate-400); line-height: 1.5; }

/* ── Notice: отсутствующие UF-поля (создать / пропустить) ─────────────── */
.fields-notice { border: 1px solid var(--amber-200); background: var(--amber-50); }
.fields-notice-title { font-size: 14px; font-weight: 600; color: var(--amber-800); margin-bottom: 6px; }
.fields-notice-sub { font-size: 13px; color: var(--amber-800); margin-bottom: 12px; }
.fields-notice-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fields-notice-btns .btn { flex: 0 1 auto; }
.fields-notice-hint { font-size: 12px; color: var(--amber-700); line-height: 1.5; }

/* ── Журнал ──────────────────────────────────────────────────────────── */
.journal-head { display: flex; align-items: center; justify-content: space-between; }
.journal-head .l { font-size: 13px; font-weight: 500; color: var(--slate-600); }
.table-wrap { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.journal { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
table.journal th { text-align: left; padding: 10px 16px; background: var(--slate-50); border-bottom: 1px solid var(--slate-200); font-size: 11px; font-weight: 600; color: var(--slate-500); }
table.journal td { padding: 12px 16px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
table.journal tr:last-child td { border-bottom: none; }
table.journal tbody tr:hover { background: rgba(248, 250, 252, .7); }
.j-doc { font-weight: 500; color: var(--slate-800); font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j-num { font-family: var(--mono); font-size: 11px; color: var(--slate-400); margin-top: 2px; }
.j-cell { font-size: 12px; color: var(--slate-500); }
.j-mono { font-family: var(--mono); font-size: 12px; color: var(--slate-400); }
.foot-note { font-size: 12px; color: var(--slate-400); display: flex; align-items: center; gap: 6px; }

/* ── Вкладки (Конфигурация) ──────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--slate-200); }
.tab { padding: 10px 16px; font-size: 13px; font-weight: 500; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--slate-500); transition: color .15s, border-color .15s; }
.tab:hover { color: var(--slate-700); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── Dropdown пользователей ──────────────────────────────────────────── */
.dropdown { position: relative; }
.dd-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 176px; overflow-y: auto; }
.dd-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border: none; background: none; text-align: left; font-size: 13px; color: var(--slate-700); }
.dd-item:hover { background: var(--blue-50); }
.dd-item.sel { background: var(--blue-50); color: var(--blue-700); }
.dd-item .id { font-family: var(--mono); font-size: 11px; color: var(--slate-400); }
.chosen { font-size: 12px; color: var(--slate-500); }
.chosen b { font-weight: 500; }
.chosen .id { font-family: var(--mono); color: var(--slate-400); }

/* ── Помощь ──────────────────────────────────────────────────────────── */
.help-card h3 { font-size: 13px; font-weight: 600; color: var(--slate-800); margin-bottom: 12px; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-list li { display: flex; gap: 10px; font-size: 13px; color: var(--slate-600); line-height: 1.55; }
.help-list .n { font-family: var(--mono); font-size: 12px; color: var(--blue-500); flex-shrink: 0; width: 16px; margin-top: 1px; }

/* ── Пустые состояния ────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 16px; color: var(--slate-400); text-align: center; }
.empty .e-ico { font-size: 32px; margin-bottom: 12px; opacity: .5; }
.empty .e-title { font-size: 13px; font-weight: 500; color: var(--slate-500); }
.empty .e-sub { font-size: 12px; color: var(--slate-400); margin-top: 4px; }

/* ── Спиннер ─────────────────────────────────────────────────────────── */
.spinner { width: 16px; height: 16px; border: 2.5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 56px 16px; color: var(--slate-400); font-size: 13px; }

/* ── Тост ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 16px; right: 16px; z-index: 80;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500; color: #fff;
  animation: toast-in .2s ease;
}
.toast.ok { background: var(--emerald-600); }
.toast.error { background: var(--red-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Адаптив (мобильные) ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 25; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .docrow-body { grid-template-columns: 1fr; }
  .doc-meta { justify-content: flex-start; }
  .topbar-right .access { display: none; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { width: 100%; }
  .alert .a-actions { margin-left: 0; width: 100%; }
  .alert .a-actions .btn { width: 100%; }
  .stepper { padding: 12px 8px; }
  .stepper-dot { width: 26px; height: 26px; font-size: 12px; }
  .stepper-connector { margin-top: 13px; min-width: 4px; }
  .stepper-label { font-size: 10px; }
  .wiz-nav-btns { flex-direction: column-reverse; align-items: stretch; }
  .wiz-nav-btns .btn { width: 100%; }
}

/* ── Сверка пользовательских полей (экран «Конфигурация») ────────────── */
.ok-mark { color: var(--emerald-700); font-weight: 600; }
.bad-mark { color: var(--red-600); font-weight: 600; }
