* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background: #f0f2f5; color: #222; }
header {
  background: #1a56a0; color: #fff; padding: 16px 24px;
  display: flex; align-items: center; gap: 12px;
}
.header-brand {
  color: #fff; text-decoration: none; font-size: 18px; font-weight: bold;
  flex-shrink: 0;
}
.header-brand:hover { text-decoration: underline; }
.breadcrumbs { flex: 1; min-width: 0; }
.breadcrumb-list {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 10px; font-size: 14px; line-height: 1.3;
}
.breadcrumb-list li { display: flex; align-items: center; }
.breadcrumb-list li + li::before {
  content: "›"; margin-right: 10px; opacity: .55; font-size: 16px; line-height: 1;
}
.breadcrumb-list a {
  color: rgba(255,255,255,.82); text-decoration: none;
}
.breadcrumb-list a:hover { color: #fff; text-decoration: underline; }
.breadcrumb-list li:last-child span {
  color: #fff; font-weight: 600;
}
header .header-meta { margin-left: auto; font-size: 13px; opacity: .85; flex-shrink: 0; }
.layout { display: flex; gap: 0; height: calc(100vh - 54px); }

/* Левая панель: контент 318px (эталон); прокрутка сбоку на .sidebar-track */
.sidebar-shell {
  flex-shrink: 0;
  width: fit-content;
  min-width: 318px;
  height: 100%;
  background: #fff;
  border-right: 1px solid #ddd;
}
.sidebar-track {
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.sidebar-track::-webkit-scrollbar { width: 10px; }
.sidebar-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.sidebar-track::-webkit-scrollbar-track { background: #f8fafc; }
.sidebar {
  width: 318px;
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-title {
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  color: #888; letter-spacing: .5px; margin-bottom: 2px;
}
.section-header-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.section-header-row .section-title { margin-bottom: 0; flex: 1; }
.section-header-row--solo { justify-content: flex-end; margin-bottom: 4px; }
#reportsBlock.sidebar-block-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#reportsBlock .section-header-row--solo { margin-bottom: 0; }
#dateBlock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #888;
  letter-spacing: .5px;
}
.field-box {
  position: relative;
  width: 100%;
}
.field-control {
  display: block;
  width: 100%;
  height: 32px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  box-sizing: border-box;
  background: #fff;
  color: #222;
  font-family: inherit;
  line-height: normal;
  cursor: pointer;
}
input[type="date"].field-control::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.field-box:focus-within .field-control,
.field-control:focus {
  outline: none;
  border-color: #1a56a0;
  box-shadow: 0 0 0 2px rgba(26, 86, 160, .15);
}
.field-box--leader {
  height: 32px;
}
.field-box--leader .field-control {
  pointer-events: none;
  padding: 0 32px 0 8px;
  line-height: 32px;
}
.field-box--leader select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.field-box--leader::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%235f6368' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.help-trigger {
  flex-shrink: 0;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #64748b;
  font-size: 11px; font-weight: 600; cursor: pointer;
  padding: 4px 10px; line-height: 1.2; text-align: center;
  border-radius: 6px; white-space: nowrap;
}
.help-trigger:hover,
.help-trigger[aria-expanded="true"] {
  background: #1a56a0; color: #fff; border-color: #1a56a0;
}
/* Справка — оверлей поверх ленты логов; сайдбар с кнопками не затрагивается */
.help-guide-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(15, 23, 42, .06);
  pointer-events: auto;
}
.help-guide-backdrop.is-open { display: block; }
.help-guide-panel {
  display: none;
  position: absolute;
  top: 12px;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 30;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px 16px;
  font-size: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.45;
  color: #374151;
  box-shadow: 0 8px 28px rgba(26, 86, 160, .18);
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}
.help-guide-panel.is-open { display: block; }
.help-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.help-guide-header strong { color: #1a56a0; font-size: 14px; line-height: 1.3; }
.help-guide-hint {
  font-size: 11px;
  color: #64748b;
  margin: 4px 0 0;
  font-weight: normal;
}
.help-guide-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.help-guide-close:hover { background: #eff6ff; border-color: #bfdbfe; color: #1a56a0; }
.help-guide-panel ul { margin: 6px 0 8px; padding-left: 16px; }
.help-guide-panel li { margin-bottom: 4px; }
.help-guide-panel li:last-child { margin-bottom: 0; }
.help-guide-panel .help-note {
  margin: 0; padding-top: 8px; border-top: 1px solid #e5e7eb;
  font-size: 11px; color: #6b7280; line-height: 1.45;
}
.help-guide-panel .help-lead {
  margin: 0 0 8px; line-height: 1.45; color: #374151;
}
.help-guide-panel .help-steps {
  margin: 0 0 10px; padding-left: 18px; color: #374151;
}
.help-guide-panel .help-steps li { margin-bottom: 3px; }
.help-guide-panel .help-item {
  margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}
.help-guide-panel .help-item:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.help-guide-panel .help-item-title {
  display: block; font-weight: 600; color: #1a56a0; margin-bottom: 4px; font-size: 12px;
}
.help-guide-panel .help-item p {
  margin: 0 0 4px; line-height: 1.45; color: #374151; font-size: 12px;
}
.help-guide-panel .help-item p:last-child { margin-bottom: 0; }
.help-guide-panel .help-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px; margin-right: 4px; vertical-align: baseline;
}
.help-guide-panel .help-tag-ok { background: #dcfce7; color: #166534; }
.help-guide-panel .help-tag-no { background: #fef3c7; color: #92400e; }
.upload-zone {
  border: 2px dashed #aac4e8; border-radius: 8px; padding: 12px;
  text-align: center; cursor: pointer; background: #f5f9ff;
  transition: border-color .2s;
}
.upload-zone:hover { border-color: #1a56a0; }
.upload-zone input { display: none; }
.upload-zone span { font-size: 13px; color: #555; }

.btn {
  width: 100%; padding: 8px 12px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: bold; transition: background .15s;
}
.btn-blue   { background: #1a56a0; color: #fff; }
.btn-blue:hover   { background: #154480; }
.btn-green  { background: #1e8c45; color: #fff; }
.btn-green:hover  { background: #166835; }
.btn-orange { background: #d97706; color: #fff; }
.btn-orange:hover { background: #b45309; }
.btn-red    { background: #dc2626; color: #fff; }
.btn-red:hover    { background: #b91c1c; }
.btn-gray   { background: #6b7280; color: #fff; }
.btn-gray:hover   { background: #4b5563; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 6px; }
.btn-row .btn { width: 50%; }

/* Меню действий (sidebar): панель в потоке, не обрезается overflow */
.action-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.action-menu-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.action-menu-label {
  width: 100%;
  min-width: 0;
  padding: 0 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.action-menu-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, .18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  transition: transform .15s ease;
}
.action-menu.is-open .action-menu-chevron {
  transform: translateY(-50%) rotate(180deg);
}
.action-menu-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  padding: 4px;
}
.action-menu.is-open .action-menu-panel {
  display: flex;
}
.action-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: #e5e7eb;
}
.action-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .12s;
}
.action-menu-item:hover,
.action-menu-item:focus-visible {
  background: #f0f7ff;
  outline: none;
}
.action-menu-item--primary {
  background: #ecfdf3;
}
.action-menu-item--primary:hover,
.action-menu-item--primary:focus-visible {
  background: #d1fae5;
}
.action-menu-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.25;
}
.action-menu-item--primary .action-menu-item-title {
  color: #166534;
}
.action-menu-item-desc {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.3;
}
.action-menu.is-busy .action-menu-chevron {
  opacity: .6;
}

.divider { border: none; border-top: 1px solid #e5e7eb; margin: 2px 0; }

/* Центральная область (лента логов) */
.main-shell {
  flex: 1;
  min-width: 360px;
  display: flex;
  height: 100%;
  overflow: hidden;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Прогресс (глобальная полоска) */
.progress-bar-wrap { height: 3px; background: #e5e7eb; overflow: hidden; flex-shrink: 0; }
.progress-bar { height: 3px; background: #1a56a0; width: 0%; transition: width .25s; }

/* Лента операций */
.activity-panel {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.activity-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.activity-panel-scroll::-webkit-scrollbar { width: 10px; }
.activity-panel-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.activity-panel-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.activity-panel-inner {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.live-status.hidden { display: none; }

/* Карточка операции */
.op-card.summary-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.op-card.summary-card.is-collapsed .op-card-body { display: none; }
.op-card.summary-card.is-running { border-color: #93c5fd; }
.op-card.summary-card.is-done { border-color: #86efac; }
.op-card.summary-card.is-error { border-color: #fca5a5; }

.summary-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.summary-card-title-wrap { flex: 1; min-width: 0; }
.summary-card-title {
  font-size: 14px;
  font-weight: bold;
  color: #111;
  line-height: 1.3;
}
.summary-card-subtitle {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  line-height: 1.4;
}
.summary-card-meta {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}
.op-card-collapse {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}
.op-card-collapse:hover { background: #eff6ff; border-color: #bfdbfe; color: #1a56a0; }

.op-card-body { display: flex; flex-direction: column; gap: 10px; }

/* Живая строка + прогресс внутри карточки */
.live-status.op-live {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #334155;
}
.live-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-status.done .live-status-row { color: #166534; }
.live-status.error .live-status-row { color: #991b1b; }
.live-status-text { flex: 1; line-height: 1.4; min-width: 0; }
.op-progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.op-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a56a0, #3b82f6);
  width: 0%;
  transition: width .25s ease;
}
.op-progress-caption {
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.summary-stats {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.stat-chip {
  font-size: 12px; font-weight: bold; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap;
}
.stat-blue   { background: #dbeafe; color: #1e40af; }
.stat-green  { background: #d1fae5; color: #065f46; }
.stat-amber  { background: #fef3c7; color: #92400e; }
.stat-red    { background: #fee2e2; color: #991b1b; }

/* Детали операции (свернуты по умолчанию) */
.detail-toggle {
  font-size: 12px; color: #1a56a0; cursor: pointer;
  background: none; border: none; padding: 0;
  text-decoration: underline;
}
.detail-block {
  display: none;
  font-size: 12px;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 80px;
  max-height: min(70vh, 720px);
  overflow: auto;
  resize: vertical;
}
.detail-block.open { display: block; }
.detail-block.log-timeline { padding: 8px 10px; }
.detail-row {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 0; border-bottom: 1px solid #f3f4f6;
}
.detail-row:last-child { border-bottom: none; }
.detail-icon { width: 16px; text-align: center; flex-shrink: 0; }
.detail-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-name.wrap { white-space: normal; overflow: visible; text-overflow: unset; line-height: 1.4; }
.detail-row.indent { padding-left: 18px; }
.detail-row.file-row .detail-name { font-weight: 600; }
.db-warn { background: #fef3c7; color: #92400e; }
.detail-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 10px; flex-shrink: 0;
}
.db-ok  { background: #d1fae5; color: #065f46; }
.db-warn { background: #fef3c7; color: #92400e; }
.db-err  { background: #fee2e2; color: #991b1b; }

/* Карточка файла (проверка) */
.file-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 12px 14px;
}
.file-card.file-card-ok { border-left-color: #22c55e; }
.file-card.file-card-warn { border-left-color: #f59e0b; }
.file-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.file-card-name { font-size: 13px; font-weight: bold; flex: 1; }
.badge {
  font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 12px;
}
.badge-ok  { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }
.file-card-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.file-card-actions a {
  font-size: 12px; font-weight: bold; color: #1a56a0; text-decoration: none;
  padding: 3px 10px; border: 1px solid #1a56a0; border-radius: 4px;
}
.file-card-actions a:hover { background: #1a56a0; color: #fff; }
.prescription-issues {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}
.prescription-issues li { margin: 2px 0; }
.prescription-meta-row { margin-top: 8px; }
.prescription-source-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.prescription-source-chip.source-te { background: #dbeafe; color: #1e40af; }
.prescription-source-chip.source-net { background: #e0e7ff; color: #3730a3; }
.prescription-source-chip.source-local { background: #d1fae5; color: #065f46; }
.prescription-source-chip.source-unknown { background: #f3f4f6; color: #4b5563; }
.prescription-block-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin: 10px 0 4px;
}
.prescription-questions-block,
.prescription-letter-block,
.prescription-text-block {
  margin-top: 6px;
}
.prescription-text-body {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.prescription-questions {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
}
.prescription-letter-text {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
}
.report-body {
  display: none;
  font-size: 12px;
  color: #334155;
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-top: 8px;
  min-height: 100px;
  max-height: min(65vh, 640px);
  overflow: auto;
  resize: vertical;
  border: 1px solid #e5e7eb;
  line-height: 1.45;
  width: 100%;
  box-sizing: border-box;
}

/* Пустое состояние */
.empty-hint {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #6b7280; font-size: 13px; gap: 8px;
  text-align: center; max-width: 360px; margin: 0 auto;
  line-height: 1.45;
}
.empty-hint-icon { font-size: 32px; line-height: 1; }
.empty-hint-title {
  font-size: 15px; font-weight: 600; color: #374151;
}
.empty-hint-lead { color: #6b7280; }
.empty-hint-steps {
  margin: 4px 0 0; padding-left: 20px; text-align: left;
  color: #6b7280; font-size: 12px;
}
.empty-hint-steps li { margin-bottom: 4px; }
.empty-hint-steps li:last-child { margin-bottom: 0; }
.empty-hint-note {
  font-size: 12px; color: #9ca3af; margin-top: 4px;
}

/* Правая панель: прокрутка на .results-track — полоса сбоку, не сужает список */
.results-shell {
  flex-shrink: 0;
  display: flex;
  height: 100%;
  min-width: 318px;
  background: #fff;
  border-left: 1px solid #ddd;
}
.results-resize-handle {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  touch-action: none;
}
.results-resize-handle:hover,
.results-resize-handle.is-dragging {
  background: #dbeafe;
}
.results-panel {
  width: 318px;
  min-width: 318px;
  max-width: min(560px, 55vw);
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.results-track {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
.results-track::-webkit-scrollbar { width: 10px; }
.results-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
.results-track::-webkit-scrollbar-track { background: #f8fafc; }
.results-inner {
  box-sizing: border-box;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.results-title {
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  color: #888; letter-spacing: .5px; margin-bottom: 4px;
}
#fixedFiles,
#results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px;
  padding: 8px 10px; font-size: 12px; gap: 8px;
}
.result-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item a {
  font-size: 12px; color: #1a56a0; font-weight: bold; text-decoration: none;
  white-space: nowrap;
}
.result-item a:hover { text-decoration: underline; }
.result-section-title {
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  color: #888; letter-spacing: .5px; margin-top: 8px; margin-bottom: 4px;
  padding-top: 8px; border-top: 1px solid #e5e7eb;
}
.result-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.no-results { font-size: 12px; color: #aaa; font-style: italic; }

/* Спиннер */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #bfdbfe; border-top-color: #1a56a0;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}

/* Главная страница */
.home-body { min-height: 100vh; }
.home-main {
  max-width: 640px; margin: 0 auto; padding: 32px 24px 48px;
}
.home-lead { font-size: 14px; color: #666; margin-bottom: 20px; }
.home-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-card {
  display: block; background: #fff; border: 1px solid #ddd; border-radius: 8px;
  padding: 20px 22px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.home-card:hover {
  border-color: #1a56a0; box-shadow: 0 2px 8px rgba(26,86,160,.12);
}
.home-card-title {
  display: block; font-size: 17px; font-weight: bold; color: #1a56a0;
  margin-bottom: 6px;
}
.home-card-desc { display: block; font-size: 13px; color: #555; line-height: 1.45; }

/* Отчёт инженера */
.engineer-layout { height: calc(100vh - 54px); }
.engineer-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding: 16px 20px; overflow: hidden;
}
.engineer-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.engineer-filter { max-width: 320px; }
.engineer-table-wrap {
  flex: 1; overflow: auto; background: #fff; border: 1px solid #ddd; border-radius: 8px;
}
.engineer-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.engineer-table th, .engineer-table td {
  border-bottom: 1px solid #eee; padding: 8px 10px; text-align: left; vertical-align: top;
}
.engineer-table th {
  position: sticky; top: 0; background: #f8fafc; z-index: 1;
  font-size: 11px; text-transform: uppercase; color: #666;
}
.engineer-table .cell-name { min-width: 220px; max-width: 360px; }
.engineer-table .cell-object { max-width: 140px; color: #555; }
.field-input--sm { padding: 4px 6px; font-size: 12px; min-width: 64px; }
.engineer-project-tabs { margin-bottom: 12px; }
.hint-text { font-size: 12px; color: #888; }
.home-card-meta {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}
.warn-text { font-size: 12px; color: #b45309; }
.error-text { color: #b91c1c; }
.cell-tk { font-size: 11px; color: #1a56a0; white-space: nowrap; }

/* Планирование */
.planning-shell { padding: 20px 24px 32px; max-width: 960px; margin: 0 auto; }
.planning-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.planning-tab {
  border: 1px solid #cbd5e1; background: #fff; color: #334155;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.planning-tab.is-active {
  background: #1a56a0; border-color: #1a56a0; color: #fff;
}
.planning-hint { font-size: 13px; color: #666; margin-bottom: 16px; }
.planning-hint code { font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.planning-cards { display: flex; flex-direction: column; gap: 16px; }
.planning-card {
  background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 16px 18px;
}
.planning-card h3 { font-size: 16px; color: #1a56a0; margin-bottom: 8px; }
.planning-meta { font-size: 12px; color: #666; margin-bottom: 12px; }
.planning-badge {
  font-size: 10px; font-weight: normal; background: #dcfce7; color: #166534;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}
.planning-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.planning-table th, .planning-table td {
  border-bottom: 1px solid #eee; padding: 6px 8px; text-align: left;
}
.planning-table th { color: #888; font-size: 11px; text-transform: uppercase; }
.project-stats {
  display: grid; gap: 8px; margin: 12px 0 16px; font-size: 13px;
}
.project-stats div { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.project-stats dt { color: #888; font-weight: bold; }
.project-stats dd { margin: 0; }
.project-assign { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.engineer-checklist {
  max-height: 220px; overflow-y: auto; border: 1px solid #ddd; border-radius: 6px;
  padding: 8px 10px; background: #fafafa; display: flex; flex-direction: column; gap: 4px;
}
.engineer-check {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer;
  padding: 4px 2px; border-radius: 4px;
}
.engineer-check:hover { background: #f0f4f8; }
.engineer-check input { margin-top: 2px; flex-shrink: 0; }
.engineer-select { min-height: 120px; }
.btn-sm { padding: 6px 12px; font-size: 12px; align-self: flex-start; }
.engineer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.engineer-chip {
  background: #eff6ff; color: #1a56a0; font-size: 12px; padding: 2px 8px; border-radius: 999px;
}
.personnel-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px;
}
.personnel-filter { font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.personnel-search { max-width: 240px; font-size: 13px; padding: 6px 10px; }
.personnel-table-wrap { overflow-x: auto; }
.personnel-table td:first-child { font-weight: 500; white-space: nowrap; }
.personnel-table td:nth-child(2) { max-width: 280px; }
.luvr-month-select { max-width: 320px; margin-bottom: 12px; }
.luvr-header { margin-bottom: 8px; }
.luvr-sync-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 10px 0 12px; padding: 10px 12px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px;
}
.luvr-sync-actions { display: flex; gap: 8px; margin-left: auto; }
.luvr-sync-stale { color: #b45309; }
.luvr-sync-ok { color: #15803d; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.luvr-grid-wrap {
  overflow: auto; max-height: calc(100vh - 220px); border: 1px solid #ddd;
  border-radius: 8px; background: #fff;
}
.luvr-grid { width: max-content; min-width: 100%; font-size: 11px; }
.luvr-grid th, .luvr-grid td { padding: 4px 5px; text-align: center; white-space: nowrap; }
.luvr-grid .luvr-col-fio, .luvr-grid .luvr-col-pos { text-align: left; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.luvr-grid .luvr-col-fio { max-width: 180px; }
.luvr-grid .luvr-sticky {
  position: sticky; left: 0; z-index: 2; background: #fff;
  box-shadow: 2px 0 0 #eee;
}
.luvr-grid .luvr-col-num { left: 0; min-width: 28px; }
.luvr-grid .luvr-col-fio { left: 28px; max-width: 160px; }
.luvr-grid .luvr-col-link { left: 188px; min-width: 120px; max-width: 140px; padding: 2px; }
.luvr-grid .luvr-col-proj { left: 328px; min-width: 100px; max-width: 120px; padding: 2px; vertical-align: top; }
.luvr-grid .luvr-col-pos { left: 448px; }
.luvr-person-link {
  width: 100%; max-width: 136px; font-size: 10px; padding: 2px 4px;
  border: 1px solid #cbd5e1; border-radius: 4px; background: #fff;
}
.luvr-person-projects {
  width: 100%; max-width: 116px; min-height: 2.4em; font-size: 10px; padding: 2px;
  border: 1px solid #cbd5e1; border-radius: 4px; background: #fff;
}
.luvr-proj--ok { border-color: #86efac; background: #f0fdf4; }
.luvr-proj--manual { border-color: #93c5fd; background: #eff6ff; }
.luvr-proj--empty { border-color: #e2e8f0; background: #f8fafc; color: #94a3b8; }
.luvr-link--ok { border-color: #86efac; background: #f0fdf4; }
.luvr-link--manual { border-color: #93c5fd; background: #eff6ff; }
.luvr-link--warn { border-color: #fcd34d; background: #fffbeb; }
.luvr-row--unlinked .luvr-col-fio { color: #b45309; }
.luvr-row--search-hit .luvr-col-fio { background: #fef9c3; box-shadow: inset 3px 0 0 #eab308; }
.luvr-search-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px; max-width: 520px;
}
.luvr-search-label { font-size: 13px; color: #475569; white-space: nowrap; }
.luvr-fio-search { flex: 1; min-width: 160px; max-width: 280px; padding: 6px 10px; font-size: 13px; }
.luvr-search-info { min-width: 6em; font-size: 12px; }
.luvr-link-summary { font-size: 13px; }
.luvr-grid thead .luvr-sticky { z-index: 3; background: #f8fafc; }
.luvr-grid thead th { position: sticky; top: 0; z-index: 1; background: #f8fafc; }
.luvr-grid thead .luvr-sticky { z-index: 4; }
.luvr-day { min-width: 26px; font-weight: normal; color: #666; }
.luvr-sum { font-weight: bold; background: #f1f5f9; min-width: 28px; }
.luvr-mark--empty { color: #ccc; }
.luvr-mark--full { background: #dbeafe; font-weight: bold; }
.luvr-mark--half { background: #fef3c7; }
.luvr-mark--other { background: #fce7f3; }
.luvr-legend { margin-top: 8px; font-size: 12px; }
.luvr-legend .luvr-mark { display: inline-block; padding: 0 6px; border-radius: 3px; }
.luvr-cell { cursor: pointer; user-select: none; }
.luvr-cell:focus { outline: 2px solid #3b82f6; outline-offset: -2px; z-index: 1; }
.luvr-cell--selected { background: #e0f2fe !important; box-shadow: inset 0 0 0 1px #38bdf8; }
.luvr-cell--pending { opacity: 0.55; }
.luvr-cell--compose { background: #fff; color: #111; box-shadow: inset 0 0 0 2px #3b82f6; font-weight: bold; }
.luvr-cell--saved { box-shadow: inset 0 0 0 2px #22c55e; }
.luvr-save-status { min-height: 1.2em; margin-top: 6px; font-size: 12px; color: #64748b; }
.luvr-save-status--ok { color: #15803d; }
.luvr-save-status--error { color: #b91c1c; }
.luvr-save-status--pending { color: #b45309; }
.luvr-legend kbd {
  display: inline-block; padding: 0 4px; border: 1px solid #cbd5e1;
  border-radius: 3px; background: #f8fafc; font-size: 11px;
}
