/* Дополнения LexaCore к стилям доски efrsbv2: источники you-right, подгрузки, формы инструментов, журнал. */

.small-brand {
    font-size: 12px;
    margin: -6px 0 14px;
}

.ws-muted {
    color: #9fb0c7;
}

.ws-status-error {
    border-color: #dc2626 !important;
    background: rgba(220, 38, 38, .14) !important;
}

.ws-account {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.ws-account .ws-icon-btn {
    margin-left: auto;
}

.ws-btn-primary {
    background: #2563eb;
}

/* ---- Карточки записей ---- */

.ws-node h3 a {
    color: #e5edf8;
    text-decoration: none;
}

.ws-node h3 a:hover {
    text-decoration: underline;
}

.ws-node-summary {
    font-size: 12px;
    line-height: 1.4;
    color: #b8c7dc;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.ws-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: #1e293b;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.ws-node-head .ws-source-badge + span {
    margin-left: auto;
    font-weight: 600;
    color: #9fb0c7;
}

.source-efrsb { background: rgba(248, 113, 113, .18); color: #fecaca; }
.source-kad { background: rgba(96, 165, 250, .18); color: #bfdbfe; }
.source-fssp { background: rgba(251, 191, 36, .18); color: #fde68a; }
.source-gas { background: rgba(52, 211, 153, .18); color: #a7f3d0; }
.source-mosgor { background: rgba(192, 132, 252, .2); color: #e9d5ff; }
.source-egrul { background: rgba(56, 189, 248, .18); color: #bae6fd; }
.source-courts { background: rgba(148, 163, 184, .2); color: #e2e8f0; }

.source-card-efrsb { border-color: rgba(248, 113, 113, .55); }
.source-card-kad { border-color: rgba(96, 165, 250, .7); }
.source-card-fssp { border-color: rgba(251, 191, 36, .6); }
.source-card-gas { border-color: rgba(52, 211, 153, .58); }
.source-card-mosgor { border-color: rgba(192, 132, 252, .64); }
.source-card-egrul { border-color: rgba(56, 189, 248, .6); }
.source-card-courts { border-color: rgba(148, 163, 184, .6); }

.group-company {
    border-color: rgba(250, 204, 21, .75);
    background: linear-gradient(180deg, rgba(250, 204, 21, .08), rgba(17, 28, 48, .96) 40%);
}

.ws-node.is-reference {
    border-style: dashed;
}

.ws-node.is-running {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, .7), 0 18px 40px rgba(0, 0, 0, .32);
    animation: ws-running 1.2s ease-in-out infinite alternate;
}

@keyframes ws-running {
    from { box-shadow: 0 0 0 2px rgba(56, 189, 248, .35), 0 18px 40px rgba(0, 0, 0, .32); }
    to { box-shadow: 0 0 0 4px rgba(56, 189, 248, .8), 0 18px 40px rgba(0, 0, 0, .32); }
}

.badge-reference { background: #334155; color: #e2e8f0; border: 1px dashed #94a3b8; }
.badge-case { background: #1e3a8a; color: #dbeafe; }

.legend-dot.reference { background: transparent; border: 1px dashed #94a3b8; }
.legend-dot.running { background: #38bdf8; }

.ws-edge-case {
    stroke: rgba(250, 204, 21, .7) !important;
    stroke-dasharray: 2 5;
}

/* Участник → подпись группы: тонкая «шина» без стрелки. */
.ws-edge-bus {
    stroke: rgba(148, 163, 184, .5) !important;
    stroke-width: 2 !important;
    marker-end: none !important;
}

/* Подпись группы над её верхней карточкой: «🧾 ФССП · Действующие ИП  5». */
.ws-group-label {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: rgba(30, 41, 59, .94);
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.ws-group-label b {
    color: #93c5fd;
    font-weight: 700;
}

.ws-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #b8c7dc;
}

.ws-legend-line {
    display: inline-block;
    width: 26px;
    height: 0;
    border-top: 2.5px solid rgba(96, 165, 250, .85);
}

.ws-legend-line.is-case { border-top: 2.5px dotted rgba(250, 204, 21, .85); }
.ws-legend-line.is-manual { border-top: 2.5px dashed rgba(52, 211, 153, .85); }

/* ---- Меню подгрузок ---- */

.ws-actions-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 8px;
    padding: 6px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0b1220;
}

.ws-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #e5edf8;
    font-size: 12px;
    cursor: pointer;
}

.ws-action-btn:hover:not(:disabled) {
    background: #16223a;
}

.ws-action-btn:disabled {
    opacity: .5;
    cursor: default;
}

.ws-quota-hint {
    margin-left: auto;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
}

/* ---- Инструменты в панели ---- */

.wst-tool {
    border-radius: 8px;
}

.wst-tool.is-open {
    background: #0f1a2e;
    border: 1px solid #263449;
    margin: 4px 0;
}

.wst-tool-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 13px;
    color: #e5edf8;
    border-radius: 8px;
}

.wst-tool-head:hover {
    background: #16223a;
}

.wst-tool-name {
    flex: 1;
}

.wst-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 10px 12px;
}

.wst-desc {
    font-size: 12px;
    color: #9fb0c7;
}

.wst-note {
    font-size: 12px;
    color: #fde68a;
}

.wst-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #b8c7dc;
}

.wst-field input,
.wst-field select,
.wst-field textarea {
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0b1220;
    color: #e5edf8;
    font: inherit;
}

.wst-field small {
    color: #8193ab;
}

.wst-advanced summary {
    cursor: pointer;
    font-size: 12px;
    color: #93c5fd;
    margin-bottom: 6px;
}

.wst-advanced .wst-field {
    margin-bottom: 6px;
}

.wst-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b8c7dc;
}

.wst-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wst-cost {
    font-size: 11px;
    color: #8193ab;
}

/* ---- Журнал запросов ---- */

.wsr-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wsr-row {
    border: 1px solid #263449;
    border-radius: 10px;
    padding: 8px 10px;
    background: #0f1a2e;
    font-size: 12px;
}

.wsr-row.status-failed {
    border-color: rgba(220, 38, 38, .55);
}

.wsr-row.status-pending {
    border-color: rgba(245, 158, 11, .55);
}

.wsr-head {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wsr-name {
    flex: 1;
    font-weight: 700;
    color: #e5edf8;
}

.wsr-date,
.wsr-params {
    color: #8193ab;
}

.wsr-params {
    word-break: break-all;
    margin-top: 2px;
}

.wsr-result {
    margin-top: 4px;
    color: #cbd5e1;
}

.wsr-error {
    color: #fca5a5;
}

/* Дело в очереди у источника: сервер проверяет сам — не ошибка, а ожидание. */
.wsr-pending {
    color: #bfdbfe;
}

.wsr-note {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
}

.wsr-auto {
    color: #93c5fd;
    font-size: 12px;
}

.wsr-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.wsr-actions a {
    color: #93c5fd;
}

.wsr-repeat {
    border: 0;
    background: transparent;
    color: #93c5fd;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

/* Секции страницы не должны сжиматься flex-колонкой: в полноэкранном режиме (position: fixed)
   доска с overflow:hidden иначе ужимается до остатка высоты и холст обрезается. */
.workspace-page > * {
    flex-shrink: 0;
}
