/* Lender Graph viewer styles — минимальный, тёмная тема */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, system-ui, "SF Pro Text", Roboto, sans-serif;
  background: #0f1114;
  color: #e6e6e6;
  font-size: 14px;
  line-height: 1.5;
}
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px;
  border-bottom: 1px solid #2a2d31;
  background: #14171b;
  flex-wrap: wrap;
  gap: 16px;
}
.hdr-left h1 { font-size: 18px; margin-bottom: 2px; }
.hdr-left .sub { color: #888; font-size: 12px; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { text-align: right; }
.stat .n { display: block; font-size: 18px; font-weight: 600; color: #5eb3ff; }
.stat .l { display: block; font-size: 10px; text-transform: uppercase; color: #888; letter-spacing: 0.05em; }

main { padding: 18px 24px; }

.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input {
  flex: 1; padding: 10px 12px; font-size: 14px;
  background: #1a1d21; border: 1px solid #3a3d41; border-radius: 6px; color: #fff;
}
.search-box input:focus { outline: none; border-color: #5eb3ff; }
.search-box button {
  padding: 10px 18px; font-size: 14px; cursor: pointer;
  background: #1f6feb; border: 0; border-radius: 6px; color: #fff;
}
.search-box button:hover { background: #2a7af0; }

.layout {
  display: grid; grid-template-columns: minmax(320px, 1fr) 2fr; gap: 18px;
  height: calc(100vh - 220px);
  min-height: 420px;
}

.list-pane, .detail-pane {
  background: #14171b; border: 1px solid #2a2d31; border-radius: 8px;
  padding: 14px; overflow-y: auto;
}
.list-pane h2, .detail-pane h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #888;
  margin-bottom: 8px;
}
.meta { font-size: 11px; color: #888; margin-bottom: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  text-align: left; padding: 6px 4px; color: #888;
  font-weight: 500; font-size: 10px; text-transform: uppercase;
  border-bottom: 1px solid #2a2d31;
}
tbody tr { cursor: pointer; border-bottom: 1px dashed #2a2d31; }
tbody tr:hover { background: #1a1d21; }
tbody td { padding: 6px 4px; vertical-align: top; }
td.id { color: #5eb3ff; font-family: "SF Mono", monospace; font-size: 11px; word-break: break-all; }
td.kind, td.domain { color: #aaa; font-size: 11px; }

.detail-pane .empty { color: #555; text-align: center; padding: 60px 0; }
.detail-pane .loading { color: #888; padding: 24px; text-align: center; }
.detail-pane .err { color: #ef5350; padding: 24px; }
.detail-pane .info { color: #888; padding: 12px; font-size: 12px; }

.concept-card h2 { font-size: 18px; color: #fff; margin-bottom: 8px; text-transform: none; letter-spacing: 0; }
.concept-card h3 { font-size: 12px; text-transform: uppercase; color: #888; letter-spacing: 0.05em; margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #2a2d31; }
.concept-card h4.layer-h { font-size: 11px; color: #f7c948; margin: 10px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.badges { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 500;
  background: #2a2d31; color: #aaa; text-transform: lowercase;
}
.badge.kind-actor { background: #e85d75; color: #1a1d21; }
.badge.kind-entity { background: #5eb3ff; color: #0f1114; }
.badge.kind-process { background: #f7c948; color: #1a1d21; }
.badge.kind-status { background: #9b6dff; color: #1a1d21; }
.badge.kind-document { background: #4caf50; color: #0f1114; }
.badge.kind-event { background: #ff9800; color: #1a1d21; }
.badge.kind-policy { background: #fb8500; color: #1a1d21; }
.badge.kind-legal_norm { background: #78909c; color: #1a1d21; }
.badge.kind-technical { background: #66bb6a; color: #0f1114; }
.badge.kind-parameter { background: #00bcd4; color: #0f1114; }
.cid { color: #888; font-size: 11px; margin-left: auto; }

.aliases { color: #888; font-size: 11px; margin-bottom: 8px; font-style: italic; }
.defn { font-size: 13px; line-height: 1.55; color: #d0d0d0; margin: 10px 0 14px;
  padding: 10px 12px; background: #1a1d21; border-radius: 6px; border-left: 3px solid #5eb3ff; }
.defn.empty { color: #555; font-style: italic; border-left-color: #555; }

.actions { display: flex; gap: 8px; margin: 10px 0; }
.actions button {
  padding: 6px 12px; background: #2a2d31; border: 1px solid #3a3d41;
  color: #fff; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.actions button:hover { background: #3a3d41; border-color: #5eb3ff; }

.rels { list-style: none; }
.rels li { padding: 5px 0; border-bottom: 1px dashed #2a2d31; font-size: 12px; }
.rels li.more { color: #666; font-style: italic; }
.rel-type { color: #f7c948; font-weight: 500; font-size: 11px; padding: 1px 5px; background: rgba(247,201,72,0.1); border-radius: 3px; }
.rels a { color: #5eb3ff; text-decoration: none; }
.rels a:hover { text-decoration: underline; }
.ev { color: #666; font-size: 10px; font-style: italic; margin-top: 2px; padding-left: 8px; }

table.impact { margin-top: 4px; }
table.impact tr { cursor: pointer; }
table.impact td { padding: 4px; font-size: 11px; }
table.impact td a { color: #5eb3ff; text-decoration: none; }
table.impact td a:hover { text-decoration: underline; }

.manif { list-style: none; margin-bottom: 8px; }
.manif li { padding: 4px 0; font-size: 11px; border-bottom: 1px dashed #2a2d31; }
.manif li code { color: #5eb3ff; }

footer {
  padding: 12px 24px; border-top: 1px solid #2a2d31;
  font-size: 11px; color: #666; background: #14171b;
}
footer code { color: #5eb3ff; padding: 1px 4px; background: rgba(94,179,255,0.08); border-radius: 3px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .list-pane, .detail-pane { max-height: 60vh; }
}

/* ─── Графический pane (vis-network) ───────────────────────────────────── */
.graph-section {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}
.graph-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem;
}
.graph-header h2 { margin: 0; font-size: 1.1rem; color: #1e293b; }
.graph-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.graph-controls label { font-size: 0.85rem; color: #475569; }
.graph-controls select, .graph-controls button {
  padding: 0.3rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 0.4rem;
  background: white; font-size: 0.85rem; cursor: pointer;
}
.graph-controls button:hover { background: #eff6ff; border-color: #2563eb; }
.graph-meta { font-size: 0.8rem; color: #64748b; margin-left: auto; }
#graph-canvas {
  height: 540px; background: white;
  border: 1px solid #e2e8f0; border-radius: 0.5rem;
}
.search-box .legend {
  margin-left: 0.75rem; font-size: 0.8rem; color: #64748b; font-style: italic;
}
