.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
width:270px;
  padding: 18px 14px;
  background: rgba(255,255,255,.86);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width .18s ease;
  z-index: 20;
}
.sidebar.collapsed { width: 82px; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.icon-button, .ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  height: 38px;
min-width:38px;
  color: var(--text);
}
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-item, .logout-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid transparent;
  background: transparent;
width:100%;
  cursor: pointer;
  text-align: left;
}
.nav-item span, .logout-button span { width: 24px; text-align: center; }
.nav-item.active { background: #e8f5ff; color: var(--primary-dark); border-color: #bde7fb; }
.nav-item:hover, .logout-button:hover { background: #f6fbff; color: var(--text); }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-item b, .sidebar.collapsed .logout-button b { display: none; }
.logout-form { margin-top: auto; }
.logout-button { color: var(--danger); }

.page { margin-left: 270px; padding: 28px; transition: margin-left .18s ease; }
.sidebar.collapsed ~ .page { margin-left: 82px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-header h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.page-header p { margin: 6px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; }
.zone-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; background: var(--dark); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .03em; }
.zone-badge.small { padding: 5px 8px; }

.warning-box, .error-box { border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; }
.warning-box { background: #fff8e8; border: 1px solid #ffe0a3; color: #6c4800; }
.warning-box ul { margin: 8px 0 0; }
.error-box { background: #ffecee; border: 1px solid #ffc7cd; color: var(--danger); }

.cards-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card { padding: 18px; min-height: 116px; }
.metric-card span { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 16px; font-size: 28px; }
.content-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-header h2 { margin: 0; font-size: 18px; }
.panel-header a, .primary-link { color: var(--primary-dark); font-weight: 700; }
.compact-list { display: flex; flex-direction: column; gap: 10px; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.compact-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.empty-state { border: 1px dashed #c9d8e6; border-radius: 16px; padding: 28px; background: #f8fbfe; }
.empty-state p { color: var(--muted); margin-bottom: 0; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: #fff; font-size: 13px; }
.filter-chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; background: #f8fbfe; }
.data-table td p { color: var(--muted); margin: 6px 0 0; }
.data-table small { color: var(--muted); }
.table-footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; padding-top: 12px; }
.pager b { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 10px; background: var(--dark); color: #fff; }
.settings-list { display: grid; grid-template-columns: 160px 1fr; gap: 12px; margin: 0; }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; font-weight: 700; word-break: break-word; }

.help-drawer {
  position: fixed;
  top: 0;
  right: -380px;
width:360px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: right .18s ease;
  z-index: 900;
}
.help-drawer.open { right: 0; }
.help-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.help-header button { border: none; background: transparent; font-size: 24px; cursor: pointer; }
.help-body { color: var(--muted); line-height: 1.55; }

.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: 420px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 22px; }
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.login-form label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.login-form input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; }
.login-form button { border: none; background: var(--primary); color: #fff; padding: 13px 14px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.login-note { margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-columns { grid-template-columns: 1fr; }
}
.cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.panel-spaced { margin-top: 18px; }
.panel-actions, .detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.primary-button, .secondary-button, .small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  min-height: 38px;
}
.primary-button { background: var(--primary); color: #fff; border-color: var(--primary); }
.secondary-button { background: #fff; color: var(--primary-dark); }
.small-action { padding: 7px 10px; min-height: 30px; font-size: 13px; background: #f6fbff; color: var(--primary-dark); }
.filter-form {
  display: grid;
grid-template-columns:minm…to;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.filter-form label span, .stack-form label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.filter-form input, .filter-form select, .stack-form input, .stack-form select, .stack-form textarea {
width:100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
}
.compact-table th, .compact-table td { padding: 9px 12px; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, .42);
}
.modal-card {
  position: relative;
width:520px;
max-width:100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}
.wide-modal { width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.modal-header h2 { margin: 0; }
.modal-close { border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; }
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.two-col-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-row { grid-column: 1 / -1; }
.form-note { background: #f8fbfe; border: 1px dashed #c9d8e6; border-radius: 14px; padding: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.detail-title-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail-title-row h2 { margin: 0; }
.detail-top p { color: var(--muted); margin: 8px 0 0; }
.alias-list { display: flex; flex-wrap: wrap; gap: 8px; }
.alias-chip { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: #f8fbfe; font-size: 13px; }
@media (max-width: 1400px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-form { grid-template-columns: 1fr 200px; }
}

/* Patch 0.2.1 */
.nav-list {
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 12px;
}
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pager a,
.pager b {
  display: inline-flex;
min-width:30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary-dark);
  font-weight: 800;
}
.pager b {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.pager-gap { color: var(--muted); padding: 0 2px; }
.modal-separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.form-note code {
  background: #eef6fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 5px;
}
.status-queued { background: #e8f3ff; color: #075985; }
.status-processing { background: #fff8e6; color: #8a5a00; }
.status-done_with_errors { background: #fff1e8; color: #9a3412; }

/* Patch 0.3.0 */
.small-cards {
grid-template-columns:repe…));
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: 96px;
}
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}
.stat-card strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}
.stat-card small {
  color: var(--muted);
}
.compact-filter {
grid-template-columns:220p…fr;
}
.status-matched,
.status-company_matched {
  background: #dcfce7;
  color: #15803d;
}
.status-needs_review {
  background: #fef3c7;
  color: #92400e;
}
.status-no_company_match {
  background: #f3f4f6;
  color: #475569;
}
.status-processing {
  background: #e0f2fe;
  color: #075985;
}

/* Patch 0.4.0 */
.status-detected,
.status-events_detected {
  background: #dcfce7;
  color: #15803d;
}
.status-unknown,
.status-event_unknown {
  background: #fef3c7;
  color: #92400e;
}
.status-event_error {
  background: #fee2e2;
  color: #b91c1c;
}
.event-type {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6fc;
  border: 1px solid var(--line);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12px;
}
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Patch 0.5.0 */
.four-cards {
grid-template-columns:repe…));
}
.signal-filter {
grid-template-columns:240p…fr;
}
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
min-width:54px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-weight: 900;
}
.signals-table td:nth-child(4) {
max-width:360px;
}
.status-signals_detected {
  background: #dcfce7;
  color: #15803d;
}
.status-no_signal {
  background: #f3f4f6;
  color: #475569;
}

.opportunities-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.opportunity-card {
  display: grid;
grid-template-columns:minm…px;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.opportunity-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.opportunity-title-row h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.opportunity-score {
min-width:110px;
  text-align: right;
}

.opportunity-score strong {
  display: block;
  font-size: 24px;
  color: var(--ink);
}

.urgency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.urgency-high {
  color: #991b1b;
  background: #fee2e2;
}

.urgency-medium {
  color: #92400e;
  background: #fef3c7;
}

.urgency-low {
  color: #065f46;
  background: #d1fae5;
}

.opportunity-block {
  margin-top: 12px;
}

.opportunity-block h4,
.message-draft h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.opportunity-block p,
.message-draft p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-line;
}

.message-draft {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: #f8fbff;
}

.opportunity-side {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
}

.opportunity-side p {
  margin: 12px 0;
  line-height: 1.45;
}

.vertical-actions {
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 1100px) {
  .opportunity-card {
grid-template-columns:1fr;
  }

  .opportunity-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }
}
.status-opportunity_created,
.status-in_work {
  background: #dcfce7;
  color: #15803d;
}
.status-postponed,
.status-low_score {
  background: #fef3c7;
  color: #92400e;
}
.status-not_relevant {
  background: #f3f4f6;
  color: #475569;
}

/* Patch 0.6.1: unified pagination */
.pager a.pager-nav,
.pager .pager-disabled {
min-width:auto;
  padding: 0 12px;
}
.pager .pager-disabled {
  display: inline-flex;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f6f9fc;
  color: #a7b3c2;
  font-weight: 800;
  cursor: not-allowed;
}
.pager nav,
nav.pager {
  margin-left: auto;
}

/* Patch 0.7.0: opportunity status actions */
.message-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.message-draft-head h4 {
  margin: 0;
}
.opportunity-main-actions {
  margin-bottom: 14px;
}
.opportunity-status-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opportunity-status-actions b {
  color: var(--ink);
  margin-bottom: 2px;
}
.opportunity-status-actions form {
  margin: 0;
}
.status-action {
width:100%;
  justify-content: center;
  background: #fff;
}
.status-work {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.danger-action {
  border-color: #fecaca;
  color: var(--danger);
  background: #fff7f7;
}
.status-new {
  background: #e8f3ff;
  color: #075985;
}
.status-message_sent {
  background: #e0f2fe;
  color: #075985;
}
.status-reply_received {
  background: #dcfce7;
  color: #15803d;
}
.status-deal_started {
  background: #ede9fe;
  color: #6d28d9;
}

/* Patch 0.8.0: background processing and queue */
.worker-status {
  display: grid;
grid-template-columns:repe…));
  gap: 12px;
}
.worker-status > div,
.queue-mini-grid > div,
.pipeline-steps > div {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 14px;
  padding: 14px;
}
.worker-status span,
.queue-mini-grid span,
.pipeline-steps span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.worker-status strong,
.queue-mini-grid strong,
.pipeline-steps strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}
.pipeline-summary {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6fafc;
  border: 1px solid var(--line);
}
.pipeline-summary p { margin: 0 0 6px; }
.pipeline-summary p:last-child { margin-bottom: 0; }
.queue-mini-grid {
  display: grid;
grid-template-columns:repe…));
  gap: 12px;
}
.pipeline-steps {
  display: grid;
grid-template-columns:repe…));
  gap: 12px;
  margin-top: 14px;
}
.pipeline-steps b {
  display: block;
  margin-bottom: 8px;
}
.sub-row td {
  background: #fbfdff;
  color: var(--muted);
  font-size: 13px;
  border-top: 0;
}
.status-done {
  background: #dcfce7;
  color: #15803d;
}
.status-error {
  background: #fee2e2;
  color: #b91c1c;
}
.status-skipped,
.status-muted {
  background: #f3f4f6;
  color: #475569;
}
.compact-empty {
  min-height: auto;
}
@media (max-width: 1200px) {
  .worker-status,
  .pipeline-steps {
grid-template-columns:repe…));
  }
}

/* Patch 0.8.1: structured help drawer */
.help-drawer {
  right: -520px;
width:480px;
max-width:calc…x);
  overflow-y: auto;
}
.help-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.help-body {
  color: var(--ink);
  line-height: 1.6;
  padding-bottom: 28px;
}
.help-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--ink);
}
.help-body h3:first-child { margin-top: 0; }
.help-body p {
  margin: 0 0 10px;
  color: var(--muted);
}
.help-body ul,
.help-body ol {
  margin: 8px 0 14px 20px;
  padding: 0;
  color: var(--muted);
}
.help-body li { margin-bottom: 7px; }
.help-body code {
  background: #f3f8fc;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1px 5px;
  color: var(--primary-dark);
}
.panel-actions .ghost-button,
.detail-actions .ghost-button,
.modal-header .ghost-button {
  flex: 0 0 auto;
}

/* Patch 0.9.0 */
.five-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.actions-cell form { margin: 0; }
.danger-lite {
  border-color: #fecaca !important;
  background: #fff7f7 !important;
  color: #b91c1c !important;
}
.status-disabled {
  background: #fee2e2;
  color: #b91c1c;
}
.status-paused,
.status-needs_check {
  background: #fef3c7;
  color: #92400e;
}
.form-grid .full-span { grid-column: 1 / -1; }
.info-box {
  background: #f8fbfe;
  border: 1px dashed #c9d8e6;
  border-radius: 14px;
  padding: 12px;
  color: var(--muted);
}
@media (max-width: 1400px) {
  .five-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.filter-row {
  display: grid;
grid-template-columns:minm…to;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.filter-row label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.filter-row input,
.filter-row select,
.form-grid input,
.form-grid select,
.form-grid textarea {
width:100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}
.form-grid {
  display: grid;
grid-template-columns:repe…));
  gap: 14px;
}
.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #f8fbfe;
  color: var(--primary-dark);
  border-radius: 10px;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 1400px) {
  .filter-row { grid-template-columns: 1fr 1fr; }
}

/* Patch 0.9.1: cleaner sources table */
.sources-table th,
.sources-table td {
  vertical-align: middle;
}
.sources-table .source-main-cell strong {
  display: block;
  margin-bottom: 4px;
}
.sources-table .status {
  margin-top: 6px;
}
.source-activity-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 13px;
}
.source-activity-line span:first-child {
  color: var(--muted);
}
.source-note-cell {
max-width:320px;
  color: var(--muted);
  line-height: 1.35;
}
.actions-head {
  text-align: right !important;
}
.icon-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.icon-action {
width:34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.icon-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.danger-icon {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}
.success-icon {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
@media (max-width: 1400px) {
  .source-note-cell { max-width: 220px; }
}


/* Patch 0.9.2: sources table clarity */
.sources-table .source-actions-cell {
  display: table-cell;
  text-align: right;
  vertical-align: middle;
width:86px;
min-width:86px;
}
.source-actions-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.source-actions-wrap form {
  display: inline-flex;
  margin: 0;
}
.sources-table .icon-action {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 16px;
}
.http-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.http-ok {
  background: #dcfce7;
  color: #166534;
}
.http-error {
  background: #fee2e2;
  color: #b91c1c;
}
.sources-table .source-note-cell {
min-width:120px;
}

/* Patch 0.9.3: final compact sources table */
.sources-panel .sources-filter-row {
grid-template-columns:minm…to;
}
.sources-table {
  table-layout: fixed;
width:100%;
}
.sources-col-main { width: 27%; }
.sources-col-type { width: 12%; }
.sources-col-stats { width: 12%; }
.sources-col-activity { width: 23%; }
.sources-col-note { width: 18%; }
.sources-col-actions { width: 76px; }
.sources-table th,
.sources-table td {
  vertical-align: top;
}
.sources-table .source-main-cell,
.sources-table .source-type-cell,
.sources-table .source-stats-cell,
.sources-table .source-activity-cell,
.sources-table .source-note-cell {
  padding-top: 14px;
  padding-bottom: 14px;
}
.sources-table .source-main-cell strong {
  line-height: 1.25;
}
.source-type-cell .status {
  display: inline-flex;
  margin-top: 8px;
}
.source-stats-cell,
.source-activity-cell,
.source-note-cell {
  font-size: 13px;
}
.source-stat-row,
.source-activity-row,
.source-api-row {
  display: grid;
grid-template-columns:86px…r);
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
  min-height: 24px;
}
.source-label,
.source-stat-row span {
  color: var(--muted);
}
.source-stat-row strong,
.source-activity-row strong {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}
.danger-text { color: #b91c1c !important; }
.source-api-row .http-status {
  justify-self: start;
}
.sources-table .source-note-cell {
min-width:0;
max-width:none;
  overflow-wrap: anywhere;
  line-height: 1.45;
  color: var(--muted);
}
.sources-table .source-actions-cell {
  display: table-cell;
width:76px;
min-width:76px;
  text-align: right;
  vertical-align: middle;
  padding-top: 12px;
  padding-bottom: 12px;
}
.source-actions-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
min-width:42px;
}
.sources-table .icon-action {
width:34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sources-table .icon-action svg {
width:18px;
  height: 18px;
  display: block;
  fill: currentColor;
}
@media (max-width: 1400px) {
  .sources-panel .sources-filter-row { grid-template-columns: 1fr 1fr; }
  .sources-table { table-layout: auto; }
  .sources-col-main,
  .sources-col-type,
  .sources-col-stats,
  .sources-col-activity,
  .sources-col-note,
  .sources-col-actions { width: auto; }
  .source-stat-row,
  .source-activity-row,
  .source-api-row {
grid-template-columns:78px…r);
  }
}

/* Patch 0.10.0: product profiles and signal rules */
.profile-grid {
  display: grid;
grid-template-columns:repe…));
  gap: 14px;
}
.profile-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.profile-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.profile-card-section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-card-section b {
  font-size: 13px;
}
.profile-card-section span {
  color: var(--muted);
  line-height: 1.42;
}
.profile-card-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}
.profile-card-actions form { margin: 0; }
.status-border-active { border-color: #bbf7d0; }
.status-border-disabled { border-color: #fecaca; background: #fffafa; }
.rules-filter-row {
grid-template-columns:minm…to;
}
.rules-table td:nth-child(4),
.rules-table td:nth-child(5) {
max-width:360px;
  line-height: 1.45;
  color: var(--muted);
}
.rules-table td:nth-child(1),
.rules-table td:nth-child(2) {
min-width:180px;
}
.rules-table .status {
  margin-top: 8px;
  display: inline-flex;
}
.status-active {
  background: #dcfce7;
  color: #15803d;
}
@media (max-width: 1400px) {
  .profile-grid { grid-template-columns: 1fr; }
  .rules-filter-row { grid-template-columns: 1fr 1fr; }
}

/* Patch 0.10.1: cleaner product profiles UI */
.product-profiles-wrap {
  overflow-x: auto;
}
.product-profiles-table {
  table-layout: fixed;
min-width:1120px;
}
.product-profiles-table th:nth-child(1) { width: 210px; }
.product-profiles-table th:nth-child(2) { width: 120px; }
.product-profiles-table th:nth-child(3) { width: 300px; }
.product-profiles-table th:nth-child(4) { width: 300px; }
.product-profiles-table th:nth-child(5) { width: 110px; }
.product-profiles-table th:nth-child(6) { width: 110px; }
.product-profiles-table .selected-row {
  background: #f0f9ff;
  box-shadow: inset 4px 0 0 var(--accent);
}
.compact-text-cell {
  color: var(--muted);
  line-height: 1.42;
max-width:340px;
}
.product-profiles-table .icon-actions,
.rule-card-actions.icon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.product-profiles-table .icon-actions form,
.rule-card-actions form {
  margin: 0;
}
.info-icon {
  border-color: #bae6fd;
  background: #eff6ff;
  color: #0369a1;
}
.info-icon svg,
.product-profiles-table .icon-action svg,
.rule-card-actions .icon-action svg {
width:18px;
  height: 18px;
  display: block;
  fill: currentColor;
}
.selected-product-panel {
  border: 1px solid #bae6fd;
}
.product-tab-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.product-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}
.product-tab.active,
.product-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.selected-product-grid {
  display: grid;
grid-template-columns:220p…));
  gap: 14px;
}
.product-info-card {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  min-height: 118px;
}
.product-info-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}
.product-info-card strong {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}
.product-info-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}
.wide-info-card {
min-width:0;
}
.rules-card-list {
  display: grid;
  gap: 12px;
}
.rule-card {
  display: grid;
grid-template-columns:minm…px;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.rule-card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.rule-card-title h3 {
  margin: 0;
  font-size: 17px;
}
.rule-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.rule-card-grid {
  display: grid;
grid-template-columns:minm…r);
  gap: 16px;
  margin-top: 13px;
}
.rule-card-grid b {
  display: block;
  margin-bottom: 5px;
}
.rule-card-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.rule-card-actions {
  align-self: center;
}
@media (max-width: 1500px) {
  .selected-product-grid { grid-template-columns: 1fr 1fr; }
  .rules-filter-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1050px) {
  .selected-product-grid,
  .rule-card-grid,
  .rule-card { grid-template-columns: 1fr; }
  .rule-card-actions.icon-actions { justify-content: flex-start; }
}

/* Patch 0.10.2: admin-style product profiles screen */
.admin-table-panel .muted-line,
.admin-detail-panel .muted-line {
  margin: 2px 0 0;
}
.admin-compact-table {
  table-layout: fixed;
min-width:980px;
}
.admin-compact-table th,
.admin-compact-table td {
  white-space: nowrap;
  vertical-align: middle;
}
.product-profiles-table.admin-compact-table th:nth-child(1) { width: 190px; }
.product-profiles-table.admin-compact-table th:nth-child(2) { width: 260px; }
.product-profiles-table.admin-compact-table th:nth-child(3) { width: 120px; }
.product-profiles-table.admin-compact-table th:nth-child(4) { width: 90px; }
.product-profiles-table.admin-compact-table th:nth-child(5) { width: 90px; }
.product-profiles-table.admin-compact-table th:nth-child(6) { width: 90px; }
.product-profiles-table.admin-compact-table th:nth-child(7) { width: 105px; }
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover {
  background: #f8fbff;
}
.product-profiles-table .actions-cell,
.admin-rules-table .actions-cell {
  text-align: right;
}
.product-profiles-table .icon-actions,
.admin-rules-table .icon-actions {
  display: table-cell;
  white-space: nowrap;
}
.product-profiles-table .icon-actions form,
.admin-rules-table .icon-actions form {
  display: inline-flex;
  margin: 0 0 0 6px;
  vertical-align: middle;
}
.profile-detail-table {
  table-layout: fixed;
}
.profile-detail-table th {
width:220px;
  color: var(--muted);
  font-weight: 800;
}
.profile-detail-table td,
.profile-detail-table th {
  vertical-align: top;
  line-height: 1.45;
}
.compact-subheader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 6px 0 16px;
}
.compact-subheader h3 {
  margin: 0;
  font-size: 18px;
}
.compact-rules-filter {
grid-template-columns:minm…fr;
  margin-bottom: 14px;
}
.rules-table-wrap {
  overflow-x: auto;
}
.admin-rules-table {
  table-layout: fixed;
min-width:1420px;
}
.admin-rules-table th:nth-child(1) { width: 170px; }
.admin-rules-table th:nth-child(2) { width: 170px; }
.admin-rules-table th:nth-child(3) { width: 220px; }
.admin-rules-table th:nth-child(4) { width: 90px; }
.admin-rules-table th:nth-child(5) { width: 120px; }
.admin-rules-table th:nth-child(6) { width: 310px; }
.admin-rules-table th:nth-child(7) { width: 310px; }
.admin-rules-table th:nth-child(8) { width: 90px; }
.admin-long-cell {
  white-space: normal !important;
  line-height: 1.38;
  color: var(--muted);
}
.management-grid {
  display: grid;
grid-template-columns:minm…r);
  gap: 16px;
}
.management-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
}
.management-card h3 {
  margin: 0 0 8px;
}
.danger-button {
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #b91c1c;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
@media (max-width: 1200px) {
  .compact-rules-filter,
  .management-grid { grid-template-columns: 1fr; }
}

/* Patch 0.10.3: product profiles as list + separate detail page */
.product-profiles-list-table {
  table-layout: fixed;
min-width:1040px;
}
.product-profiles-list-table th:nth-child(1) { width: 62px; }
.product-profiles-list-table th:nth-child(2) { width: 210px; }
.product-profiles-list-table th:nth-child(3) { width: 300px; }
.product-profiles-list-table th:nth-child(4) { width: 130px; }
.product-profiles-list-table th:nth-child(5) { width: 90px; }
.product-profiles-list-table th:nth-child(6) { width: 90px; }
.product-profiles-list-table th:nth-child(7) { width: 100px; }
.product-profiles-list-table th:nth-child(8) { width: 105px; }
.product-profiles-list-table th,
.product-profiles-list-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  height: 44px;
  vertical-align: middle;
}
.product-profiles-list-table td strong,
.product-profiles-list-table td code,
.product-profiles-list-table .status {
  white-space: nowrap;
}
.product-profile-detail-header {
  margin-bottom: 12px;
}
.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.detail-title-row h2 {
  margin: 6px 0 4px;
}
.back-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
}
.back-link:hover {
  text-decoration: underline;
}
.tabs-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.tab-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 800;
}
.tab-link.active,
.tab-link:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}
.admin-rules-table {
  table-layout: fixed;
min-width:1320px;
}
.admin-rules-table th:nth-child(1) { width: 60px; }
.admin-rules-table th:nth-child(2) { width: 160px; }
.admin-rules-table th:nth-child(3) { width: 180px; }
.admin-rules-table th:nth-child(4) { width: 230px; }
.admin-rules-table th:nth-child(5) { width: 90px; }
.admin-rules-table th:nth-child(6) { width: 120px; }
.admin-rules-table th:nth-child(7) { width: 270px; }
.admin-rules-table th:nth-child(8) { width: 270px; }
.admin-rules-table th:nth-child(9) { width: 105px; }
.admin-rules-table th,
.admin-rules-table td {
  vertical-align: middle;
}
.admin-long-cell {
  white-space: normal !important;
  line-height: 1.35;
  color: var(--ink);
}
.product-detail-tabs {
  margin-left: 2px;
}
@media (max-width: 1200px) {
  .detail-title-row { align-items: flex-start; flex-direction: column; }
  .product-profiles-list-table,
  .admin-rules-table { table-layout: auto; }
}


/* Patch 0.10.4: clean product profile detail layout */
.compact-profile-header {
  margin-bottom: 12px;
  padding: 16px 18px;
}
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.detail-summary {
min-width:0;
}
.compact-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 0 !important;
}
.compact-header-actions form {
  margin: 0;
}
.secondary-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
.secondary-danger-button:hover {
  background: #fff7f7;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.admin-tab.active {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
  box-shadow: inset 0 -3px 0 var(--primary);
}
.admin-tab:hover {
  border-color: #7dd3fc;
  color: #075985;
}
@media (max-width: 1200px) {
  .detail-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Patch 0.10.5: product profile admin UI cleanup */
.sidebar.collapsed .brand { display: none; }
.sidebar.collapsed .sidebar-top { justify-content: center; }
.sidebar.collapsed .icon-button { margin: 0 auto; }

.product-profile-metrics {
  gap: 12px;
  margin-bottom: 16px;
}
.product-profile-metrics .metric-card {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
}
.product-profile-metrics .metric-card span {
  font-size: 12px;
}
.product-profile-metrics .metric-card strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
}
.product-profile-metrics .metric-card small {
  margin-top: 6px;
  display: block;
  font-size: 11px;
  line-height: 1.1;
}

.product-profiles-panel .panel-header { margin-bottom: 10px; }
.product-profiles-list-table {
  table-layout: fixed;
min-width:980px;
}
.product-profiles-list-table th:nth-child(1) { width: 48px; }
.product-profiles-list-table th:nth-child(2) { width: 170px; }
.product-profiles-list-table th:nth-child(3) { width: 360px; }
.product-profiles-list-table th:nth-child(4) { width: 110px; }
.product-profiles-list-table th:nth-child(5) { width: 80px; }
.product-profiles-list-table th:nth-child(6) { width: 90px; }
.product-profiles-list-table th:nth-child(7) { width: 90px; }
.product-profiles-list-table th:nth-child(8) { width: 104px; }
.product-profiles-list-table th,
.product-profiles-list-table td {
  height: 44px;
  padding-top: 8px;
  padding-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-profiles-list-table td:nth-child(3) strong {
  display: inline-block;
max-width:300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.product-profiles-list-table .status {
  white-space: nowrap;
  vertical-align: middle;
}
.product-profiles-list-table .actions-cell {
  text-align: right;
}
.product-profiles-list-table .icon-actions form { margin-left: 5px; }
.product-profiles-list-table .icon-action {
width:30px;
  height: 30px;
  vertical-align: middle;
}

.compact-profile-header {
  padding: 14px 18px;
}
.compact-profile-header .back-link {
  font-size: 14px;
}
.compact-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px !important;
}
.compact-header-actions .secondary-danger-button,
.compact-header-actions .primary-button,
.compact-header-actions .ghost-button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
}
.product-profile-tabs.admin-tabs {
  gap: 8px;
  margin: 14px 0 16px;
}
.product-profile-tabs .admin-tab {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
}
.product-profile-tabs .admin-tab.active {
  background: #e0f2fe;
  border-color: #38bdf8;
  box-shadow: inset 0 -3px 0 #0ea5e9;
}

.admin-rules-table {
  table-layout: fixed;
min-width:1260px;
}
.admin-rules-table th:nth-child(1) { width: 48px; }
.admin-rules-table th:nth-child(2) { width: 160px; }
.admin-rules-table th:nth-child(3) { width: 170px; }
.admin-rules-table th:nth-child(4) { width: 190px; }
.admin-rules-table th:nth-child(5) { width: 72px; }
.admin-rules-table th:nth-child(6) { width: 100px; }
.admin-rules-table th:nth-child(7) { width: 260px; }
.admin-rules-table th:nth-child(8) { width: 260px; }
.admin-rules-table th:nth-child(9) { width: 70px; }
.admin-rules-table th,
.admin-rules-table td {
  vertical-align: top;
  font-size: 13px;
  line-height: 1.28;
  padding-top: 9px;
  padding-bottom: 9px;
}
.admin-rules-table th {
  font-size: 12px;
}
.admin-rules-table .actions-cell { text-align: right; }
.admin-rules-table .icon-action {
width:30px;
  height: 30px;
}
.sub-code {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.admin-long-cell {
  font-size: 13px;
  line-height: 1.28;
}
.rules-filter-row.compact-rules-filter {
  align-items: flex-end;
  margin-bottom: 12px;
}

/* Patch 000.011.000: AI dossier blocks */
.ai-dossier-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.ai-dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ai-dossier-head h4,
.ai-dossier-card p {
  margin: 0 0 8px;
}
.ai-dossier-card p:last-child {
  margin-bottom: 0;
}
.ai-message-draft {
  border-color: #bce4ff;
  background: #f3fbff;
}
.ai-inline-form {
  margin-top: 14px;
}
.ai-error-state {
  margin-top: 14px;
}
.status-done {
  background: #d9f8e7;
  color: #087a38;
}
@media (min-width: 1200px) {
  .five-cards {
grid-template-columns:repe…));
  }
}

/* Patch 000.011.002: opportunities table + separate detail card */
.opportunities-metrics {
  gap: 12px;
  margin-bottom: 16px;
}
.opportunities-metrics .compact-metric-card {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
}
.opportunities-metrics .compact-metric-card span { font-size: 12px; }
.opportunities-metrics .compact-metric-card strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
}
.opportunities-metrics .compact-metric-card small {
  margin-top: 6px;
  display: block;
  font-size: 11px;
  line-height: 1.1;
}
.opportunities-panel .panel-header { margin-bottom: 10px; }
.compact-opportunity-filter {
  align-items: flex-end;
  margin-bottom: 12px;
}
.compact-opportunity-filter label:nth-child(1) { flex: 1 1 260px; }
.compact-opportunity-filter label:nth-child(2) { flex: 0 0 180px; }
.compact-opportunity-filter label:nth-child(3) { flex: 0 0 150px; }
.opportunities-table {
  table-layout: fixed;
min-width:1180px;
}
.opportunities-table th:nth-child(1) { width: 245px; }
.opportunities-table th:nth-child(2) { width: 360px; }
.opportunities-table th:nth-child(3) { width: 92px; }
.opportunities-table th:nth-child(4) { width: 95px; }
.opportunities-table th:nth-child(5) { width: 130px; }
.opportunities-table th:nth-child(6) { width: 130px; }
.opportunities-table th:nth-child(7) { width: 132px; }
.opportunities-table th:nth-child(8) { width: 74px; }
.opportunities-table th,
.opportunities-table td {
  height: 46px;
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.25;
}
.opportunities-table td:nth-child(3),
.opportunities-table td:nth-child(4),
.opportunities-table td:nth-child(5),
.opportunities-table td:nth-child(6),
.opportunities-table td:nth-child(7),
.opportunities-table td:nth-child(8) {
  white-space: nowrap;
}
.opportunity-company-cell strong,
.opportunity-reason-cell strong,
.opportunity-company-cell .muted-line,
.opportunity-reason-cell .muted-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-company-cell .muted-line,
.opportunity-reason-cell .muted-line {
  margin-top: 4px;
  font-size: 12px;
}
.score-value { font-size: 16px; }
.status-muted {
  background: #f1f5f9;
  color: #64748b;
}
.opportunities-table .actions-cell { text-align: right; }
.opportunities-table .icon-action {
width:30px;
  height: 30px;
}
.opportunity-detail-header {
  margin-bottom: 12px;
}
.opportunity-tabs.admin-tabs {
  gap: 8px;
  margin: 14px 0 16px;
}
.opportunity-tabs .admin-tab {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
}
.opportunity-detail-panel .panel-header {
  margin-bottom: 14px;
}
.detail-grid.two-columns {
  display: grid;
grid-template-columns:repe…));
  gap: 12px;
}
.detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
}
.detail-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.detail-card p {
  margin: 0;
  line-height: 1.45;
}
.subsection-block {
  margin-top: 16px;
}
.subsection-block h3 {
  margin: 0 0 10px;
}
.compact-signal-table {
  table-layout: fixed;
min-width:980px;
}
.compact-signal-table th:nth-child(1) { width: 150px; }
.compact-signal-table th:nth-child(2) { width: 210px; }
.compact-signal-table th:nth-child(3) { width: 90px; }
.compact-signal-table th:nth-child(4) { width: 260px; }
.compact-signal-table th:nth-child(5) { width: 260px; }
.compact-signal-table th,
.compact-signal-table td {
  vertical-align: top;
  font-size: 13px;
  line-height: 1.3;
}
.compact-message-draft {
  margin-top: 16px;
}
.ai-dossier-detail-card {
  margin-top: 0;
  margin-bottom: 14px;
}
.ai-dossier-detail-card .ai-dossier-head h3 {
  margin: 0;
}
.ai-meta-table th { width: 180px; }
.source-text-cell {
  white-space: pre-wrap;
  line-height: 1.45;
}
.status-actions-grid {
  display: grid;
grid-template-columns:repe…));
  gap: 10px;
  margin-bottom: 16px;
}
.status-actions-grid form { margin: 0; }
.status-actions-grid .status-action {
width:100%;
  min-height: 38px;
}
.actions-history-table {
min-width:900px;
}
.actions-history-table th,
.actions-history-table td {
  vertical-align: top;
  font-size: 13px;
}
@media (max-width: 1200px) {
  .detail-grid.two-columns,
  .status-actions-grid {
grid-template-columns:1fr;
  }
  .compact-opportunity-filter {
    display: grid;
grid-template-columns:1fr;
  }
}

/* Patch 000.012.000: company detail history tabs */
.company-history-header {
  margin-bottom: 12px;
}
.company-history-metrics {
  gap: 12px;
  margin-bottom: 14px;
}
.company-history-metrics .compact-metric-card {
  min-height: 70px;
  padding: 12px 14px;
  border-radius: 14px;
}
.company-history-metrics .compact-metric-card span {
  font-size: 12px;
}
.company-history-metrics .compact-metric-card strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
}
.company-history-metrics .compact-metric-card small {
  margin-top: 6px;
  display: block;
  font-size: 11px;
  line-height: 1.1;
}
.company-tabs.admin-tabs {
  gap: 8px;
  margin: 12px 0 16px;
}
.company-tabs .admin-tab {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
}
.company-detail-panel .panel-header {
  margin-bottom: 12px;
}
.compact-dl {
  display: grid;
grid-template-columns:150p…r);
  gap: 10px 14px;
  margin: 0;
}
.compact-dl dt {
  color: var(--muted);
  font-weight: 800;
}
.compact-dl dd {
  margin: 0;
  font-weight: 700;
min-width:0;
}
.long-text-cell {
  white-space: normal !important;
  line-height: 1.32;
}
.long-text-cell b,
.long-text-cell span {
  display: block;
}
.company-materials-table,
.company-events-history-table,
.company-signals-history-table,
.company-opportunities-history-table,
.company-aliases-table {
  table-layout: fixed;
min-width:1120px;
}
.company-materials-table th:nth-child(1) { width: 130px; }
.company-materials-table th:nth-child(2) { width: 130px; }
.company-materials-table th:nth-child(3) { width: 360px; }
.company-materials-table th:nth-child(4) { width: 180px; }
.company-materials-table th:nth-child(5) { width: 110px; }
.company-materials-table th:nth-child(6) { width: 120px; }
.company-materials-table th:nth-child(7) { width: 90px; }
.company-events-history-table th:nth-child(1) { width: 130px; }
.company-events-history-table th:nth-child(2) { width: 180px; }
.company-events-history-table th:nth-child(3) { width: 420px; }
.company-events-history-table th:nth-child(4) { width: 110px; }
.company-events-history-table th:nth-child(5) { width: 130px; }
.company-events-history-table th:nth-child(6) { width: 120px; }
.company-signals-history-table th:nth-child(1) { width: 130px; }
.company-signals-history-table th:nth-child(2) { width: 220px; }
.company-signals-history-table th:nth-child(3) { width: 110px; }
.company-signals-history-table th:nth-child(4) { width: 85px; }
.company-signals-history-table th:nth-child(5) { width: 300px; }
.company-signals-history-table th:nth-child(6) { width: 300px; }
.company-signals-history-table th:nth-child(7) { width: 120px; }
.company-opportunities-history-table th:nth-child(1) { width: 130px; }
.company-opportunities-history-table th:nth-child(2) { width: 430px; }
.company-opportunities-history-table th:nth-child(3) { width: 95px; }
.company-opportunities-history-table th:nth-child(4) { width: 90px; }
.company-opportunities-history-table th:nth-child(5) { width: 135px; }
.company-opportunities-history-table th:nth-child(6) { width: 130px; }
.company-opportunities-history-table th:nth-child(7) { width: 90px; }
.company-aliases-table th:nth-child(1) { width: 150px; }
.company-aliases-table th:nth-child(2) { width: 340px; }
.company-aliases-table th:nth-child(3) { width: 340px; }
.company-aliases-table th:nth-child(4) { width: 140px; }
.company-aliases-table th:nth-child(5) { width: 150px; }
.company-small-table {
  table-layout: fixed;
min-width:520px;
}
.company-small-table th:nth-child(1) { width: 170px; }
.company-small-table th:nth-child(2) { width: 260px; }
.company-small-table th:nth-child(3) { width: 100px; }
.company-materials-table th,
.company-materials-table td,
.company-events-history-table th,
.company-events-history-table td,
.company-signals-history-table th,
.company-signals-history-table td,
.company-opportunities-history-table th,
.company-opportunities-history-table td,
.company-aliases-table th,
.company-aliases-table td,
.company-small-table th,
.company-small-table td {
  vertical-align: top;
  font-size: 13px;
  line-height: 1.28;
  padding-top: 9px;
  padding-bottom: 9px;
}
.status-medium {
  background: #fef3c7;
  color: #92400e;
}
.status-high {
  background: #fee2e2;
  color: #b91c1c;
}
.status-low {
  background: #dcfce7;
  color: #15803d;
}
@media (max-width: 1200px) {
  .company-tabs.admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .company-tabs .admin-tab {
    white-space: nowrap;
  }
  .compact-dl {
grid-template-columns:1fr;
  }
}

/* Patch 000.012.001: company card cleanup */
.company-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 14px 18px;
}
.company-card-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.company-card-toolbar .ghost-button {
  margin-left: auto;
}
.company-history-metrics {
  display: none !important;
}
.company-tabs.admin-tabs {
  margin-top: 6px;
}
.company-tabs .admin-tab {
  gap: 8px;
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
min-width:22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: #075985;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.company-tabs .admin-tab.active .tab-count {
  background: #0ea5e9;
  color: #fff;
}
.company-detail-panel .panel-header {
  align-items: center;
}
.company-detail-panel .panel-actions.icon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.company-detail-panel .icon-action {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
}
.company-tech-table {
max-width:900px;
min-width:640px;
}
.company-tech-table th {
width:220px;
}
.company-aliases-table th:nth-child(1) { width: 190px; }
.company-aliases-table th:nth-child(2) { width: 360px; }
.company-aliases-table th:nth-child(3) { width: 360px; }
.company-aliases-table th:nth-child(4) { width: 140px; }
.company-aliases-table th:nth-child(5) { width: 150px; }
.status-active,
.status-verified,
.status-done,
.status-ok,
.status-signals_detected,
.status-opportunity_created,
.status-matched,
.status-detected,
.status-processed {
  background: #dcfce7;
  color: #15803d;
}
.status-inactive,
.status-disabled,
.status-muted,
.status-ignored,
.status-no_signal,
.status-no_company_match {
  background: #f1f5f9;
  color: #475569;
}
.status-error {
  background: #fee2e2;
  color: #b91c1c;
}
.status-needs_review,
.status-retry,
.status-processing {
  background: #fef3c7;
  color: #92400e;
}
@media (max-width: 1200px) {
  .company-card-toolbar {
    align-items: flex-start;
    flex-direction: row;
  }
}

/* Patch 000.013.000: sources compact UI + batch API diagnostics */
.compact-metrics-grid.sources-metrics {
  gap: 12px;
  margin-bottom: 16px;
}
.sources-metrics .compact-metric-card {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
}
.sources-metrics .compact-metric-card span {
  font-size: 12px;
}
.sources-metrics .compact-metric-card strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
}
.sources-metrics .compact-metric-card small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.1;
}
.compact-sources-panel .compact-panel-header {
  margin-bottom: 10px;
}
.compact-source-filter {
grid-template-columns:minm…to;
  align-items: flex-end;
  margin-bottom: 12px;
}
.compact-sources-table {
  table-layout: fixed;
min-width:1120px;
}
.compact-sources-table .sources-col-main { width: 230px; }
.compact-sources-table .sources-col-type { width: 150px; }
.compact-sources-table .sources-col-stats { width: 140px; }
.compact-sources-table .sources-col-api { width: 150px; }
.compact-sources-table .sources-col-activity { width: 300px; }
.compact-sources-table .sources-col-actions { width: 130px; }
.compact-sources-table th,
.compact-sources-table td {
  height: 48px;
  padding: 8px 10px;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.25;
}
.compact-sources-table .source-main-cell,
.compact-sources-table .source-type-cell,
.compact-sources-table .source-stats-cell,
.compact-sources-table .source-api-cell,
.compact-sources-table .source-activity-cell {
  padding-top: 8px;
  padding-bottom: 8px;
}
.compact-sources-table .source-main-cell strong {
  display: block;
  margin: 0 0 5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-sources-table .source-main-cell code,
.compact-sources-table .source-type-cell code {
  font-size: 11px;
}
.compact-sources-table .status {
  margin-top: 5px;
  padding: 4px 8px;
  font-size: 11px;
}
.compact-sources-table .source-stats-cell div,
.compact-sources-table .source-api-cell div,
.compact-sources-table .source-activity-cell div {
  margin: 0 0 5px;
  white-space: nowrap;
}
.compact-sources-table .source-activity-cell small {
  display: block;
  margin-top: 2px;
  line-height: 1.2;
}
.compact-sources-table .http-status {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 11px;
}
.compact-sources-table .source-actions-cell {
width:130px;
min-width:130px;
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}
.compact-sources-table .source-actions-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
min-width:118px;
}
.compact-sources-table .icon-action {
width:32px;
  height: 32px;
  border-radius: 10px;
}
.compact-sources-table .icon-action svg {
width:17px;
  height: 17px;
}
.source-api-help pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}
.source-api-help h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}
@media (max-width: 1400px) {
  .compact-source-filter { grid-template-columns: 1fr 1fr; }
  .compact-sources-table { table-layout: auto; }
}

/* Patch 0.13.1 */
.inline-form { margin: 0; }

/* Patch 0.13.2: product profiles list cleanup */
.product-profiles-clean-table {
  table-layout: fixed;
min-width:760px;
}
.product-profiles-clean-table th:nth-child(1) { width: auto; }
.product-profiles-clean-table th:nth-child(2) { width: 120px; }
.product-profiles-clean-table th:nth-child(3) { width: 78px; }
.product-profiles-clean-table th:nth-child(4) { width: 86px; }
.product-profiles-clean-table th:nth-child(5) { width: 86px; }
.product-profiles-clean-table th:nth-child(6) { width: 96px; }
.product-profiles-clean-table th,
.product-profiles-clean-table td {
  height: 46px;
  padding: 8px 10px;
  vertical-align: middle;
}
.product-profiles-clean-table .profile-main-cell {
min-width:0;
  white-space: normal;
}
.product-profiles-clean-table .profile-main-cell strong {
  display: block;
max-width:100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}
.product-profiles-clean-table .profile-main-cell small {
  display: inline-block;
max-width:52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--muted);
  margin-top: 4px;
}
.product-profiles-clean-table .profile-main-cell code {
  display: inline-block;
max-width:42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 8px;
}
.product-profiles-clean-table .status {
  white-space: nowrap;
}
.product-profiles-clean-table .actions-cell {
  text-align: right;
}


/* Patch 0.13.3: product profiles table column balance */
.product-profiles-final-table {
width:100%;
  table-layout: fixed;
min-width:1120px;
}
.product-profiles-final-table .profile-col-id { width: 54px; }
.product-profiles-final-table .profile-col-code { width: 170px; }
.product-profiles-final-table .profile-col-main { width: auto; }
.product-profiles-final-table .profile-col-status { width: 96px; }
.product-profiles-final-table .profile-col-small { width: 82px; }
.product-profiles-final-table .profile-col-actions { width: 92px; }
.product-profiles-final-table th,
.product-profiles-final-table td {
  padding: 8px 10px;
  height: 42px;
  vertical-align: middle;
}
.product-profiles-final-table .profile-id-cell,
.product-profiles-final-table .profile-number-cell,
.product-profiles-final-table .profile-status-cell,
.product-profiles-final-table .actions-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.product-profiles-final-table .profile-code-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-profiles-final-table .profile-main-cell {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}
.product-profiles-final-table .profile-main-cell strong {
  display: inline;
max-width:none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  vertical-align: baseline;
}
.product-profiles-final-table .profile-client-name {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
  white-space: normal;
}
.product-profiles-final-table .profile-client-name::before {
  content: '· ';
}
.product-profiles-final-table .status {
  display: inline-flex;
  white-space: nowrap;
}
.product-profiles-final-table .icon-actions {
  justify-content: flex-end;
  gap: 6px;
}
.product-profiles-final-table .icon-actions form {
  margin-left: 0;
}
.product-profiles-final-table .icon-action {
width:28px;
  height: 28px;
}

/* Patch 0.13.4: strict compact widths for product profiles table */
.product-profiles-table.product-profiles-final-table {
width:100%;
  table-layout: fixed;
min-width:0;
}
.product-profiles-table.product-profiles-final-table .profile-col-id,
.product-profiles-table.product-profiles-final-table th:nth-child(1),
.product-profiles-table.product-profiles-final-table td:nth-child(1) {
width:48px…nt;
max-width:48px…nt;
}
.product-profiles-table.product-profiles-final-table .profile-col-code,
.product-profiles-table.product-profiles-final-table th:nth-child(2),
.product-profiles-table.product-profiles-final-table td:nth-child(2) {
width:210p…nt;
max-width:210p…nt;
}
.product-profiles-table.product-profiles-final-table .profile-col-status,
.product-profiles-table.product-profiles-final-table th:nth-child(4),
.product-profiles-table.product-profiles-final-table td:nth-child(4) {
width:88px…nt;
max-width:88px…nt;
}
.product-profiles-table.product-profiles-final-table th:nth-child(5),
.product-profiles-table.product-profiles-final-table td:nth-child(5) {
width:66px…nt;
max-width:66px…nt;
}
.product-profiles-table.product-profiles-final-table th:nth-child(6),
.product-profiles-table.product-profiles-final-table td:nth-child(6) {
width:82px…nt;
max-width:82px…nt;
}
.product-profiles-table.product-profiles-final-table th:nth-child(7),
.product-profiles-table.product-profiles-final-table td:nth-child(7) {
width:88px…nt;
max-width:88px…nt;
}
.product-profiles-table.product-profiles-final-table .profile-col-actions,
.product-profiles-table.product-profiles-final-table th:nth-child(8),
.product-profiles-table.product-profiles-final-table td:nth-child(8) {
width:76px…nt;
max-width:76px…nt;
}
.product-profiles-table.product-profiles-final-table .profile-col-main,
.product-profiles-table.product-profiles-final-table th:nth-child(3),
.product-profiles-table.product-profiles-final-table td:nth-child(3) {
width:auto…nt;
}
.product-profiles-table.product-profiles-final-table th,
.product-profiles-table.product-profiles-final-table td {
  padding: 7px 8px;
}
.product-profiles-table.product-profiles-final-table .profile-id-cell,
.product-profiles-table.product-profiles-final-table .profile-number-cell,
.product-profiles-table.product-profiles-final-table .profile-status-cell,
.product-profiles-table.product-profiles-final-table .actions-cell {
  text-align: left;
  white-space: nowrap;
}
.product-profiles-table.product-profiles-final-table .profile-number-cell,
.product-profiles-table.product-profiles-final-table th:nth-child(5),
.product-profiles-table.product-profiles-final-table th:nth-child(6),
.product-profiles-table.product-profiles-final-table th:nth-child(7) {
  text-align: center;
}
.product-profiles-table.product-profiles-final-table .actions-cell {
  text-align: right;
  overflow: visible;
}
.product-profiles-table.product-profiles-final-table .profile-code-cell code {
max-width:100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-profiles-table.product-profiles-final-table .profile-main-cell {
min-width:0;
  white-space: normal;
  overflow: visible;
}
.product-profiles-table.product-profiles-final-table .profile-main-cell strong {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}
.product-profiles-table.product-profiles-final-table .profile-client-name {
  display: block;
  margin-left: 0;
  margin-top: 3px;
max-width:none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}
.product-profiles-table.product-profiles-final-table .status {
  display: inline-flex;
width:auto;
max-width:100%;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

/* Patch 000.014.000: рабочие фильтры итоговых возможностей */
.compact-work-metrics .compact-metric-card {
  min-height: 66px;
  padding: 11px 14px;
}
.opportunity-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}
.preset-chip:hover { border-color: var(--primary); background: #eaf7ff; }
.muted-preset { color: var(--muted); background: #fff; }
.work-opportunity-filter {
  display: grid;
grid-template-columns:minm…to;
  gap: 10px;
  align-items: end;
}
.work-opportunity-filter label { min-width: 0; }
.work-opportunity-filter .checkbox-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.checkbox-filter input {
width:16px;
  height: 16px;
  accent-color: var(--primary);
}
.work-opportunities-table {
  table-layout: fixed;
min-width:1120px;
width:100%;
}
.work-opportunities-table th:nth-child(1) { width: auto; }
.work-opportunities-table th:nth-child(2) { width: 82px; }
.work-opportunities-table th:nth-child(3) { width: 82px; }
.work-opportunities-table th:nth-child(4) { width: 132px; }
.work-opportunities-table th:nth-child(5) { width: 132px; }
.work-opportunities-table th:nth-child(6) { width: 126px; }
.work-opportunities-table th:nth-child(7) { width: 70px; }
.work-opportunities-table th,
.work-opportunities-table td {
  vertical-align: top;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 13px;
  line-height: 1.25;
}
.work-opportunities-table td:nth-child(2),
.work-opportunities-table td:nth-child(3),
.work-opportunities-table td:nth-child(4),
.work-opportunities-table td:nth-child(5),
.work-opportunities-table td:nth-child(6),
.work-opportunities-table td:nth-child(7) {
  white-space: nowrap;
}
.opportunity-main-cell {
  white-space: normal !important;
}
.opportunity-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
min-width:0;
}
.opportunity-main-title strong {
  display: block;
min-width:0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.profile-mini-badge {
  flex: 0 0 auto;
max-width:260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  border: 1px solid var(--line);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 11px;
}
.opportunity-company-meta {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opportunity-short-text {
  margin-top: 5px;
max-width:100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score-cell {
  text-align: left;
}
.score-cell .score-value {
  display: block;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 5px;
}
.ai-cell .status,
.source-cell small {
  display: block;
  margin-top: 4px;
}
.work-opportunities-table .actions-cell {
  text-align: right;
}
.work-opportunities-table .icon-action {
width:30px;
  height: 30px;
}
@media (max-width: 1500px) {
  .work-opportunity-filter {
grid-template-columns:repe…));
  }
}

/* Patch 000.014.001: чистка рабочего списка возможностей и источника */
.opportunity-presets { display: none !important; }
.work-opportunities-table-v2 {
  table-layout: fixed;
min-width:1050px;
  border-collapse: separate;
  border-spacing: 0;
}
.work-opportunities-table-v2 th:nth-child(1) { width: auto; }
.work-opportunities-table-v2 th:nth-child(2) { width: 64px; }
.work-opportunities-table-v2 th:nth-child(3) { width: 78px; }
.work-opportunities-table-v2 th:nth-child(4) { width: 108px; }
.work-opportunities-table-v2 th:nth-child(5) { width: 128px; }
.work-opportunities-table-v2 th:nth-child(6) { width: 118px; }
.work-opportunities-table-v2 th:nth-child(7) { width: 58px; }
.work-opportunities-table-v2 th,
.work-opportunities-table-v2 td {
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.work-opportunities-table-v2 tr:last-child td { border-bottom: 1px solid var(--line); }
.work-opportunities-table-v2 .actions-cell {
  text-align: right;
  vertical-align: middle;
  padding-right: 10px;
}
.work-opportunities-table-v2 .opportunity-main-title {
  display: flex;
  align-items: center;
  gap: 8px;
min-width:0;
  margin-bottom: 4px;
}
.work-opportunities-table-v2 .opportunity-main-title strong {
  display: block;
  flex: 0 1 auto;
min-width:160px;
max-width:none;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
  font-size: 14px;
  line-height: 1.2;
}
.work-opportunities-table-v2 .profile-mini-badge {
  flex: 0 1 auto;
max-width:360px;
}
.work-opportunities-table-v2 .opportunity-short-text {
  margin-top: 0;
max-width:100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.work-opportunities-table-v2 .score-number-only {
  text-align: center;
  vertical-align: middle;
}
.work-opportunities-table-v2 .score-number-only .score-value {
  display: inline-block;
  margin: 0;
  font-size: 18px;
  line-height: 1;
}
.work-opportunities-table-v2 td:nth-child(2),
.work-opportunities-table-v2 td:nth-child(3),
.work-opportunities-table-v2 td:nth-child(4),
.work-opportunities-table-v2 td:nth-child(5),
.work-opportunities-table-v2 td:nth-child(6),
.work-opportunities-table-v2 td:nth-child(7) {
  white-space: nowrap;
}
.source-summary-grid {
  display: grid;
grid-template-columns:1fr …fr;
  gap: 12px;
  margin-bottom: 14px;
}
.source-summary-card {
  min-height: 70px;
  padding: 14px;
}
.source-summary-card h3 { margin-bottom: 8px; }
.source-link-line {
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
.source-preview-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbfe;
}
.source-preview-block h3 { margin: 0 0 10px; }
.source-preview-block p {
  margin: 0;
  line-height: 1.55;
}
.raw-source-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.raw-source-details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 800;
  color: var(--primary-dark);
  background: #f8fbfe;
}
.raw-source-text {
  padding: 16px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}
.warning-text { color: #9a3412; font-weight: 700; }
.warning-note { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.source-warning-note { margin-bottom: 14px; }

/* Patch 000.014.002: доводка таблицы итоговых возможностей */
.work-opportunity-filter {
grid-template-columns:minm…to;
}
.work-opportunities-table-v2 {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}
.work-opportunities-table-v2 th:nth-child(1) { width: auto; }
.work-opportunities-table-v2 th:nth-child(2) { width: 58px; }
.work-opportunities-table-v2 th:nth-child(3) { width: 74px; }
.work-opportunities-table-v2 th:nth-child(4) { width: 82px; }
.work-opportunities-table-v2 th:nth-child(5) { width: 128px; }
.work-opportunities-table-v2 th:nth-child(6) { width: 122px; }
.work-opportunities-table-v2 th:nth-child(7) { width: 54px; }
.work-opportunities-table-v2 th,
.work-opportunities-table-v2 td {
  border-bottom: 1px solid var(--line) !important;
}
.work-opportunities-table-v2 td:nth-child(2),
.work-opportunities-table-v2 td:nth-child(3),
.work-opportunities-table-v2 td:nth-child(4),
.work-opportunities-table-v2 td:nth-child(5),
.work-opportunities-table-v2 td:nth-child(6),
.work-opportunities-table-v2 td:nth-child(7) {
  vertical-align: middle !important;
}
.work-opportunities-table-v2 .ai-cell,
.work-opportunities-table-v2 .source-cell,
.work-opportunities-table-v2 .actions-cell {
  vertical-align: middle !important;
}
.work-opportunities-table-v2 .compact-source-cell small,
.work-opportunities-table-v2 .source-cell small {
  display: none !important;
}
.work-opportunities-table-v2 .actions-cell {
  text-align: center;
  padding-top: 7px;
  padding-bottom: 7px;
}
.work-opportunities-table-v2 .icon-action {
  display: inline-flex;
  vertical-align: middle;
}
@media (max-width: 1500px) {
  .work-opportunity-filter {
grid-template-columns:repe…));
  }
}

.news-company-warning {
  margin: 14px 0 16px;
}
.source-company-form .form-note {
  margin-top: 4px;
}

/* patch 000.015.002: retro processing UI */
.retro-form {
grid-template-columns:150p…to;
  align-items: end;
}
.retro-form .inline-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--text);
  font-weight: 700;
}
.retro-form .inline-check input {
width:auto;
}
.result-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfe;
}
.result-box h3 {
  margin: 0 0 10px;
}
.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.mini-metrics span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}
.mini-metrics b {
  color: var(--text);
}
@media (max-width: 1400px) {
  .retro-form { grid-template-columns: 1fr 1fr 1fr; }
}

/* Patch 0.15.6: compact queue header */
.queue-state-panel {
  padding-bottom: 18px;
}
.compact-panel-header {
  align-items: flex-start;
  margin-bottom: 12px;
}
.queue-compact-state-grid {
  display: grid;
grid-template-columns:minm…r);
  gap: 10px;
}
.queue-compact-state-grid > div,
.compact-retro-state > div {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 70px;
}
.queue-compact-state-grid b,
.compact-retro-state b {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}
.queue-compact-state-grid strong,
.compact-retro-state strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}
.queue-compact-state-grid span,
.compact-retro-state span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.compact-retro-state {
  margin-top: 10px;
}
.retro-form {
  margin-top: 10px;
}
@media (max-width: 1400px) {
  .queue-compact-state-grid {
grid-template-columns:repe…));
  }
}

/* Patch 000.015.008: product profile keywords */
.keyword-help-line {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.keyword-columns {
  display: grid;
grid-template-columns:1fr 1fr;
  gap: 16px;
}
.keyword-column {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}
.keyword-column h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.keyword-table td,
.keyword-table th {
  vertical-align: middle;
}
.keyword-table th:first-child,
.keyword-table td:first-child {
width:54px;
  white-space: nowrap;
}
.keyword-table th:nth-child(3),
.keyword-table td:nth-child(3) {
width:96px;
  white-space: nowrap;
}
.keyword-table th:last-child,
.keyword-table td:last-child {
width:92px;
  white-space: nowrap;
  text-align: right;
}
.danger-code {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}
@media (max-width: 1200px) {
  .keyword-columns { grid-template-columns: 1fr; }
}

/* Patch 000.015.009: simple textarea editor for profile keywords */
.keyword-bulk-form {
  margin-top: 16px;
}
.keyword-textarea-grid {
  display: grid;
grid-template-columns:minm…r);
  gap: 18px;
}
.keyword-textarea-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}
.keyword-textarea-block textarea {
width:100%;
  min-height: 520px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
  background: #fff;
}
.keyword-textarea-block textarea:focus {
  outline: 2px solid rgba(14, 165, 233, 0.22);
  border-color: var(--accent);
}
.keyword-form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
@media (max-width: 1200px) {
  .keyword-textarea-grid { grid-template-columns: 1fr; }
}

/* patch 000.015.010: queue tabs, retro result cleanup, profile AI prompt */
.queue-tabs {
  margin: 0 0 14px;
}

.queue-retro-panel .panel-header,
.queue-state-panel .panel-header {
  margin-bottom: 12px;
}

.queue-retro-summary {
  margin-bottom: 12px;
}

.queue-retro-result {
  margin-top: 14px;
}

.internal-filter-result-wrap {
  margin-top: 10px;
}

.internal-news-filter-table th,
.internal-news-filter-table td {
  vertical-align: middle;
}

.internal-news-filter-table .id-col {
width:72px;
  white-space: nowrap;
}

.internal-news-filter-table .decision-col {
width:120px;
  white-space: nowrap;
}

.internal-news-filter-table .profile-col {
width:190px;
max-width:190px;
  font-size: 13px;
  line-height: 1.25;
}

.internal-news-filter-table .keyword-col {
width:150px;
  white-space: normal;
}

.internal-news-filter-table .actions-cell,
.internal-news-filter-table .actions-head {
width:82px;
  text-align: right;
}

.internal-news-filter-table .material-cell strong {
  display: block;
  line-height: 1.25;
}

.internal-news-filter-table .next-cell {
  line-height: 1.25;
}

.client-pagination {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
}

.client-pagination .pager {
  align-items: center;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-pagination .page-button {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--text-main);
  font-weight: 700;
min-width:34px;
  height: 34px;
  cursor: pointer;
}

.client-pagination .page-button.active {
  background: var(--dark-color);
  border-color: var(--dark-color);
  color: #fff;
}

.client-pagination .small-pager-button {
  height: 34px;
  padding: 0 12px;
}

.client-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-action.muted-icon {
  background: #f8fbff;
  border-color: #d7e8f8;
  color: #5b7089;
}

.icon-action.muted-icon:hover {
  background: #eef6ff;
}

.profile-ai-prompt-panel .ai-prompt-form {
max-width:none;
}

.full-width-textarea {
  display: block;
width:100%;
}

.full-width-textarea textarea {
width:100%;
  min-height: 360px;
  font-size: 15px;
  line-height: 1.45;
}

/* patch 000.015.011: dashboard source activity */
.dashboard-metrics-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: nowrap;
  margin-bottom: 18px;
}
.dashboard-metrics-row .compact-metric-card {
  flex: 0 1 auto;
min-width:max-…nt;
  min-height: 82px;
  padding: 14px 18px;
}
.dashboard-metrics-row .compact-metric-card strong {
  margin-top: 8px;
  font-size: 26px;
}
.dashboard-activity-panel {
  margin-bottom: 18px;
}
.dashboard-activity-panel .panel-header p,
.dashboard-bottom-grid .panel-header p {
  margin: 4px 0 0;
}
.source-activity-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.source-activity-row {
  display: grid;
grid-template-columns:104p…px;
  align-items: center;
  gap: 14px;
}
.source-activity-period strong {
  display: block;
  font-size: 16px;
}
.source-activity-period span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.source-activity-bar {
  display: flex;
  align-items: stretch;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfe;
}
.source-segment {
  display: block;
min-width:4px;
}
.source-empty-bar {
width:100%;
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--muted);
  font-size: 12px;
}
.source-api-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.source-api-indicator i {
width:10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .16);
}
.source-api-indicator.api-ok i { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }
.source-api-indicator.api-error i { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .16); }
.source-api-indicator b { color: var(--danger); font-weight: 800; }
.source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.source-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}
.source-legend i {
width:10px;
  height: 10px;
  border-radius: 999px;
}
.source-rss { background: #0ea5e9; }
.source-telegram { background: #38bdf8; }
.source-vacancy { background: #22c55e; }
.source-website { background: #a855f7; }
.source-vk { background: #2563eb; }
.source-catalog { background: #f59e0b; }
.source-api { background: #64748b; }
.source-test { background: #94a3b8; }
.source-other { background: #475569; }
.dashboard-state-grid {
  display: grid;
grid-template-columns:repe…));
  gap: 10px;
}
.dashboard-state-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8fbfe;
  min-height: 70px;
}
.dashboard-state-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.dashboard-state-grid strong {
  font-size: 20px;
}
.dashboard-opportunity-list .linked-row {
  color: inherit;
  text-decoration: none;
}
.dashboard-opportunity-list .linked-row:hover {
  background: #f8fbfe;
}
@media (max-width: 1500px) {
  .dashboard-metrics-row { flex-wrap: wrap; }
  .dashboard-metrics-row .compact-metric-card { flex: 1 1 180px; }
  .source-activity-row { grid-template-columns: 92px minmax(220px, 1fr); }
  .source-api-indicator { grid-column: 2; }
}

/* Patch 0.15.12 — settings tabs and company matching context */
.page-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.compact-tabs {
  margin-top: -4px;
}
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--border-color, #cfe0ee);
  border-radius: 14px;
  background: #fff;
  color: var(--text-color, #071a33);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(31, 93, 140, .06);
}
.tab-button.active {
  border-color: var(--primary-color, #25aeea);
  background: #dff4ff;
  color: #006da3;
  box-shadow: inset 0 -3px 0 var(--primary-color, #25aeea);
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-row.auto-width-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}
.field span {
  color: #536985;
  font-size: 14px;
}
.field.small-field {
width:220px;
max-width:100%;
}
.field input,
.field textarea {
width:100%;
  border: 1px solid #cfe0ee;
  border-radius: 14px;
  background: #fff;
  color: #071a33;
  font: inherit;
  padding: 12px 14px;
  outline: none;
}
.field input:focus,
.field textarea:focus {
  border-color: #25aeea;
  box-shadow: 0 0 0 3px rgba(37, 174, 234, .12);
}
.large-textarea {
  min-height: 360px;
  resize: vertical;
  line-height: 1.5;
}
.mono-textarea,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.note-box {
  border: 1px dashed #b8d8ee;
  background: #f5fbff;
  border-radius: 16px;
  padding: 14px 16px;
  color: #536985;
}
.note-box p {
  margin: 6px 0 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* patch 000.015.013: persistent retro runs */
.retro-form-expanded {
grid-template-columns:150p…px;
}
.retro-selected-run-note {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef8ff;
  color: var(--text);
}
.retro-selected-run-note span {
  color: var(--muted);
  font-size: 13px;
}
.retro-runs-box {
  margin-top: 16px;
}
.retro-runs-table th:first-child,
.retro-runs-table td:first-child {
width:70px;
  white-space: nowrap;
}
.retro-runs-table th:last-child,
.retro-runs-table td:last-child {
width:150px;
  text-align: right;
  white-space: nowrap;
}
.retro-runs-table .selected-row td {
  background: #f0f9ff;
}
.small-button {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}
@media (max-width: 1500px) {
  .retro-form-expanded {
grid-template-columns:repe…));
  }
}

/* Patch 0.15.18: company card compact tables and editable signals */
.company-events-decision-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
.company-events-decision-table th:nth-child(1) { width: 145px; }
.company-events-decision-table th:nth-child(2) { width: 190px; }
.company-events-decision-table th:nth-child(3) { width: auto; }
.company-events-decision-table th:nth-child(4) { width: 120px; }
.company-events-decision-table th:nth-child(5) { width: 130px; }

.company-signals-edit-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
.company-signals-edit-table th:nth-child(1) { width: 140px; }
.company-signals-edit-table th:nth-child(2) { width: 230px; }
.company-signals-edit-table th:nth-child(3) { width: 220px; }
.company-signals-edit-table th:nth-child(4) { width: 88px; }
.company-signals-edit-table th:nth-child(5) { width: auto; }
.company-signals-edit-table th:nth-child(6) { width: auto; }
.company-signals-edit-table th:nth-child(7) { width: 150px; }
.company-signals-edit-table th:nth-child(8) { width: 96px; }

.company-small-table,
.company-contacts-table,
.company-people-table {
  table-layout: fixed;
  min-width: 0;
  width: 100%;
}
.company-contacts-table th:nth-child(1) { width: 135px; }
.company-contacts-table th:nth-child(2) { width: auto; }
.company-contacts-table th:nth-child(3) { width: 100px; }
.company-contacts-table th:nth-child(4) { width: 92px; }
.company-people-table th:nth-child(1) { width: 30%; }
.company-people-table th:nth-child(2) { width: 24%; }
.company-people-table th:nth-child(3) { width: 24%; }
.company-people-table th:nth-child(4) { width: 80px; }
.company-people-table th:nth-child(5) { width: 92px; }
.company-small-table th,
.company-small-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.company-small-table .actions-cell,
.company-signals-edit-table .actions-cell {
  white-space: nowrap;
}
.company-small-table .icon-actions,
.company-signals-edit-table .icon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
}
.company-small-table .icon-actions form,
.company-signals-edit-table .icon-actions form {
  display: inline-flex;
  margin: 0;
}
.company-small-table .icon-action,
.company-signals-edit-table .icon-action {
  width: 32px;
  height: 32px;
  font-size: 16px;
}
.company-person-name-cell,
.company-person-position-cell,
.company-person-contacts-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}
.large-modal-card {
  max-width: 860px;
}
.large-modal-card { width: 860px; }

/* patch 000.015.019: compact working layout for filters and metrics */
.metrics-action-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 18px;
}
.metrics-action-row .cards-grid,
.metrics-action-row .compact-metrics-cards {
  flex: 1 1 auto;
  margin-bottom: 0;
  display: grid;
  gap: 12px;
}
.metrics-action-row .small-cards,
.metrics-action-row .four-cards,
.metrics-action-row .five-cards,
.metrics-action-row .compact-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.metrics-actions {
  flex: 0 0 auto;
  min-width: 196px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metrics-actions form,
.panel-actions form,
.table-actions form {
  margin: 0;
}
.metrics-actions .primary-button,
.metrics-actions .secondary-button {
  white-space: nowrap;
}
.opportunities-actions {
  min-width: 430px;
}
.filter-form,
.filter-row,
.compact-filter,
.signal-filter,
.compact-source-filter,
.compact-opportunity-filter,
.work-opportunity-filter,
.rules-filter-row.compact-rules-filter,
.retro-form-expanded {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  margin-bottom: 14px !important;
}
.filter-form label,
.filter-row label,
.compact-page-filter label {
  flex: 0 1 190px;
  min-width: 145px;
  max-width: 260px;
  margin: 0;
}
.companies-filter label:first-child,
.sources-filter-row label:first-child {
  flex: 1 1 420px;
  min-width: 360px;
  max-width: none;
}
.compact-filter label,
.signal-filter label {
  flex: 0 1 220px;
  max-width: 260px;
}
.work-opportunity-filter label {
  flex: 1 1 150px;
  min-width: 130px;
  max-width: 210px;
}
.work-opportunity-filter label:first-child {
  flex-basis: 230px;
  max-width: 260px;
}
.compact-source-filter label:first-child {
  flex: 1 1 360px;
  min-width: 280px;
  max-width: none;
}
.retro-form-expanded label {
  flex: 0 1 170px;
  min-width: 125px;
  max-width: 210px;
}
.filter-form .primary-button,
.filter-form .secondary-button,
.filter-row .primary-button,
.filter-row .secondary-button,
.compact-page-filter .primary-button,
.compact-page-filter .secondary-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 112px;
  white-space: nowrap;
}
.filter-form input,
.filter-form select,
.filter-row input,
.filter-row select,
.compact-page-filter input,
.compact-page-filter select {
  width: 100%;
  min-width: 0;
}
.queue-state-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
}
.queue-state-row .queue-compact-state-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 10px;
}
.queue-state-actions {
  min-width: 190px;
}
.company-events-topline .metrics-actions,
.company-matches-topline .metrics-actions,
.signals-topline .metrics-actions,
.sources-topline .metrics-actions {
  min-width: 210px;
}
@media (max-width: 1500px) {
  .metrics-action-row,
  .queue-state-row {
    flex-direction: column;
  }
  .metrics-actions,
  .opportunities-actions,
  .queue-state-actions {
    justify-content: flex-start;
    min-width: 0;
  }
  .queue-state-row .queue-compact-state-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-form,
  .filter-row,
  .compact-filter,
  .signal-filter,
  .compact-source-filter,
  .compact-opportunity-filter,
  .work-opportunity-filter,
  .rules-filter-row.compact-rules-filter,
  .retro-form-expanded {
    flex-wrap: wrap !important;
  }
}
@media (max-width: 900px) {
  .filter-form label,
  .filter-row label,
  .compact-page-filter label,
  .companies-filter label:first-child,
  .sources-filter-row label:first-child,
  .compact-source-filter label:first-child {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }
  .filter-form .primary-button,
  .filter-form .secondary-button,
  .filter-row .primary-button,
  .filter-row .secondary-button {
    flex: 1 1 auto;
  }
  .queue-state-row .queue-compact-state-grid {
    grid-template-columns: 1fr;
  }
}

/* Patch 0.15.20 — dashboard source activity rows */
.dashboard-activity-panel .source-activity-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-activity-panel .source-activity-row {
  display: grid;
  grid-template-columns: 96px minmax(240px, 1fr) max-content;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
  min-height: 34px;
}

.dashboard-activity-panel .source-activity-period {
  min-width: 0;
}

.dashboard-activity-panel .source-activity-period strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
}

.dashboard-activity-panel .source-activity-period span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}

.dashboard-activity-panel .source-activity-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfe;
}

.dashboard-activity-panel .source-empty-bar {
  width: 100%;
  display: flex;
  align-items: center;
  padding-left: 14px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-activity-panel .source-api-indicator {
  grid-column: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.dashboard-activity-panel .source-api-indicator i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
}

@media (max-width: 1200px) {
  .dashboard-activity-panel .source-activity-row {
    grid-template-columns: 86px minmax(160px, 1fr) max-content;
    gap: 10px;
  }
}

/* Patch 0.15.21 — queue retro compact layout */
.queue-retro-panel .queue-retro-summary,
.queue-retro-panel .pipeline-steps.compact-retro-state.queue-retro-summary {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 10px 0 12px !important;
}

.queue-retro-panel .queue-retro-summary > div {
  min-height: 74px !important;
  padding: 10px 12px !important;
}

.queue-retro-panel .retro-form-expanded,
.queue-retro-panel form.retro-form-expanded.compact-page-filter {
  display: grid !important;
  grid-template-columns:
    minmax(125px, 160px)
    minmax(140px, 190px)
    minmax(105px, 135px)
    minmax(260px, 1fr)
    minmax(245px, 275px)
    minmax(130px, 150px)
    minmax(112px, 128px) !important;
  align-items: end !important;
  gap: 10px !important;
  margin: 12px 0 14px !important;
}

.queue-retro-panel .retro-form-expanded label {
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
}

.queue-retro-panel .retro-form-expanded select,
.queue-retro-panel .retro-form-expanded input[type="text"],
.queue-retro-panel .retro-form-expanded input[type="number"] {
  width: 100% !important;
  min-width: 0 !important;
}

.queue-retro-panel .retro-form-expanded .inline-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 0 6px !important;
  line-height: 1.15 !important;
  color: var(--text) !important;
  font-weight: 800 !important;
  white-space: normal !important;
}

.queue-retro-panel .retro-form-expanded .inline-check input[type="checkbox"] {
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 0 !important;
  accent-color: var(--primary) !important;
}

.queue-retro-panel .retro-form-expanded .primary-button {
  align-self: end !important;
  width: 100% !important;
  min-width: 112px !important;
  height: 42px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

@media (max-width: 1500px) {
  .queue-retro-panel .retro-form-expanded,
  .queue-retro-panel form.retro-form-expanded.compact-page-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .queue-retro-panel .queue-retro-summary,
  .queue-retro-panel .pipeline-steps.compact-retro-state.queue-retro-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .queue-retro-panel .retro-form-expanded,
  .queue-retro-panel form.retro-form-expanded.compact-page-filter,
  .queue-retro-panel .queue-retro-summary,
  .queue-retro-panel .pipeline-steps.compact-retro-state.queue-retro-summary {
    grid-template-columns: 1fr !important;
  }
}

/* Patch 0.15.22 — company source-domain cleanup */
.source-domain-cleanup-card {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #fecaca;
  border-radius: 18px;
  background: #fff7f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.source-domain-cleanup-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.source-domain-cleanup-card p {
  margin: 4px 0;
}

.source-domain-cleanup-card form {
  flex: 0 0 auto;
}

.source-domain-cleanup-card .danger-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .source-domain-cleanup-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Patch 0.15.23 — company card materials table layout */
.company-materials-table {
  width: 100% !important;
  min-width: 980px !important;
  table-layout: fixed !important;
}

.company-materials-table .company-materials-col-date { width: 140px; }
.company-materials-table .company-materials-col-material { width: auto; }
.company-materials-table .company-materials-col-match { width: 170px; }
.company-materials-table .company-materials-col-confidence { width: 105px; }
.company-materials-table .company-materials-col-status { width: 155px; }
.company-materials-table .company-materials-col-link { width: 92px; }

.company-materials-table th:nth-child(1) { width: 140px !important; }
.company-materials-table th:nth-child(2) { width: auto !important; }
.company-materials-table th:nth-child(3) { width: 170px !important; }
.company-materials-table th:nth-child(4) { width: 105px !important; }
.company-materials-table th:nth-child(5) { width: 155px !important; }
.company-materials-table th:nth-child(6) { width: 92px !important; }

.company-materials-table th,
.company-materials-table td {
  vertical-align: middle !important;
}

.company-materials-table td:nth-child(1),
.company-materials-table td:nth-child(4),
.company-materials-table td:nth-child(5),
.company-materials-table td:nth-child(6) {
  white-space: nowrap !important;
}

.company-materials-table td:nth-child(3) {
  white-space: normal !important;
  word-break: break-word;
}

.company-materials-table .long-text-cell {
  white-space: normal !important;
  word-break: normal;
}

.company-materials-table .long-text-cell b {
  display: block;
  max-width: 100%;
}

.company-materials-table td:nth-child(5) .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Patch 0.15.24: company delete actions */
.company-list-table th:last-child,
.company-list-table td:last-child {
  width: 1%;
  white-space: nowrap;
}
.companies-row-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.companies-row-actions .small-action {
  white-space: nowrap;
}
.companies-row-actions button.small-action {
  font: inherit;
}
.company-delete-card {
  margin-bottom: 14px;
}


/* Patch 0.15.25: table actions are icon-only buttons */
.table-actions.icon-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
.table-actions.icon-actions form {
  display: inline-flex;
  margin: 0;
}
.actions-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.companies-row-actions .icon-action {
  width: 34px;
  height: 34px;
}
.icon-action.info-icon {
  border-color: #bfdbfe;
  background: #f6fbff;
  color: var(--primary-dark);
}

/* Patch 000.015.026: compact company overview card */
.company-overview-panel {
  padding: 14px 16px !important;
}
.company-overview-panel .panel-header {
  margin-bottom: 10px !important;
  align-items: flex-start !important;
}
.company-overview-panel .panel-header h2 {
  margin: 0 !important;
  font-size: 17px !important;
}
.company-overview-panel .panel-header .muted-line {
  margin-top: 2px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
.company-overview-panel .panel-actions {
  gap: 8px !important;
  flex-wrap: nowrap !important;
}
.company-overview-panel .panel-actions .primary-button,
.company-overview-panel .panel-actions .secondary-button,
.company-overview-panel .panel-actions .ghost-button {
  min-height: 36px !important;
  height: 36px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  white-space: nowrap !important;
}
.company-overview-grid.detail-grid.two-columns,
.company-overview-panel .detail-grid.two-columns {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch !important;
}
.company-overview-panel .detail-card {
  padding: 10px 12px !important;
  border-radius: 12px !important;
  min-height: 0 !important;
}
.company-overview-panel .detail-card h3 {
  margin: 0 0 6px !important;
  font-size: 14px !important;
  line-height: 1.15 !important;
}
.company-overview-panel .detail-card p {
  font-size: 13px !important;
  line-height: 1.25 !important;
}
.company-overview-panel .detail-card:nth-of-type(1),
.company-overview-panel .detail-card:nth-of-type(2) {
  grid-column: 1 / -1 !important;
}
.company-overview-panel .detail-card:nth-of-type(3) {
  grid-column: span 7 !important;
}
.company-overview-panel .detail-card:nth-of-type(4) {
  grid-column: span 5 !important;
}
.company-overview-panel .detail-card:nth-of-type(5) {
  grid-column: 1 / -1 !important;
}
.company-overview-panel .compact-company-edit-form {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) !important;
  gap: 7px 8px !important;
}
.company-overview-panel .detail-card:nth-of-type(2) .compact-company-edit-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr)) !important;
}
.company-overview-panel .detail-card:nth-of-type(3) .compact-company-edit-form {
  grid-template-columns: repeat(4, minmax(110px, 1fr)) !important;
}
.company-overview-panel .compact-company-edit-form label {
  gap: 3px !important;
  min-width: 0 !important;
  max-width: none !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
}
.company-overview-panel .compact-company-edit-form input,
.company-overview-panel .compact-company-edit-form select,
.company-overview-panel .compact-company-edit-form textarea {
  min-height: 34px !important;
  height: 34px !important;
  padding: 7px 9px !important;
  border-radius: 9px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}
.company-overview-panel .compact-company-edit-form textarea {
  height: 46px !important;
  min-height: 46px !important;
  resize: vertical;
}
.company-overview-panel .form-grid .full-span {
  grid-column: span 2 !important;
}
.company-overview-panel .detail-card:nth-of-type(1) .compact-company-edit-form label:first-child,
.company-overview-panel .detail-card:nth-of-type(1) .compact-company-edit-form label:nth-child(3),
.company-overview-panel .detail-card:nth-of-type(1) .compact-company-edit-form label:nth-child(4),
.company-overview-panel .detail-card:nth-of-type(2) .compact-company-edit-form label:first-child,
.company-overview-panel .detail-card:nth-of-type(2) .compact-company-edit-form label:nth-child(2) {
  grid-column: span 2 !important;
}
.company-overview-panel .detail-card:nth-of-type(3) .compact-company-edit-form label.full-span {
  grid-column: span 2 !important;
}
.company-overview-panel .detail-card:nth-of-type(4) {
  display: flex !important;
  flex-direction: column !important;
}
.company-overview-panel .detail-card:nth-of-type(4) p + p {
  margin-top: 6px !important;
}
.company-overview-panel .detail-card:nth-of-type(5) {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
.company-overview-panel .detail-card:nth-of-type(5) h3,
.company-overview-panel .detail-card:nth-of-type(5) p {
  display: inline !important;
  margin-right: 10px !important;
}
.company-save-footer,
.company-overview-panel .company-save-footer {
  margin-top: 8px !important;
  padding: 8px 10px !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
.company-overview-panel .company-save-footer .primary-button {
  flex: 0 0 auto !important;
  min-height: 34px !important;
  height: 34px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.company-overview-panel .muted-line {
  font-size: 12px !important;
  line-height: 1.25 !important;
}
@media (max-width: 1400px) {
  .company-overview-panel .detail-card:nth-of-type(3),
  .company-overview-panel .detail-card:nth-of-type(4) {
    grid-column: 1 / -1 !important;
  }
  .company-overview-panel .compact-company-edit-form,
  .company-overview-panel .detail-card:nth-of-type(2) .compact-company-edit-form,
  .company-overview-panel .detail-card:nth-of-type(3) .compact-company-edit-form {
    grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
  }
}

/* Patch 0.15.29: rebuild company overview form by user-required blocks */
.company-overview-panel {
  padding: 12px 16px !important;
}
.company-overview-panel .panel-header {
  margin-bottom: 8px !important;
}
.company-overview-sections {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
}
.company-overview-section.detail-card {
  padding: 12px 14px !important;
  background: #ffffff !important;
  border: 1px solid #c9e1f4 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  min-height: 0 !important;
}
.company-overview-section h3 {
  margin: 0 0 8px !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  color: var(--text-main) !important;
}
.company-overview-row {
  display: grid !important;
  gap: 7px 10px !important;
  align-items: end !important;
  margin: 0 0 8px !important;
}
.company-overview-row:last-child {
  margin-bottom: 0 !important;
}
.company-row-main-1 {
  grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1.2fr) minmax(220px, 1fr) 180px !important;
}
.company-row-main-2 {
  grid-template-columns: 170px 210px minmax(260px, 1.3fr) 190px !important;
}
.company-row-site {
  grid-template-columns: minmax(320px, 480px) minmax(220px, 320px) !important;
  justify-content: start !important;
}
.company-row-address {
  grid-template-columns: 130px minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(360px, 2fr) !important;
}
.company-row-registration {
  grid-template-columns: 150px 135px 155px 135px 155px minmax(260px, 1fr) !important;
}
.company-row-metrics {
  grid-template-columns: 170px 230px 230px !important;
  justify-content: start !important;
  max-width: 680px !important;
}
.company-overview-row label {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0 !important;
  max-width: none !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  font-weight: 600 !important;
}
.company-overview-row input,
.company-overview-row select,
.company-overview-row textarea {
  width: 100% !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 7px 9px !important;
  border-radius: 9px !important;
  border: 1px solid #cfe0ef !important;
  background: #fbfdff !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}
.company-overview-row textarea {
  resize: vertical !important;
  min-height: 34px !important;
  height: 34px !important;
  overflow: hidden !important;
}
.company-overview-row input:focus,
.company-overview-row select:focus,
.company-overview-row textarea:focus {
  background: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(38, 169, 224, 0.12) !important;
  outline: none !important;
}
.company-overview-metrics {
  display: block !important;
}
.company-overview-note {
  margin: 6px 0 0 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
.company-overview-panel .company-save-footer {
  margin-top: 8px !important;
  padding: 7px 10px !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}
.company-overview-panel .company-save-footer .primary-button {
  min-height: 34px !important;
  height: 34px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  white-space: nowrap !important;
}
@media (max-width: 1500px) {
  .company-row-main-1,
  .company-row-main-2,
  .company-row-address,
  .company-row-registration {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }
  .company-row-site,
  .company-row-metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
    max-width: none !important;
  }
}

/* Patch 000.015.030: restore product profile keyword columns */
.profile-keywords-panel .keyword-bulk-form {
  margin-top: 16px;
}

.profile-keywords-panel .keyword-textarea-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 18px !important;
  align-items: stretch;
}

.profile-keywords-panel .keyword-textarea-block {
  min-width: 0;
}

.profile-keywords-panel .keyword-textarea-block textarea {
  width: 100%;
  min-height: 520px;
  height: 520px;
  box-sizing: border-box;
}

@media (max-width: 980px) {
  .profile-keywords-panel .keyword-textarea-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Patch 000.015.031: рабочий список возможностей — действия видны, неактуальное скрывается */
.work-opportunities-table-v2 {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}
.work-opportunities-table-v2 th:nth-child(1) { width: auto !important; }
.work-opportunities-table-v2 th:nth-child(2) { width: 58px !important; }
.work-opportunities-table-v2 th:nth-child(3) { width: 72px !important; }
.work-opportunities-table-v2 th:nth-child(4) { width: 106px !important; }
.work-opportunities-table-v2 th:nth-child(5) { width: 118px !important; }
.work-opportunities-table-v2 th:nth-child(6) { width: 82px !important; }
.work-opportunities-table-v2 td:nth-child(2),
.work-opportunities-table-v2 td:nth-child(3),
.work-opportunities-table-v2 td:nth-child(4),
.work-opportunities-table-v2 td:nth-child(5),
.work-opportunities-table-v2 td:nth-child(6) {
  white-space: nowrap !important;
  vertical-align: middle !important;
}
.work-opportunities-table-v2 .actions-cell,
.work-opportunities-table-v2 .opportunity-row-actions {
  display: table-cell !important;
  width: 82px !important;
  min-width: 82px !important;
  text-align: right !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  padding-right: 8px !important;
}
.work-opportunities-table-v2 .opportunity-row-actions form {
  display: inline-flex !important;
  margin: 0 0 0 6px !important;
  vertical-align: middle !important;
}
.work-opportunities-table-v2 .opportunity-row-actions .icon-action {
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
}
.work-opportunities-table-v2 .opportunity-row-actions svg {
  width: 16px !important;
  height: 16px !important;
}
.work-opportunities-table-v2 .opportunity-main-title strong {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.work-opportunities-table-v2 .profile-mini-badge {
  max-width: 240px !important;
}
.work-opportunities-table-v2 .opportunity-short-text {
  max-width: 100% !important;
}

/* Patch 000.015.033: product profile actions + keywords + minus words */
.profile-keywords-panel .keyword-textarea-grid-3 {
  display: grid !important;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr) minmax(260px, 1fr) !important;
  gap: 18px !important;
  align-items: stretch;
}

.profile-keywords-panel .keyword-textarea-grid-3 .keyword-textarea-block textarea {
  min-height: 520px;
  height: 520px;
}

@media (max-width: 1250px) {
  .profile-keywords-panel .keyword-textarea-grid-3 {
    grid-template-columns: 1fr !important;
  }
}

/* Patch 000.015.034: profile quick filter — exact phrases first */
.profile-keywords-panel .keyword-textarea-grid-4 {
  display: grid !important;
  grid-template-columns: minmax(240px, 0.95fr) minmax(190px, 0.75fr) minmax(300px, 1.25fr) minmax(260px, 1fr) !important;
  gap: 18px !important;
  align-items: stretch;
}

.profile-keywords-panel .keyword-textarea-grid-4 .keyword-textarea-block textarea {
  min-height: 520px;
  height: 520px;
}

@media (max-width: 1320px) {
  .profile-keywords-panel .keyword-textarea-grid-4 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }
}

@media (max-width: 860px) {
  .profile-keywords-panel .keyword-textarea-grid-4 {
    grid-template-columns: 1fr !important;
  }
}

/* patch 0.15.36: settings AI form */
.settings-form .checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-weight: 800;
  color: var(--text-color, #071a33);
}
.settings-form .checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}
.settings-form .content-grid.two-columns {
  align-items: start;
}

/* Patch 000.015.038: sidebar version and visible opportunity delete action */
.sidebar-version {
  margin-top: auto;
  padding: 9px 12px;
  border: 1px dashed #bde7fb;
  border-radius: 12px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.sidebar-version span {
  display: inline-block;
  margin-right: 4px;
}
.sidebar-version b {
  color: var(--text);
  font-weight: 900;
}
.logout-form {
  margin-top: 8px !important;
}
.sidebar.collapsed .sidebar-version {
  display: none;
}
.work-opportunities-table-v2 th:nth-child(6) {
  width: 128px !important;
}
.work-opportunities-table-v2 .actions-cell,
.work-opportunities-table-v2 .opportunity-row-actions {
  width: 128px !important;
  min-width: 128px !important;
}
.work-opportunities-table-v2 .opportunity-row-actions form {
  margin-left: 6px !important;
}


/* Patch 0.15.41: global save/action notifications */
.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-message {
  min-width: 240px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 101, 52, 0.96);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(127, 29, 29, 0.96);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(30, 64, 175, 0.96);
}

button.is-submitting,
.button.is-submitting,
.primary-button.is-submitting,
.danger-button.is-submitting,
.ghost-button.is-submitting {
  opacity: 0.72;
  cursor: wait !important;
}

.button-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: bg-button-spin 0.75s linear infinite;
}

@keyframes bg-button-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .toast-root {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast-message {
    width: 100%;
    max-width: none;
  }
}


/* Patch 0.15.42: editable profile rules */
.admin-rules-table .icon-actions > .icon-action {
  margin-left: 6px;
  vertical-align: middle;
}
.admin-rules-table .actions-cell {
  min-width: 96px;
}

/* Patch 0.15.44: cleaner editable profile rules */
.admin-rules-table .sub-code {
  display: none !important;
}
.admin-rules-table .rule-event-cell,
.admin-rules-table .rule-signal-cell {
  font-weight: 700;
}
.admin-rules-table th:nth-child(9),
.admin-rules-table td:nth-child(9) {
  width: 118px !important;
  min-width: 118px !important;
}
.admin-rules-table .actions-cell {
  display: flex;
  flex-wrap: nowrap !important;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 108px !important;
  width: 108px;
}
.admin-rules-table .actions-cell form {
  flex: 0 0 auto;
}
.admin-rules-table .icon-actions > .icon-action {
  margin-left: 0;
}
.modal-card.wide-modal {
  width: min(920px, calc(100vw - 48px));
}
.rule-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px 14px;
}
.rule-form-grid .full-span {
  grid-column: 1 / -1;
}
.rule-form-grid .rule-title-field {
  grid-column: span 2;
}
.rule-form-grid textarea {
  min-height: 92px;
}
.rule-form-help {
  padding: 10px 12px;
  border: 1px dashed #c9d8e6;
  border-radius: 14px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.field-note {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 900px) {
  .rule-form-grid {
    grid-template-columns: 1fr !important;
  }
  .rule-form-grid .rule-title-field,
  .rule-form-grid .full-span {
    grid-column: 1 / -1;
  }
}

/* Patch 0.15.46: client report popup */
.client-report-form { gap: 10px; }
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  font-weight: 700;
}
.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.checkbox-line span { margin: 0; }
