/* ==========================================================================
   ROBOT WORKFLOW AUTOMATION STUDIO — СОВРЕМЕННЫЙ ВИЗУАЛЬНЫЙ КОНСТРУКТОР
   ========================================================================== */

/* Полноэкранный оверлей студии */
.rvb-studio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1060;
    background: #090d16;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rvb-studio-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="light"] .rvb-studio-overlay {
    background: #f1f5f9;
    color: #0f172a;
}

/* Верхняя панель управления (Studio Topbar) */
.rvb-topbar {
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 30;
    flex-shrink: 0;
    gap: 16px;
}

[data-theme="light"] .rvb-topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #e2e8f0;
}

.rvb-topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rvb-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.rvb-topbar-heading {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.rvb-topbar-subheading {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.rvb-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Селекторы и кнопки */
.rvb-select {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
}

.rvb-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .rvb-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.rvb-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    line-height: 1;
}

.rvb-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.rvb-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.rvb-btn-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #10b981;
}

.rvb-btn-success:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.rvb-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.rvb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="light"] .rvb-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}
[data-theme="light"] .rvb-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.rvb-btn-close-studio {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rvb-btn-close-studio:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* ==========================================================================
   2D ХОЛСТ С ТОЧЕЧНОЙ СЕТКОЙ (CANVAS VIEWPORT)
   ========================================================================== */
.rvb-canvas-viewport {
    position: relative;
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    background-color: #0b0f17;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
}

.rvb-canvas-viewport.is-dragging {
    cursor: grabbing !important;
}

[data-theme="light"] .rvb-canvas-viewport {
    background-color: #f8fafc;
    background-image: radial-gradient(#94a3b8 1.2px, transparent 1.2px);
}

.rvb-pan-layer {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    min-width: 4000px;
    min-height: 3000px;
    pointer-events: none;
}

/* SVG слой соединительных линий */
.rvb-connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 5;
}

.rvb-connection-path {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2.5px;
    stroke-linecap: round;
    transition: stroke 0.2s;
}

.rvb-connection-path.is-active {
    stroke: #10b981;
    stroke-dasharray: 6, 6;
    animation: rvbFlowAnimation 20s linear infinite;
}

.rvb-connection-path:hover {
    stroke-width: 4px;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
    cursor: pointer;
}

.rvb-live-wire {
    stroke: #38bdf8 !important;
    stroke-width: 3px !important;
    stroke-dasharray: 6, 6;
    animation: rvbLiveWireFlow 0.8s linear infinite;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
    pointer-events: none;
}

@keyframes rvbLiveWireFlow {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}

@keyframes rvbFlowAnimation {
    from { stroke-dashoffset: 400; }
    to { stroke-dashoffset: 0; }
}

.rvb-connection-path.is-muted {
    stroke: rgba(148, 163, 184, 0.4);
    stroke-dasharray: 4, 4;
}

.rvb-connection-path.is-trigger {
    stroke: #10b981;
}

.rvb-connection-path.is-condition {
    stroke: #f59e0b;
}

.rvb-connection-path.is-elif {
    stroke: #a855f7;
}

.rvb-connection-path.is-else {
    stroke: #94a3b8;
}

.rvb-connection-path.is-stop {
    stroke: #ef4444;
}

/* ==========================================================================
   КОНТЕЙНЕР УЗЛОВ С АБСОЛЮТНЫМ ИЛИ ГИБКИМ ПОЗИЦИОНИРОВАНИЕМ
   ========================================================================== */
.rvb-workflows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* Карточка узла (Workflow Node Card) */
.rvb-node {
    width: 320px;
    background: rgba(17, 24, 39, 0.94);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    position: absolute;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    transition: box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
    pointer-events: auto;
    touch-action: none;
    z-index: 10;
}

.rvb-node:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 14px 36px rgba(59, 130, 246, 0.25);
}

.rvb-node.is-selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5) !important;
}

.rvb-node.is-dragging-node {
    z-index: 100 !important;
    cursor: grabbing !important;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.7), 0 0 0 2px #3b82f6 !important;
    transform: scale(1.025);
    transition: none !important;
}

.rvb-node.is-inactive {
    opacity: 0.65;
    filter: grayscale(40%);
}

[data-theme="light"] .rvb-node {
    background: rgba(255, 255, 255, 0.98);
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

/* Цветовые вариации типов узлов */
.rvb-node-stage {
    border-color: var(--node-color, #3b82f6);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.rvb-node-trigger {
    border-color: rgba(16, 185, 129, 0.45);
}
.rvb-node-trigger:hover, .rvb-node-trigger.is-selected {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35), 0 14px 36px rgba(16, 185, 129, 0.25) !important;
}

.rvb-node-condition {
    border-color: rgba(245, 158, 11, 0.45);
}
.rvb-node-condition:hover, .rvb-node-condition.is-selected {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 14px 36px rgba(245, 158, 11, 0.25) !important;
}

.rvb-node-elif {
    border-color: rgba(168, 85, 247, 0.45);
}
.rvb-node-elif:hover, .rvb-node-elif.is-selected {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35), 0 14px 36px rgba(168, 85, 247, 0.25) !important;
}

.rvb-node-else {
    border-color: rgba(148, 163, 184, 0.45);
}
.rvb-node-else:hover, .rvb-node-else.is-selected {
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.35), 0 14px 36px rgba(148, 163, 184, 0.25) !important;
}

.rvb-node-action {
    border-color: rgba(59, 130, 246, 0.45);
}
.rvb-node-action:hover, .rvb-node-action.is-selected {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 14px 36px rgba(59, 130, 246, 0.25) !important;
}

.rvb-node-ai {
    border-color: rgba(139, 92, 246, 0.55);
}
.rvb-node-ai:hover, .rvb-node-ai.is-selected {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35), 0 14px 36px rgba(139, 92, 246, 0.3) !important;
}

.rvb-node-stop {
    border-color: rgba(239, 68, 68, 0.45);
}
.rvb-node-stop:hover, .rvb-node-stop.is-selected {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 14px 36px rgba(239, 68, 68, 0.25) !important;
}

/* Внутренняя структура узла */
.rvb-node-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: grab;
}

.rvb-node-header:active {
    cursor: grabbing;
}

[data-theme="light"] .rvb-node-header {
    border-bottom-color: #f1f5f9;
}

.rvb-node-drag-handle {
    cursor: grab;
    opacity: 0.5;
    margin-right: 6px;
    transition: opacity 0.2s;
}
.rvb-node-drag-handle:hover {
    opacity: 1;
}

.rvb-node-trigger .rvb-node-header {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.rvb-node-condition .rvb-node-header {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.rvb-node-elif .rvb-node-header {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}

.rvb-node-else .rvb-node-header {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.rvb-node-action .rvb-node-header {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.rvb-node-stop .rvb-node-header {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.rvb-node-stage .rvb-node-header {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.rvb-node-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.rvb-node-title {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

[data-theme="light"] .rvb-node-title {
    color: #0f172a;
}

.rvb-node-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0;
}

.rvb-node-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.rvb-pill {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

[data-theme="light"] .rvb-pill {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.rvb-node-footer {
    padding: 8px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .rvb-node-footer {
    border-top-color: #f1f5f9;
    background: #f8fafc;
}

/* Кнопки перестановки шагов (Move Up / Down) */
.rvb-step-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rvb-step-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.15s;
}

.rvb-step-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Порты входа и выхода узла (n8n wire connection ports) */
.rvb-port {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2.5px solid #090d16;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    cursor: crosshair;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rvb-port:hover {
    transform: translateX(-50%) scale(1.45);
    box-shadow: 0 0 12px #38bdf8;
}

.rvb-port.is-connecting {
    transform: translateX(-50%) scale(1.5);
    background: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.9);
}

.rvb-port-in.is-drop-target {
    transform: translateX(-50%) scale(1.6);
    background: #10b981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.9) !important;
    animation: rvbPortPulse 0.6s infinite alternate;
}

@keyframes rvbPortPulse {
    from { transform: translateX(-50%) scale(1.4); }
    to { transform: translateX(-50%) scale(1.7); }
}

.rvb-port-in {
    top: -7.5px;
}

.rvb-port-out {
    bottom: -7.5px;
}

.rvb-node-trigger .rvb-port {
    background: #10b981;
}

.rvb-node-condition .rvb-port {
    background: #f59e0b;
}

.rvb-node-stop .rvb-port {
    background: #ef4444;
}

/* ==========================================================================
   КНОПКА ДОБАВЛЕНИЯ ШАГА НА ЛИНИИ СОЕДИНЕНИЯ (+)
   ========================================================================== */
.rvb-add-step-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    outline: none;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.rvb-add-step-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6);
}

[data-theme="light"] .rvb-add-step-btn {
    background: #ffffff;
}

/* ==========================================================================
   ПЛАВАЮЩИЙ ДОК УПРАВЛЕНИЯ ХОЛСТОМ (CANVAS DOCK)
   ========================================================================== */
.rvb-canvas-dock {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 30px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .rvb-canvas-dock {
    background: rgba(255, 255, 255, 0.95);
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.rvb-dock-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.rvb-dock-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
}

[data-theme="light"] .rvb-dock-btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}
[data-theme="light"] .rvb-dock-btn:hover {
    background: #3b82f6;
    color: #ffffff;
}

.rvb-dock-zoom-label {
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 46px;
    text-align: center;
    color: #f1f5f9;
}

[data-theme="light"] .rvb-dock-zoom-label {
    color: #0f172a;
}

/* ==========================================================================
   МИНИ-КАРТА ХОЛСТА (MINI-MAP DOCK)
   ========================================================================== */
.rvb-minimap-panel {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 25;
    width: 170px;
    height: 110px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .rvb-minimap-panel {
    background: rgba(255, 255, 255, 0.95);
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.rvb-minimap-header {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rvb-minimap-canvas {
    width: 100%;
    flex-grow: 1;
}

/* ==========================================================================
   БОКОВАЯ ШТОРКА ИНСПЕКТОРА (INSPECTOR DRAWER)
   ========================================================================== */
.rvb-inspector-drawer {
    position: absolute;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: rgba(15, 23, 42, 0.96);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    z-index: 35;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
}

.rvb-inspector-drawer.is-open {
    transform: translateX(0);
}

[data-theme="light"] .rvb-inspector-drawer {
    background: rgba(255, 255, 255, 0.98);
    border-left-color: #e2e8f0;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.rvb-inspector-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="light"] .rvb-inspector-header {
    border-bottom-color: #f1f5f9;
}

.rvb-inspector-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rvb-inspector-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .rvb-inspector-footer {
    border-top-color: #f1f5f9;
    background: #f8fafc;
}

/* Формы инспектора */
.rvb-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rvb-form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
}

[data-theme="light"] .rvb-form-label {
    color: #475569;
}

.rvb-form-control {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

.rvb-form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="light"] .rvb-form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
[data-theme="light"] .rvb-form-control:focus {
    background: #ffffff;
}

/* ==========================================================================
   ПОПОВЕР БЫСТРОГО ДОБАВЛЕНИЯ ШАГА (QUICK ADD POPOVER)
   ========================================================================== */
.rvb-quick-add-popover {
    position: fixed;
    z-index: 1070;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 330px;
    max-height: 480px;
    overflow-y: auto;
    padding: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    display: none;
    animation: rvbPopoverPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.rvb-quick-add-popover.is-open {
    display: block;
}

@keyframes rvbPopoverPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

[data-theme="light"] .rvb-quick-add-popover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.rvb-quick-add-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
}

.rvb-quick-add-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="light"] .rvb-quick-add-item {
    color: #334155;
}
[data-theme="light"] .rvb-quick-add-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.rvb-quick-add-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.rvb-quick-add-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 8px 12px 3px;
    letter-spacing: 0.05em;
}

/* Пустое состояние */
.rvb-empty-state {
    text-align: center;
    padding: 60px 40px;
    max-width: 440px;
    margin: 40px auto;
    background: rgba(17, 24, 39, 0.7);
    border: 1.5px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    pointer-events: auto;
}

[data-theme="light"] .rvb-empty-state {
    background: #ffffff;
    border-color: #cbd5e1;
}

/* Вкладки веток (Branch Tabs) в Инспекторе */
.rvb-branch-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.rvb-branch-tab {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rvb-branch-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.rvb-branch-tab.active-if {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #fbbf24;
}

.rvb-branch-tab.active-elif {
    background: rgba(168, 85, 247, 0.18);
    border-color: #a855f7;
    color: #c084fc;
}

.rvb-branch-tab.active-else {
    background: rgba(148, 163, 184, 0.18);
    border-color: #94a3b8;
    color: #e2e8f0;
}
