html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudziMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NyIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0"idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI26My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEjIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA9NC4wODg2IDIzNi4wODkgOTMuODA3MlwzMC4zMDUgOTMuMDE2MiAyMzYuODU4IDkzLjEzMTQgMjU5LjQ3MyA1My42Mjk0IDI1OS45NjE1Mi42Nzk4NTUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA9IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDgKNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODc?ODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ7MjYzLjU3NiA4MC41MDQ3QzI2MS4wNDkgODYuMDU0NyA2My43ODYgODYuMDU0NyA2NS42Mzc2IDgzLjAyIDgzLjAyIDg2LjAxODYgODYuMDE4MzU7IiBmaWxsPSIjRkZFMTAwIiBmaWxsLXJ1bGU9ImV2ZW5vZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =====================================================
   BPMN Editor Styles
   ===================================================== */

/* Editor Layout */
.bpmn-editor-layout {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
    background-color: #f8f9fa;
}

.bpmn-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

.editor-header .header-left,
.editor-header .header-right {
    display: flex;
    align-items: center;
}

.editor-breadcrumb {
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

.editor-breadcrumb .breadcrumb {
    font-size: 0.875rem;
}

/* Workflow Editor Page */
.workflow-editor-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    margin: -1.1rem -1.5rem;
}

/* Toolbox */
.bpmn-toolbox {
    width: 280px;
    min-width: 280px;
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, min-width 0.2s ease;
}

.bpmn-toolbox.hidden {
    width: 48px;
    min-width: 48px;
}

.toolbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.toolbox-search {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.toolbox-info-banner {
    padding: 0.5rem 0.75rem;
    background-color: #fff3cd;
    border-bottom: 1px solid #ffc107;
    color: #856404;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

.toolbox-info-banner .bi {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.toolbox-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.toolbox-category {
    margin-bottom: 0.25rem;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: #495057;
    background-color: #f8f9fa;
}

.category-header:hover {
    background-color: #e9ecef;
}

.category-header .badge {
    font-size: 0.7rem;
}

.category-items {
    padding: 0.25rem 0;
}

.toolbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    cursor: grab;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.toolbox-item:hover {
    background-color: #e9ecef;
    border-left-color: #007bff;
}

.toolbox-item:active {
    cursor: grabbing;
}

.toolbox-item .node-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.toolbox-item .node-info {
    flex: 1;
    min-width: 0;
}

.toolbox-item .node-name {
    font-size: 0.875rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbox-item .badge-sm {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
}

.toolbox-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.toolbox-item.disabled:hover {
    background-color: #f8f9fa;
    border-left-color: transparent;
}

.toolbox-item.disabled .node-name {
    color: #6c757d;
}

/* Property Pane */
.bpmn-property-pane {
    width: 320px;
    min-width: 320px;
    background-color: #fff;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, min-width 0.2s ease;
}

.bpmn-property-pane.hidden {
    width: 48px;
    min-width: 48px;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.property-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.property-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    /* Clip content but allow tooltips via separate mechanism */
}

/* Ensure mb-3 divs in property content can show tooltips */
.property-content .mb-3 {
    position: relative;
}

.property-section {
    margin-bottom: 1.5rem;
}

.property-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.property-actions {
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Canvas */
.bpmn-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden; /* No scrolling - use pan instead */
    background-color: #f8f9fa;
}

.canvas-toolbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    gap: 0.25rem;
}

.canvas-toolbar-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.canvas-toolbar-btn .bi {
    font-size: 1.1rem;
}

.canvas-toolbar-btn .btn-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.canvas-toolbar-btn.zoom-display {
    min-width: 55px;
    font-weight: 600;
    cursor: default;
    background-color: #f8f9fa;
}

.canvas-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    cursor: grab;
}

.canvas-viewport:active {
    cursor: grabbing;
}

.canvas-viewport.panning {
    cursor: grabbing;
}

.canvas-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 10000px;
    height: 10000px;
    background-image: 
        radial-gradient(circle, #ddd 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.canvas-connections {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.canvas-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

/* Pan hint indicator */
.canvas-pan-hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 0.35rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bpmn-canvas-container:hover .canvas-pan-hint {
    opacity: 1;
}

/* Nodes */
.bpmn-node {
    position: absolute;
    background-color: #fff;
    border: 2px solid #6c757d;
    border-radius: 0.5rem;
    cursor: move;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s ease;
}

.bpmn-node:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.bpmn-node.selected {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.bpmn-node.start-node {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.bpmn-node.start-node.selected {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.node-header {
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem 0.375rem 0 0;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.node-type {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-body {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.node-body .node-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Node Connectors */
.node-connector {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #fff;
    border: 2px solid #6c757d;
    border-radius: 50%;
    cursor: crosshair;
    z-index: 20;
    transition: transform 0.15s ease;
}

.node-connector:hover {
    transform: scale(1.3);
    background-color: #007bff;
    border-color: #007bff;
}

.node-connector-in {
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
}

.node-connector-out {
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
}

.node-connector-in:hover,
.node-connector-out:hover {
    transform: translateX(-50%) scale(1.3);
}

/* Node Actions */
.node-actions {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    background-color: #fff;
    padding: 0.25rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.node-actions .btn {
    padding: 0.2rem 0.4rem;
}

/* Start Indicator */
.start-indicator {
    position: absolute;
    top: -24px;
    left: -24px;
    width: 20px;
    height: 20px;
    background-color: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* Branching Node Indicator */
.branching-indicator {
    position: absolute;
    top: -24px;
    right: -24px;
    width: 20px;
    height: 20px;
    background-color: #007bff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* Branching Node Styles */
.bpmn-node.branching-node {
    border-style: dashed;
}

.bpmn-node.branching-node .node-header {
    position: relative;
}

.bpmn-node.branching-node .node-header::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.7);
}

/* Branch Indicators (dots at the bottom of branching nodes) */
.branch-indicators {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 2px 6px;
}

.branch-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Branch Labels on Connection Lines */
.branch-label {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 5;
    border: 1px solid currentColor;
}

/* Canvas Connection Path Styles */
.canvas-connections path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Toast Styles */
.toast-container .toast {
    min-width: 300px;
}

/* =====================================================
   Container Node Styles
   ===================================================== */

/* Container Node Base */
.bpmn-container-node {
    position: absolute;
    background-color: #fff;
    border: 2px dashed #6c757d;
    border-radius: 0.75rem;
    cursor: move;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.bpmn-container-node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.bpmn-container-node.selected {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3), 0 6px 20px rgba(0, 0, 0, 0.15);
}

.bpmn-container-node.start-node {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3), 0 6px 20px rgba(0, 0, 0, 0.15);
}

.bpmn-container-node.start-node.selected {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Container Header */
.container-header {
    padding: 0.5rem 1rem;
    border-radius: 0.625rem 0.625rem 0 0;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.container-type {
    font-weight: 600;
}

.container-name {
    opacity: 0.9;
    font-size: 0.75rem;
}

/* Container Indicator */
.container-indicator {
    position: absolute;
    top: -24px;
    right: -24px;
    width: 20px;
    height: 20px;
    background-color: #6f42c1;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

/* Container Branches Layout */
.container-branches {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
    overflow: hidden;
}

/* Individual Branch */
.container-branch {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    min-height: 80px;
    background-color: #fafbfc;
}

/* Branch Header */
.branch-header {
    padding: 0.35rem 0.75rem;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-header .badge {
    font-size: 0.6rem;
}

/* Branch Canvas (Sub-canvas for nodes) */
.branch-canvas {
    flex: 1;
    position: relative;
    background-image: 
        radial-gradient(circle, #e9ecef 1px, transparent 1px);
    background-size: 15px 15px;
    padding: 0.5rem;
    overflow: visible;
    min-height: 80px;
}

/* Branch Connections SVG */
.branch-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* Branch Empty State */
.branch-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60px;
    color: #adb5bd;
    gap: 0.25rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.branch-empty .bi {
    font-size: 1.25rem;
}

/* Child Nodes Inside Branch - absolute positioned for free movement */
.branch-child-node {
    position: absolute !important;
    cursor: grab;
    z-index: 10;
}

.branch-child-node:active,
.branch-child-node.dragging {
    cursor: grabbing;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Nested container wrapper - also absolute */
.nested-container-wrapper {
    position: absolute;
    z-index: 10;
}

.nested-container-wrapper .bpmn-container-node {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-width: 1.5px;
}

/* Horizontal Branch Layout (for side-by-side branches like parallel) */
.container-branches.horizontal {
    flex-direction: row;
}

.container-branches.horizontal .container-branch {
    flex: 1;
    min-width: 150px;
}

/* Resizable container handle */
.container-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #6c757d 50%);
    border-radius: 0 0 0.5rem 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.container-resize-handle:hover {
    opacity: 1;
}

/* View Toggle Button Active State */
.canvas-toolbar .btn.btn-primary {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Scope Node Specific Styles */
.bpmn-container-node[data-type="scope"] {
    border-style: double;
    border-width: 3px;
}

.bpmn-container-node[data-type="scope"] .container-branch[data-branch="catch"] {
    background-color: rgba(220, 53, 69, 0.05);
}

.bpmn-container-node[data-type="scope"] .container-branch[data-branch="finally"] {
    background-color: rgba(23, 162, 184, 0.05);
}

/* If Node Specific Styles */
.bpmn-container-node[data-type="if"] .container-branches {
    flex-direction: row;
}

/* Parallel Node Specific Styles */
.bpmn-container-node[data-type="parallel"] .container-branches {
    flex-direction: row;
}

/* ForEach Node Specific Styles */
.bpmn-container-node[data-type="foreach"] {
    border-style: dotted;
}

.bpmn-container-node[data-type="foreach"] .branch-header::before {
    content: "?";
    margin-right: 0.35rem;
    font-size: 0.9rem;
}

/* Switch Node Specific Styles */
.bpmn-container-node[data-type="switch"] .container-branch[data-branch="default"] {
    border-style: dashed;
}

/* Animation for dropping nodes into branches */
.container-branch.drag-over {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
    border-style: dashed;
}

/* Nested container styling */
.branch-canvas .bpmn-container-node {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Collapsed container state (future feature) */
.bpmn-container-node.collapsed .container-branches {
    display: none;
}

.bpmn-container-node.collapsed {
    min-height: auto !important;
    height: auto !important;
}

/* Collapse Toggle Button */
.collapse-toggle {
    padding: 0.1rem 0.35rem;
    margin-right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 0.25rem;
    line-height: 1;
    transition: background-color 0.15s ease;
}

.collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.collapse-toggle .bi {
    font-size: 0.7rem;
}

/* Collapsed Summary in Header */
.collapsed-summary {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: normal;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
}

/* Collapsed Branches Pills */
.collapsed-branches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.collapsed-branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
}

.collapsed-branch-pill .bi {
    font-size: 0.65rem;
}

.collapsed-branch-pill .pill-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.1rem 0.35rem;
    border-radius: 0.75rem;
    font-size: 0.6rem;
    min-width: 1.2rem;
    text-align: center;
}

/* Transition for expand/collapse */
.bpmn-container-node {
    transition: width 0.2s ease, min-height 0.2s ease;
}

.container-branches {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adjust header for collapsed state */
.bpmn-container-node.collapsed .container-header {
    border-radius: 0.625rem;
}

/* =====================================================
   Resize Handles (Drag-to-Resize)
   ===================================================== */

/* Base resize handle styling */
.resize-handle {
    position: absolute;
    background-color: transparent;
    z-index: 30;
    transition: background-color 0.15s ease;
}

/* Right edge - resize width */
.resize-handle-e {
    right: 0;
    top: 30px;
    bottom: 30px;
    width: 8px;
    cursor: ew-resize;
}

.resize-handle-e:hover,
.resize-handle-e:active {
    background-color: rgba(0, 123, 255, 0.3);
}

/* Bottom edge - resize height */
.resize-handle-s {
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 8px;
    cursor: ns-resize;
}

.resize-handle-s:hover,
.resize-handle-s:active {
    background-color: rgba(0, 123, 255, 0.3);
}

/* Bottom-right corner - resize both */
.resize-handle-se {
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(108, 117, 125, 0.4) 50%);
    border-radius: 0 0 0.5rem 0;
}

.resize-handle-se:hover,
.resize-handle-se:active {
    background: linear-gradient(135deg, transparent 40%, rgba(0, 123, 255, 0.6) 40%);
}

/* Show resize handles more prominently when container is selected */
.bpmn-container-node.selected .resize-handle-e,
.bpmn-container-node.selected .resize-handle-s {
    background-color: rgba(0, 123, 255, 0.15);
}

.bpmn-container-node.selected .resize-handle-se {
    background: linear-gradient(135deg, transparent 45%, rgba(0, 123, 255, 0.5) 45%);
}

/* Visual feedback during resize */
.bpmn-container-node.resizing {
    opacity: 0.9;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Resize size indicator tooltip (shown during resize) */
.bpmn-container-node.resizing::after {
    content: attr(data-size);
    position: absolute;
    bottom: -25px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* =====================================================
   Nested Container Styles
   ===================================================== */

.nested-container-wrapper {
    margin: 0.5rem 0;
}

/* Nested containers have slightly different styling */
.nested-container-wrapper .bpmn-container-node {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-width: 1.5px;
}

/* Reduce padding for nested containers */
.nested-container-wrapper .container-branches {
    padding: 0.35rem;
    gap: 0.35rem;
}

.nested-container-wrapper .branch-header {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
}

.nested-container-wrapper .container-header {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

/* Visual indication of nesting depth */
.nested-container-wrapper .bpmn-container-node {
    opacity: 0.95;
}

.nested-container-wrapper .nested-container-wrapper .bpmn-container-node {
    opacity: 0.92;
    border-width: 1px;
}

.nested-container-wrapper .nested-container-wrapper .nested-container-wrapper .bpmn-container-node {
    opacity: 0.89;
}

/* Smaller resize handles for nested containers */
.nested-container-wrapper .resize-handle-e {
    width: 6px;
}

.nested-container-wrapper .resize-handle-s {
    height: 6px;
}

.nested-container-wrapper .resize-handle-se {
    width: 12px;
    height: 12px;
}

/* Container action buttons - smaller for nested */
.nested-container-wrapper .node-actions {
    transform: translateX(-50%) scale(0.9);
}

.nested-container-wrapper .node-actions .btn {
    padding: 0.15rem 0.3rem;
}

/* Toast Styles */
.toast-container .toast {
    min-width: 300px;
}

/* =====================================================
   Workflow Instance Viewer Styles
   ===================================================== */

/* Instance Viewer Layout */
.bpmn-instance-viewer-layout {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
    background-color: #f8f9fa;
}

.instance-viewer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    min-height: 60px;
}

.instance-header .header-left,
.instance-header .header-right {
    display: flex;
    align-items: center;
}

.workflow-instance-viewer-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    margin: -1.1rem -1.5rem;
}

.viewer-breadcrumb {
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

/* Instance Canvas Container */
.instance-canvas-container {
    flex: 1;
    overflow: hidden;
}

.instance-canvas-container.with-logs {
    flex: 1;
    max-height: calc(100% - 250px);
}

.bpmn-instance-canvas-container {
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* Read-only node styles */
.bpmn-node-readonly {
    cursor: pointer;
}

.bpmn-node-readonly:hover {
    transform: translateY(-2px);
}

/* Execution status styles */
.execution-pending {
    opacity: 0.6;
}

.execution-running {
    animation: pulse 1.5s ease-in-out infinite;
}

.execution-completed {
    border-color: #28a745 !important;
}

.execution-failed {
    border-color: #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05);
}

.execution-skipped {
    opacity: 0.5;
    border-style: dashed;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
}

/* Current node indicator */
.current-node {
    border-width: 3px;
}

.current-indicator {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #007bff;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    white-space: nowrap;
}

/* Execution status indicator on nodes */
.execution-status-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 15;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.execution-status-indicator.execution-pending {
    color: #6c757d;
}

.execution-status-indicator.execution-running {
    color: #007bff;
}

.execution-status-indicator.execution-completed {
    color: #28a745;
}

.execution-status-indicator.execution-failed {
    color: #dc3545;
}

.execution-status-indicator.execution-skipped {
    color: #6c757d;
}

/* Execution legend */
.execution-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.pending {
    background-color: #6c757d;
    opacity: 0.5;
}

.legend-dot.running {
    background-color: #007bff;
}

.legend-dot.completed {
    background-color: #28a745;
}

.legend-dot.failed {
    background-color: #dc3545;
}

/* Instance Log Panel */
.instance-log-panel {
    height: 250px;
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.workflow-log-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.log-panel-header .header-left,
.log-panel-header .header-right {
    display: flex;
    align-items: center;
}

.log-entries {
    flex: 1;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    padding: 0.35rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.log-entry:hover {
    background-color: #f8f9fa;
}

.log-entry.highlighted {
    background-color: rgba(0, 123, 255, 0.1);
}

.log-entry.log-error {
    background-color: rgba(220, 53, 69, 0.05);
}

.log-entry.log-success {
    background-color: rgba(40, 167, 69, 0.05);
}

.log-entry.log-workflow {
    background-color: rgba(23, 162, 184, 0.05);
}

.log-timestamp {
    width: 90px;
    flex-shrink: 0;
    color: #6c757d;
    font-size: 0.75rem;
}

.log-icon {
    width: 24px;
    flex-shrink: 0;
    text-align: center;
}

.log-content {
    flex: 1;
    min-width: 0;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.log-type {
    font-weight: 600;
    font-size: 0.75rem;
}

.log-node {
    font-size: 0.7rem;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

.log-message {
    color: #495057;
    word-break: break-word;
}

.empty-log {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    padding: 2rem;
}

/* Node Data Panel */
.node-data-panel {
    width: 400px;
    min-width: 400px;
    background-color: #fff;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, min-width 0.2s ease;
    overflow: hidden;
}

.node-data-panel.hidden {
    width: 0;
    min-width: 0;
    border-left: none;
}

.node-data-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.node-data-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.node-info-section {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.info-row {
    display: flex;
    margin-bottom: 0.5rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    width: 100px;
    flex-shrink: 0;
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.info-value {
    flex: 1;
    font-size: 0.85rem;
    word-break: break-word;
}

.info-row.error-row {
    background-color: rgba(220, 53, 69, 0.05);
    padding: 0.5rem;
    margin: 0.5rem -0.5rem;
    border-radius: 4px;
}

/* Data Tabs */
.data-tabs {
    border-bottom: 1px solid #dee2e6;
}

.data-tabs .nav-tabs {
    border-bottom: none;
}

.data-tabs .nav-tabs-sm .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.data-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.data-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.data-item {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.data-key {
    padding: 0.35rem 0.75rem;
    background-color: #f8f9fa;
    font-weight: 500;
    font-size: 0.8rem;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.data-value {
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: #fff;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #adb5bd;
    text-align: center;
}

.empty-state .bi {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Events list in Node Data Panel */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-item {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.event-item.event-error {
    border-color: rgba(220, 53, 69, 0.3);
    background-color: rgba(220, 53, 69, 0.05);
}

.event-item.event-success {
    border-color: rgba(40, 167, 69, 0.3);
    background-color: rgba(40, 167, 69, 0.05);
}

.event-item.event-info {
    border-color: rgba(23, 162, 184, 0.3);
    background-color: rgba(23, 162, 184, 0.05);
}

.event-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.event-type {
    font-weight: 600;
    font-size: 0.75rem;
}

.event-time {
    margin-left: auto;
    font-size: 0.7rem;
    color: #6c757d;
}

.event-message {
    font-size: 0.8rem;
    color: #495057;
}

.event-data-details {
    margin-top: 0.5rem;
}

.event-data-details summary {
    font-size: 0.75rem;
    color: #6c757d;
    cursor: pointer;
}

.event-data {
    margin-top: 0.25rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Consolas', 'Monaco', monospace;
    max-height: 150px;
    overflow-y: auto;
}

/* =====================================================
   Property Example Tooltip Styles
   ===================================================== */

/* Ensure property pane can show tooltips */
.bpmn-property-pane {
    overflow: visible;
}

.property-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    /* Clip content but allow tooltips via separate mechanism */
}

/* Property example info icon container */
.property-example-icon {
    position: static;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.property-example-icon .bi-info-circle {
    font-size: 0.85rem;
    transition: color 0.15s ease;
}

.property-example-icon:hover .bi-info-circle {
    color: #0056b3;
}

/* The tooltip container - use fixed positioning to escape overflow constraints */
.property-example-tooltip {
    position: fixed;
    z-index: 99999;
    padding: 0;
    background-color: #1e1e1e;
    border: 1px solid #3c3c3d;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    width: 320px;
    max-height: 350px;
    display: none;
    pointer-events: none;
}

.property-example-icon:hover .property-example-tooltip {
    display: block;
}

/* Tooltip header */
.property-example-tooltip .tooltip-header {
    padding: 0.5rem 0.75rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #3c3c3c;
    border-radius: 5px 5px 0 0;
}

/* Tooltip code content */
.property-example-tooltip .tooltip-code {
    margin: 0;
    padding: 0.75rem;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow-y: auto;
    border-radius: 0 0 5px 5px;
}

/* Scrollbar styling for tooltip */
.property-example-tooltip .tooltip-code::-webkit-scrollbar {
    width: 6px;
}

.property-example-tooltip .tooltip-code::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.property-example-tooltip .tooltip-code::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.property-example-tooltip .tooltip-code::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* =====================================================
   Property Example Inline Styles
   ===================================================== */

/* Inline example container - shown when lightbulb is clicked */
.property-example-inline {
    background-color: #1e1e1e;
    border: 1px solid #3c3c3c;
    border-radius: 6px;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

/* Example header */
.property-example-inline .example-header {
    padding: 0.4rem 0.75rem;
    background-color: #2d2d2d;
    color: #ffc107;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #3c3c3c;
}

/* Example code content */
.property-example-inline .example-code {
    margin: 0;
    padding: 0.75rem;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* Scrollbar styling for example code */
.property-example-inline .example-code::-webkit-scrollbar {
    width: 6px;
}

.property-example-inline .example-code::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.property-example-inline .example-code::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.property-example-inline .example-code::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Lightbulb button styling */
.form-label .btn-link {
    line-height: 1;
}

.form-label .btn-link .bi-lightbulb,
.form-label .btn-link .bi-lightbulb-fill {
    font-size: 0.9rem;
}

/* =====================================================
   Toolbar Button Styles (Larger, More User-Friendly)
   ===================================================== */

/* Canvas toolbar buttons */
.canvas-toolbar-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.canvas-toolbar-btn .bi {
    font-size: 1.1rem;
}

.canvas-toolbar-btn .btn-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.canvas-toolbar-btn.zoom-display {
    min-width: 55px;
    font-weight: 600;
    cursor: default;
    background-color: #f8f9fa;
}

/* Editor header toolbar buttons */
.editor-toolbar-btn {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.editor-toolbar-btn .bi {
    font-size: 1rem;
}

.editor-toolbar-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.editor-toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Save button special styling */
.editor-toolbar-btn.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.editor-toolbar-btn.btn-success:hover:not(:disabled) {
    background-color: #218838;
    border-color: #1e7e34;
}

.editor-toolbar-btn.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================
   Button Animations
   ===================================================== */

/* Spin animation for refresh button */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   Page Action Buttons (Larger, More User-Friendly)
   ===================================================== */

/* Page-level action buttons (headers, empty states) */
.page-action-btn {
    padding: 0.6rem 1.25rem !important;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.page-action-btn .bi {
    font-size: 1.1rem;
}

.page-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.page-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Table action buttons (in table rows) */
.table-action-btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.table-action-btn .bi {
    font-size: 1rem;
}

.table-action-btn .btn-text {
    font-size: 0.8rem;
}

.table-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button group for table actions */
.btn-group .table-action-btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .table-action-btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Responsive: hide text labels on smaller screens for table buttons */
@media (max-width: 992px) {
    .table-action-btn .btn-text {
        display: none;
    }
    
    .table-action-btn .bi {
        margin-right: 0 !important;
    }
    
    .table-action-btn {
        padding: 0.4rem 0.6rem !important;
    }
}

@media (max-width: 576px) {
    .page-action-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem;
    }
    
    .page-action-btn span:not(.bi) {
        display: none;
    }
    
    .page-action-btn .bi {
        margin-right: 0 !important;
    }
}

/* =====================================================
   Property Info Tooltip Styles
   ===================================================== */

/* Property label with info icon wrapper */
.property-label-with-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Info icon button */
.property-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.property-info-btn:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.property-info-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.property-info-btn .bi {
    font-size: 0.85rem;
}

/* Property info tooltip - fixed position to escape overflow */
.property-info-tooltip {
    position: fixed;
    z-index: 99999;
    min-width: 220px;
    max-width: 320px;
    padding: 0;
    background-color: #1e1e1e;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.property-info-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Tooltip arrow */
.property-info-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background-color: #2d2d2d;
    border-left: 1px solid #3c3c3c;
    border-top: 1px solid #3c3c3c;
    transform: rotate(45deg);
}

/* Tooltip header */
.property-info-tooltip .tooltip-header {
    padding: 0.5rem 0.75rem;
    background-color: #2d2d2d;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 1px solid #3c3c3c;
    border-radius: 7px 7px 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.property-info-tooltip .tooltip-header .bi {
    color: #0d6efd;
}

/* Tooltip body */
.property-info-tooltip .tooltip-body {
    padding: 0.75rem;
}

/* Description section */
.property-info-tooltip .tooltip-description {
    color: #d4d4d4;
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Metadata section */
.property-info-tooltip .tooltip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3c3c3c;
}

.property-info-tooltip .tooltip-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.7rem;
    color: #a0a0a0;
}

.property-info-tooltip .tooltip-meta-item .bi {
    font-size: 0.7rem;
}

.property-info-tooltip .tooltip-meta-item.required {
    color: #f97583;
    background-color: rgba(249, 117, 131, 0.1);
}

.property-info-tooltip .tooltip-meta-item.type {
    color: #79c0ff;
    background-color: rgba(121, 192, 255, 0.1);
}

.property-info-tooltip .tooltip-meta-item.default {
    color: #7ee787;
    background-color: rgba(126, 231, 135, 0.1);
}

/* Example section in tooltip */
.property-info-tooltip .tooltip-example {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3c3c3c;
}

.property-info-tooltip .tooltip-example-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #ffc107;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-info-tooltip .tooltip-example-code {
    margin: 0;
    padding: 0.5rem;
    background-color: #161616;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
    border-radius: 4px;
}

/* Scrollbar styling for tooltip example */
.property-info-tooltip .tooltip-example-code::-webkit-scrollbar {
    width: 5px;
}

.property-info-tooltip .tooltip-example-code::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.property-info-tooltip .tooltip-example-code::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.property-info-tooltip .tooltip-example-code::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* =====================================================
   End Property Info Tooltip Styles
   ===================================================== */

/* =====================================================
   Expression Builder - Context Item Insert Button
   (Global styles needed because RenderTreeBuilder content 
   doesn't get CSS isolation scope attributes)
   ===================================================== */

/* Context item row in Available Data panel */
.context-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 38px;
}

.context-item:hover {
    background: rgba(13, 110, 253, 0.1);
}

.context-item-toggle {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.7rem;
    width: 14px;
    flex-shrink: 0;
}

.context-item-spacer {
    width: 14px;
    flex-shrink: 0;
}

.context-item-icon {
    opacity: 0.7;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.context-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--bs-font-monospace);
    cursor: pointer;
}

.context-item-name:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.context-item-type {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    background: #e9ecef;
    color: #6c757d;
    font-weight: 500;
    text-transform: lowercase;
    flex-shrink: 0;
}

/* Insert button for Available Data items - LARGE and always visible */
.context-item-insert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: none;
    background: #198754;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.context-item-insert-btn:hover {
    background: #0d6efd;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.context-item-insert-btn:active {
    transform: scale(0.95);
}

/* =====================================================
   End Expression Builder Styles
   ===================================================== */

/* =====================================================
   Code Editor Styles
   ===================================================== */

/* View Mode Toggle in Header */
.editor-header .header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-mode-toggle {
    border-radius: 6px;
    overflow: hidden;
}

.view-mode-toggle .btn {
    border-radius: 0;
    border: 1px solid #dee2e6;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.view-mode-toggle .btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.view-mode-toggle .btn:last-child {
    border-radius: 0 6px 6px 0;
}

.view-mode-toggle .btn.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.view-mode-toggle .btn.btn-outline-secondary:hover {
    background-color: #e9ecef;
}

/* Code Editor Pane */
.code-editor-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    background-color: #1e1e1e;
    border-radius: 0.5rem;
    overflow: hidden;
}

.code-editor-pane.expanded {
    height: 100%;
}

.code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #2d2d2d;
    border-bottom: 1px solid #3c3c3c;
}

.code-editor-header .header-left,
.code-editor-header .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-editor-header .header-left {
    color: #e0e0e0;
    font-size: 0.85rem;
}

.code-editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Line number gutter */
.code-editor-gutter {
    width: 50px;
    min-width: 50px;
    background-color: #1e1e1e;
    border-right: 1px solid #3c3c3c;
    padding: 0.75rem 0;
    overflow-y: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    user-select: none;
}

.code-editor-gutter .line-number {
    text-align: right;
    padding-right: 0.75rem;
    color: #6c6c6c;
    height: 1.5em;
}

.code-editor-gutter .line-number.has-error {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Code content area (textarea + highlight overlay) */
.code-editor-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Textarea for actual editing */
.code-textarea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    margin: 0;
    border: none;
    resize: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    background-color: transparent;
    color: #d4d4d4;
    caret-color: #d4d4d4;
    outline: none;
    overflow: auto;
    white-space: pre;
    z-index: 2;
}

.code-textarea::placeholder {
    color: #6c6c6c;
}

.code-textarea.has-errors {
    border: 1px solid #dc3545;
}

/* Syntax highlighting overlay */
.code-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    pointer-events: none;
    z-index: 1;
    color: transparent;
    background-color: #1e1e1e;
}

/* JSON syntax highlighting colors */
.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #569cd6;
}

.json-bracket {
    color: #d4d4d4;
}

/* Problems panel */
.code-editor-problems {
    background-color: #252526;
    border-top: 1px solid #3c3c3c;
    max-height: 150px;
    overflow-y: auto;
}

.code-editor-problems .problems-header {
    padding: 0.35rem 0.75rem;
    background-color: #2d2d2d;
    color: #ffc107;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #3c3c3c;
}

.code-editor-problems .problems-list {
    padding: 0.25rem 0;
}

.code-editor-problems .problem-item {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.code-editor-problems .problem-item.error {
    color: #f48771;
}

.code-editor-problems .problem-item.warning {
    color: #cca700;
}

/* BPMN Code View Editor wrapper */
.bpmn-code-view-editor {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
}

.code-view-toolbar {
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}
 
.code-view-toolbar .toolbar-info {
    font-size: 0.8rem;
    color: #6c757d;
}

/* =====================================================
   End Code Editor Styles
   ===================================================== */
