/* --- HEADER DE IDENTIFICAÇÃO ULTRA COMPACTO (50% texto | 50% botões) --- */
.header-identificacao {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #cbd5e1;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-identificacao h2 {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
    color: #334155;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-identificacao h2::before {
    content: '📋';
    font-size: 1rem;
}

/* GRID PRINCIPAL: 40% campos | 60% botões */
.identificacao-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 16px;
    align-items: start;
}

/* COLUNA ESQUERDA: Campos */
.form-fields-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
}


/* COLUNA DIREITA: Botões Organizados */
.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.btn-action-compact {
    padding: 6px 8px;
    font-size: 0.7rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: #475569;
}

.btn-action-compact:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-action-compact:disabled,
.btn-setor-toggle:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-field label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-field textarea {
    resize: none;
    min-height: 32px;
    font-size: 0.75rem;
    line-height: 1.3;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

/* PAINEL DE AÇÕES INTEGRADO (Abaixo de Instruções) */
.acoes-modelo-integrado {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.acoes-modelo-integrado h4 {
    margin: 0 0 10px 0;
    font-size: 0.7rem;
    color: #f1f5f9;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acoes-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-acao-integrado {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-acao-validar-integrado {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-acao-validar-integrado:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.btn-acao-salvar-integrado {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-acao-salvar-integrado:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.status-validacao-integrado {
    grid-column: 1 / -1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    margin-top: 6px;
}

.status-validacao-integrado.valido {
    background: #dcfce7;
    color: #166534;
}

.status-validacao-integrado.invalido {
    background: #fee2e2;
    color: #991b1b;
}

.versao-badge-integrado {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

.checkbox-field input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.checkbox-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    margin: 0;
}

/* COLUNA DIREITA: Botões de Gateway */
.gateway-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: flex-start;
}

.btn-gateway-compact {
    padding: 6px 10px;
    font-size: 0.75rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: #475569;
}

.btn-gateway-compact:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* --- TOOLBAR DE SETORES COMPACTO --- */
.editor-toolbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.toolbar-scrollable-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 40px;
}

.toolbar-line {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.toolbar-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
    flex-shrink: 0;
}

.buttons-row {
    display: inline-flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.btn-setor-toggle {
    padding: 5px 8px;
    font-size: 0.75rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 600;
    color: #475569;
}

.btn-setor-toggle:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn-setor-toggle.selected-sector-btn {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.toolbar-separator {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #cbd5e1;
    margin: 0 6px;
    flex-shrink: 0;
}

/* PAINEL DE VALIDAÇÃO */
#painel-validacao {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 9999;
    display: none;
}

#painel-validacao.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.validacao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.validacao-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.validacao-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s;
}

.validacao-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.validacao-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.validacao-item.erro {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    color: #7f1d1d;
}

.validacao-item.aviso {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

.validacao-item.sucesso {
    background: #dcfce7;
    border-left: 4px solid #16a34a;
    color: #14532d;
}

.btn-validar {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
}

.btn-validar:hover {
    background: #2563eb;
}

.status-validacao {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 10px;
}

.status-validacao.valido {
    background: #dcfce7;
    color: #166534;
}

.status-validacao.invalido {
    background: #fee2e2;
    color: #991b1b;
}

/* --- NOVOS ESTILOS [Fase 1: Indicadores Visuais de SLA e Assinatura] --- */
.bpmn-label-indicador {
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.indicador-sla {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    color: #9a6e10;
    border: 1px solid #f59e0b;
}

.indicador-assinatura {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.indicador-documento {
    background: linear-gradient(135deg, #f0fdf4 0%, #bbf7d0 100%);
    color: #185818;
    border: 1px solid #22c55e;
}

/* Botões pequenos de Gateway */
.btn-gateway-small {
    padding: 6px 10px;
    font-size: 1.1rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.btn-gateway-small:hover {
    background: #3b82f6;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-gateway-small:active {
    transform: scale(0.95);
}

/* Botões compactos com texto visível */
.btn-gateway-compact {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-weight: 600;
    color: #475569;
}

.btn-gateway-compact:hover {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.btn-gateway-compact:active {
    transform: translateY(0);
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.acoes-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.acoes-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #f1f5f9;
    font-weight: 700;
}

.acoes-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-acao-validar,
.btn-acao-salvar {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-acao-validar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-acao-validar:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.btn-acao-salvar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-acao-salvar:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.status-validacao-inline {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

.status-validacao-inline.valido {
    background: #dcfce7;
    color: #166534;
}

.status-validacao-inline.invalido {
    background: #fee2e2;
    color: #991b1b;
}

/* OCULTAR BENDPOINTS (BOLINHAS NAS CONEXÕES) */
.djs-bendpoint,
.djs-segment-dragger {
    display: none !important;
}

/* OCULTAR MARCADORES DE WAYPOINT */
.djs-connection .djs-hit {
    pointer-events: none;
}

/* OPCIONAL: Ocultar também os pontos de ancoragem ao conectar */
.djs-connection-preview .djs-visual {
    marker-end: none !important;
}

.versao-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}