/* ==========================================================================
   EVO P2P Purchasing Process - Stylesheet (Lumen & Modern Enterprise Design)
   ========================================================================== */

:root {
    --bg-app: #f7f9fc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --primary-color: #e60067; /* Magenta Pipefy Style */
    --primary-hover: #c40058;
    --primary-light: #fde8f1;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Priority Badges */
    --badge-high-bg: #fee2e2;
    --badge-high-text: #dc2626;
    --badge-med-bg: #fef3c7;
    --badge-med-text: #d97706;
    --badge-low-bg: #dcfce7;
    --badge-low-text: #16a34a;

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Header Principal
   -------------------------------------------------------------------------- */
.main-header {
    height: 60px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
    width: 240px;
    border-right: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-main);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.brand-sub {
    color: var(--primary-color);
}

.divider-v {
    display: none;
}

.active-tab-header-indicator {
    position: absolute;
    left: 264px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Painel de Seleção de Projeto e Pasta de Processo no Header Superior */
.flow-folder-selector-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.flow-folder-selector-box:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.flow-folder-selector-box .selector-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dark);
    font-weight: 600;
}

.flow-folder-selector-box .selector-field label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.flow-folder-select {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.flow-folder-select:hover,
.flow-folder-select:focus {
    border-color: var(--primary-color);
    background: #ffffff;
}

.selector-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}

.active-tab-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
}

.active-tab-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}
    color: var(--text-main);
}

.process-badge {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 24px;
}

.global-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.global-search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.global-search-box input {
    width: 100%;
    padding: 7px 12px 7px 34px;
    background: var(--bg-subtle);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all 0.2s ease;
}

.global-search-box input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.user-role {
    font-size: 10px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Botoes Globais
   -------------------------------------------------------------------------- */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

.w-100 { width: 100%; justify-content: center; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* --------------------------------------------------------------------------
   Layout com Sidebar Vertical à Esquerda
   -------------------------------------------------------------------------- */
.app-layout-body {
    display: flex;
    min-height: calc(100vh - 60px);
    align-items: stretch;
}

.app-sidebar {
    width: 240px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    flex-shrink: 0;
    padding: 16px 0 12px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-header-title {
    padding: 0 20px 12px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.5px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 12px;
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
    width: 100%;
}

/* Botão Novo Projeto na Sidebar (Acima do item Mapa) */
.btn-sidebar-project {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: #eff6ff;
    color: var(--primary-color);
    border: 1.5px dashed #93c5fd;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-sidebar-project:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Árvore de Projetos & Pastas sob a aba Mapa */
.sidebar-projects-container {
    margin: 2px 0 8px 12px;
    padding-left: 8px;
    border-left: 2px solid #e2e8f0;
}

.sidebar-project-group {
    margin-bottom: 6px;
}

.sidebar-project-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.sidebar-project-header:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-project-header .proj-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-project-header .proj-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
}

.sidebar-project-header:hover .proj-actions {
    opacity: 1;
}

.sidebar-project-header .btn-proj-action {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sidebar-project-header .btn-proj-action:hover {
    color: var(--primary-color);
    background: #e2e8f0;
}

/* Lista de Pastas de Processos dentro do Projeto */
.sidebar-project-folders {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    margin-left: 10px;
}

.sidebar-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-folder-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-folder-item.active {
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 700;
}

.sidebar-folder-item .folder-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-folder-item .folder-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0.6;
    margin-left: auto;
}

.sidebar-folder-item:hover .folder-actions {
    opacity: 1;
}

.sidebar-folder-item .btn-folder-action {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sidebar-folder-item .btn-folder-action:hover {
    color: var(--primary-color);
    background: #cbd5e1;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 14px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.nav-tab i {
    font-size: 15px;
    width: 20px;
    text-align: center;
}

.nav-tab span {
    flex: 1;
}

.nav-tab:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.nav-tab.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.badge-count {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-tab.active .badge-count {
    background: white;
    color: var(--primary-color);
}

.sidebar-filter-box {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: var(--bg-app);
    margin: auto 12px 0 12px;
    border-radius: var(--radius-md);
}

.sidebar-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.select-filter {
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 12px;
    background-color: white;
    color: var(--text-main);
    width: 100%;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Conteudo das Tabs
   -------------------------------------------------------------------------- */
.app-content {
    flex: 1;
    min-width: 0;
    padding: 16px 24px 24px 24px;
    min-height: calc(100vh - 60px);
    overflow-x: auto;
}

.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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

.view-header {
    margin-bottom: 20px;
}

.view-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   1. TAB MAPA
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   1. TAB MAPA INTERATIVO (CANVAS & DRAG-AND-DROP)
   -------------------------------------------------------------------------- */
#view-mapa.tab-view.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 720px;
}

.map-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 650px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    box-shadow: var(--shadow-sm);
}

.map-toolbar {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10 !important; /* Setas e conectores SVG no plano superior às piscinas */
}

.map-svg path {
    pointer-events: visibleStroke;
    cursor: pointer;
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.map-svg path:hover {
    stroke: var(--primary-color) !important;
    stroke-width: 4px !important;
    stroke-dasharray: none !important;
}

.map-svg path.selected-link {
    stroke: #ef4444 !important;
    stroke-width: 4px !important;
    stroke-dasharray: 4 4 !important;
}

.map-nodes-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.map-node {
    position: absolute;
    z-index: 20; /* Eventos, tarefas, decisões e dados no plano superior */
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    transform-origin: top left;
}

.map-node.dragging {
    cursor: grabbing !important;
    z-index: 30 !important;
    opacity: 0.95;
}

.map-node.selected .node-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-lg);
}

.map-node.connecting-source .node-card {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px #e0e7ff, var(--shadow-lg);
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0px rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0px rgba(99, 102, 241, 0); }
}

.node-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    min-width: 230px;
    position: relative;
}

.node-main .node-card {
    border-left: 5px solid var(--primary-color);
}

.node-badge {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #0f172a;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 3;
}

.node-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.icon-db {
    background: #e0f2fe;
    color: #0284c7;
}

.node-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.node-type {
    font-size: 11px;
    color: var(--text-muted);
}

.node-connect-dot {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-node:hover .node-connect-dot {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-db {
    background: #e0f2fe;
    color: #0284c7;
}

.node-content h3 {
    font-size: 14px;
    font-weight: 600;
}

.node-type {
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   2. TAB FLUXO (STAGES ARCHITECTURE)
   -------------------------------------------------------------------------- */
.flow-stages-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.flow-stage-card {
    min-width: 240px;
    width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flex-header-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.flow-folder-selector-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.flow-folder-selector-box .selector-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-folder-selector-box .selector-divider {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
}

.flow-folder-selector-box label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.flow-folder-select {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-color);
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    max-width: 220px;
}

.flow-folder-select:hover, .flow-folder-select:focus {
    border-color: var(--primary-color);
    background: white;
}

/* --------------------------------------------------------------------------
   SETA CHEVRON NA SIDEBAR PARA OCULTAR/EXPANDIR PASTAS & SUB-Navegação
   -------------------------------------------------------------------------- */
.nav-tab .btn-toggle-tree-chevron {
    margin-left: auto;
    font-size: 11px;
    color: #94a3b8;
    padding: 2px 4px;
    border-radius: 4px;
    transition: transform 0.25s ease, color 0.15s ease;
}

.nav-tab .btn-toggle-tree-chevron:hover {
    color: var(--primary-color);
    background: #cbd5e1;
}

.nav-tab.collapsed-tree .btn-toggle-tree-chevron {
    transform: rotate(-90deg);
}

.sidebar-projects-container.collapsed {
    display: none !important;
}

/* Sub-navegação da Sidebar para Configurações */
.sidebar-subnav-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 14px;
    margin-top: 2px;
    margin-bottom: 6px;
    border-left: 2px solid #cbd5e1;
    padding-left: 6px;
    transition: all 0.2s ease;
}

.sidebar-subnav-container.collapsed {
    display: none !important;
}

.sidebar-subnav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    border-radius: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.sidebar-subnav-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-subnav-item.active {
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 700;
}

/* Badges de Perfis de Usuários e Segurança */
.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.user-role-badge.role-admin { background: #fce7f3; color: #be185d; }
.user-role-badge.role-gestor { background: #e0e7ff; color: #4338ca; }
.user-role-badge.role-operador { background: #f1f5f9; color: #475569; }

.user-hash-badge {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    background: #0f172a;
    color: #38bdf8;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* User Profile Header Dropdown Menu */
.user-profile {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.user-profile:hover {
    background: #f1f5f9;
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    display: none;
}

.user-profile-dropdown.active {
    display: block;
}

.dropdown-item-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.dropdown-item-btn:hover {
    background: #f8fafc;
}

.dropdown-item-btn.text-danger {
    color: #dc2626;
}

.dropdown-item-btn.text-danger:hover {
    background: #fef2f2;
}

/* Subpasta dentro da Sidebar */
.sidebar-subfolder-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subfolder-header {
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-subfolder-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 10px;
    border-left: 1.5px dashed #cbd5e1;
    padding-left: 4px;
    transition: all 0.2s ease;
}

.sidebar-subfolder-items.collapsed {
    display: none !important;
}

.pl-24 {
    padding-left: 14px !important;
}

/* Modal de Confirmação Customizado (Card / Popover) */
.modal-card-sm {
    max-width: 380px !important;
    padding: 24px;
    border-radius: 12px;
}

.confirm-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 24px;
}

.confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.confirm-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-actions-flex {
    display: flex;
    gap: 10px;
}

/* Avatar Flutuante do Executor no Card do Mapa BPMN */
.map-node-avatar-badge {
    position: absolute;
    top: -12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px 3px 4px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: 1.5px solid #e2e8f0;
    z-index: 10;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-node-avatar-badge:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.map-node-avatar-badge .avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.map-node-avatar-badge .avatar-name-tag {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

/* Layout de Cabeçalho das Tabelas de Cadastro */
.table-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-color-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: none;
}

/* --------------------------------------------------------------------------
   TELA DE CADASTROS DA PLATAFORMA BPMN
   -------------------------------------------------------------------------- */
.cadastros-subnav-bar, .config-subnav-bar {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    overflow-x: auto;
}

.cadastros-tab-btn, .config-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cadastros-tab-btn:hover, .config-tab-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.cadastros-tab-btn.active, .config-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.cadastros-panel-content, .config-panel-content {
    display: none;
}

.cadastros-panel-content.active, .config-panel-content.active {
    display: block;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.config-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.config-section-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.config-list-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.form-control-sm {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    background: white;
}

.bg-indigo { background: #e0e7ff; color: #4338ca; }
.bg-amber { background: #fef3c7; color: #d97706; }
.bg-green { background: #dcfce7; color: #15803d; }
.p-20 { padding: 20px; }

.flow-stage-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flow-stage-header.color-start { border-bottom-color: #6366f1; }
.flow-stage-header.color-approval { border-bottom-color: #eab308; }
.flow-stage-header.color-adjust { border-bottom-color: #f97316; }
.flow-stage-header.color-rfq { border-bottom-color: #ec4899; }
.flow-stage-header.color-supplier { border-bottom-color: #a855f7; }
.flow-stage-header.color-po { border-bottom-color: #06b6d4; }

.stage-title {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.stage-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-stage-action {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-stage-action i {
    pointer-events: none;
}

.btn-stage-action:hover {
    color: var(--primary-color);
    background: #eff6ff;
    border-color: #93c5fd;
}

.btn-stage-action.btn-stage-delete:hover {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fca5a5;
}

.stage-fields-badge {
    display: none !important;
}

.stage-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 6px;
    margin-bottom: 6px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.stage-actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   CARTÃO DE CAMPO / PASSO DA FASE DO FLUXO INTERATIVO
   -------------------------------------------------------------------------- */
.stage-fields-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto !important;
    margin-bottom: 12px;
    justify-content: flex-end;
}

.stage-field-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}

.stage-field-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.stage-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.stage-field-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.stage-field-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-field-action {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-field-action i {
    pointer-events: none;
}

.btn-field-action:hover {
    color: var(--primary-color);
    background: #eff6ff;
    border-color: #93c5fd;
}

.btn-field-action.btn-field-delete:hover {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fca5a5;
}

.stage-field-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.stage-field-assignees {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.assignee-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
}

.assignee-tag .remove-assignee-btn {
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
}

.assignee-tag .remove-assignee-btn:hover {
    opacity: 1;
    color: #dc2626;
}

.btn-add-assignee-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    color: #475569;
    border: 1px dashed #cbd5e1;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-add-assignee-tag:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

.btn-add-field-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: #f8fafc;
    color: var(--primary-color);
    border: 1px dashed #93c5fd;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.btn-add-field-stage:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* --------------------------------------------------------------------------
   3. TAB KANBAN BOARD
   -------------------------------------------------------------------------- */
.kanban-board-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    min-height: 70vh;
    padding-bottom: 20px;
}

.kanban-column {
    position: relative;
    min-width: 290px;
    width: 290px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 170px);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.25s ease;
}

.kanban-column.stage-active {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.kanban-column.stage-completed {
    border-color: #e2e8f0;
    background: #fafafa;
    opacity: 0.96;
}

.kanban-column-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 11px 11px 0 0;
}

.kanban-column-header.color-start { border-bottom-color: #818cf8; background: #e0e7ff; }
.kanban-column-header.color-rfq { border-bottom-color: #f472b6; background: #fce7f3; }
.kanban-column-header.color-approval { border-bottom-color: #fbbf24; background: #fef3c7; }
.kanban-column-header.color-adjust { border-bottom-color: #fb923c; background: #ffedd5; }
.kanban-column-header.color-supplier { border-bottom-color: #c084fc; background: #f3e8ff; }
.kanban-column-header.color-po { border-bottom-color: #22d3ee; background: #cff4fc; }
.kanban-column-header.col-completed { border-bottom-color: #4ade80; background: #dcfce7; }

.column-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.column-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.column-count {
    font-size: 11px;
    font-weight: 700;
    background: #ffffff;
    color: #475569;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-add-card-phase {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}

.btn-add-card-phase:hover {
    color: var(--primary-color);
    transform: scale(1.15);
}

@keyframes floatAvatarMotion {
    0% { transform: translateY(0px); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35); }
    50% { transform: translateY(-6px); box-shadow: 0 10px 18px rgba(139, 92, 246, 0.5); }
    100% { transform: translateY(0px); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35); }
}

.floating-stage-avatar-wrapper {
    position: absolute;
    bottom: 84px;
    right: 14px;
    z-index: 8;
    pointer-events: auto;
}

.floating-stage-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
    animation: floatAvatarMotion 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.floating-stage-avatar:hover {
    transform: scale(1.15) translateY(-4px) !important;
}

.kanban-stage-responsible-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    padding: 8px 14px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
}

.kanban-stage-responsible-box .resp-label {
    color: #64748b;
    font-weight: 500;
}

.kanban-stage-responsible-box .resp-name {
    color: #0f172a;
    font-weight: 700;
}

.kanban-column-footer {
    padding: 10px 12px;
    background: #ffffff;
    margin-top: auto;
}

.btn-complete-kanban-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-complete-kanban-stage:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-complete-kanban-stage.is-done {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-weight: 600;
}

.btn-complete-kanban-stage.is-done:hover {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
    box-shadow: none;
}

.kanban-cards-wrapper {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
}

.kanban-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all 0.15s ease;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-tag-sample {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.card-priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
}

.badge-high { background: var(--badge-high-bg); color: var(--badge-high-text); }
.badge-medium { background: var(--badge-med-bg); color: var(--badge-med-text); }
.badge-low { background: var(--badge-low-bg); color: var(--badge-low-text); }

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.card-meta-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-meta-item i {
    width: 12px;
    text-align: center;
}

.due-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
    margin-top: 4px;
}

.phase-empty-notice {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
    padding: 10px 12px;
    text-align: left !important;
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.desc-bullet-line {
    text-align: left !important;
    word-break: break-word;
    white-space: normal;
    color: #475569;
    font-size: 11.5px;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   4. TAB LISTA (TABELA)
   -------------------------------------------------------------------------- */
.table-container-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.table-actions-bar {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-search {
    position: relative;
    width: 320px;
}

.table-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

.table-search input {
    width: 100%;
    padding: 6px 12px 6px 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.custom-table th {
    background: var(--bg-subtle);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
}

.custom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background: #f8fafc;
}

.phase-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. TAB RELATORIOS
   -------------------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-purple { background: #f3e8ff; color: #9333ea; }

.metric-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-wrapper {
    height: 260px;
    position: relative;
}

/* --------------------------------------------------------------------------
   6. TAB FORMULARIO
   -------------------------------------------------------------------------- */
.form-view-wrapper {
    max-width: 760px;
    margin: 0 auto;
}

.form-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.form-header-bg {
    background: linear-gradient(135deg, var(--primary-color), #831843);
    color: white;
    padding: 30px;
    text-align: center;
}

.form-header-bg i {
    font-size: 32px;
    margin-bottom: 10px;
}

.form-header-bg h2 {
    font-size: 22px;
    font-weight: 700;
}

.form-header-bg p {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.request-form {
    padding: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.span-2 { grid-column: span 2; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.req { color: #ef4444; }

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-footer {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   7. TAB BASES DE DADOS
   -------------------------------------------------------------------------- */
.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.db-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.db-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.db-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-title i {
    color: var(--primary-color);
    font-size: 16px;
}

.db-title h3 {
    font-size: 15px;
    font-weight: 600;
}

.badge-tag {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.db-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Modais & Toast Notifications
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: fadeIn 0.2s ease;
}

.modal-card, .modal-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1001;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container.modal-sm {
    max-width: 440px !important;
}

.modal-container.modal-md {
    max-width: 600px !important;
}

.modal-container.modal-lg {
    max-width: 820px !important;
}

.popup-tab-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.popup-tab-btn:hover {
    color: var(--primary-color);
    background: rgba(236, 72, 153, 0.08);
}

.popup-tab-btn.active {
    color: #ffffff;
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-phase-badge {
    display: inline-block;
    background: #fbcfe8;
    color: #be185d;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.modal-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.info-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
}

.val-highlight {
    font-weight: 600;
    color: var(--text-main);
}

.phase-desc-box {
    background: var(--bg-subtle);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1100;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   ESTILOS NOVOS: IA COPILOT, DB MANAGER & IMPRESSÃO EXECUTIVA
   -------------------------------------------------------------------------- */
.view-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.table-right-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Botões IA & Banners */
.btn-ai {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.ai-trigger-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.ai-trigger-banner h4 {
    color: #4338ca;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ai-trigger-banner p {
    font-size: 11px;
    color: #475569;
    margin-bottom: 8px;
}

/* Modal do Agente de IA */
.modal-ai-style {
    max-width: 800px;
    border: 1px solid #c7d2fe;
}

.ai-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
}

.ai-badge-header {
    background: rgba(255, 255, 255, 0.2);
    color: #c7d2fe;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.ai-steps-indicator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ai-step {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;

}

.ai-step .step-num {
    width: 18px;
    height: 18px;
    background: #cbd5e1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.ai-step.active {
    background: #e0e7ff;
    color: #4338ca;
}
.ai-step.active .step-num {
    background: #6366f1;
}

.ai-step.completed {
    background: #dcfce7;
    color: #15803d;
}
.ai-step.completed .step-num {
    background: #22c55e;
}

.ai-progress-bar-container {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.config-section-desc {
    display: none !important;
}

.ai-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    transition: width 0.4s ease;
}

/* Terminal Log IA */
.ai-terminal-log {
    background: #0f172a;
    color: #38bdf8;
    font-family: monospace;
    font-size: 12px;
    padding: 14px;
    border-radius: 8px;
    height: 120px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.log-line {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid de Resultados de Cotação IA */
.ai-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.supplier-quote-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: white;
    position: relative;
}

.supplier-quote-card.winning-quote {
    border: 2px solid #22c55e;
    background: #f0fdf4;
}

.winning-badge-tag {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #22c55e;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.quote-supplier-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.quote-details-list {
    font-size: 11px;
    color: var(--text-muted);
}

.quote-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 6px;
}

.ai-recommendation-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rec-icon {
    width: 36px;
    height: 36px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rec-content h4 {
    font-size: 13px;
    color: #15803d;
    font-weight: 700;
}

.rec-content p {
    font-size: 12px;
    color: #166534;
}

.ai-winning-box {
    background: #f0fdf4;
    border: 1px dashed #22c55e;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 6px;
}

/* Sub-nav de Bases de Dados */
.db-nav-bar {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.db-nav-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-nav-btn:hover {
    background: var(--bg-subtle);
}

.db-nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* @media print para Relatórios PDF */
@media print {
    .main-header, .views-nav, .app-sidebar, .view-controls, .btn-action, .header-right {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .tab-view {
        display: block !important;
    }

    #view-mapa, #view-fluxo, #view-kanban, #view-lista, #view-formulario, #view-databases {
        display: none !important;
    }

    #view-relatorios {
        display: block !important;
    }

    .charts-row {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* --------------------------------------------------------------------------
   BARRA DE ABAS DE DIAGRAMA DE PROCESSO & GADGETS BPMN
   -------------------------------------------------------------------------- */
.diagram-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 6px 12px 0 12px;
    overflow-x: auto;
}

.diagram-tabs-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.diagram-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #e2e8f0;
    color: var(--text-muted);
    border-radius: 6px 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.2s ease;
}

.diagram-tab:hover {
    background: #cbd5e1;
    color: var(--text-main);
}

.diagram-tab.active {
    background: white;
    color: var(--primary-color);
    border-color: var(--border-color);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.04);
}

.diagram-tab .close-tab-btn {
    font-size: 11px;
    color: #94a3b8;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-tab .close-tab-btn:hover {
    background: #ef4444;
    color: white;
}

.btn-diagram-tab-add {
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.btn-diagram-tab-add:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Toolbar de Gadgets & Ações BPMN Superior */
.bpmn-gadget-toolbar {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 40px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.gadget-group-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bpmn-actions-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.toolbar-divider-v {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.gadget-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #f8fafc;
    color: var(--text-dark);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.gadget-action-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.gadget-action-btn:active {
    transform: scale(0.96);
}

.gadget-action-btn.btn-danger-accent {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.gadget-action-btn.btn-danger-accent:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.gadget-group-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.gadget-dropdown-wrapper {
    position: relative;
    z-index: 55;
}

.gadget-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gadget-btn:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.gadget-btn .caret {
    font-size: 9px;
    margin-left: 2px;
}

/* Cores por Categoria BPMN */
.gadget-green { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.gadget-green:hover { background: #dcfce7; }

.gadget-blue { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.gadget-blue:hover { background: #dbeafe; }

.gadget-amber { border-color: #fde68a; color: #b45309; background: #fffbeb; }
.gadget-amber:hover { background: #fef3c7; }

.gadget-cyan { border-color: #a5f3fc; color: #0891b2; background: #ecfeff; }
.gadget-cyan:hover { background: #cffaff; }

.gadget-purple { border-color: #e9d5ff; color: #7e22ce; background: #faf5ff; }
.gadget-purple:hover { background: #f3e8ff; }

/* Menu Popover Dropdown de Gadgets */
.gadget-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 260px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1);
    z-index: 9999 !important;
    display: none;
    padding: 6px 0;
}

.gadget-dropdown-wrapper.open .gadget-menu {
    display: block;
    animation: fadeIn 0.15s ease;
}

.gadget-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gadget-item:hover {
    background: var(--bg-subtle);
}

.gadget-item .item-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.icon-green { background: #dcfce7; color: #16a34a; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-purple { background: #f3e8ff; color: #9333ea; }
.icon-cyan { background: #cffaff; color: #0891b2; }

.gadget-item .item-info {
    display: flex;
    flex-direction: column;
}

.gadget-item .item-info strong {
    font-size: 12px;
    color: var(--text-main);
    line-height: 1.2;
}

.gadget-item .item-info span {
    font-size: 10px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   CONTROLE DE ZOOM DESLIZANTE DO PAINEL DO MAPA (REDUZIDO EM 40%)
   -------------------------------------------------------------------------- */
.map-zoom-control {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    user-select: none;
    transition: all 0.2s ease;
}

.map-zoom-control:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.btn-zoom-step {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 9px;
    transition: all 0.15s ease;
}

.btn-zoom-step:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-zoom-step:active {
    transform: scale(0.92);
}

.map-zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 66px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.map-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 1.5px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.map-zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #be185d;
}

.map-zoom-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 1.5px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.map-zoom-badge {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--primary-color);
    background: #fce7f3;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 30px;
    text-align: center;
    transition: all 0.15s ease;
}

.map-zoom-badge:hover {
    background: var(--primary-color);
    color: white;
}

/* Viewport Content Container (Apenas os Itens sobre o Painel são Escalados) */
.map-viewport-content {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   FORMAS GEOMÉTRICAS BPMN (CÍRCULOS, LOSANGOS, RETÂNGULOS & RAIAS)
   -------------------------------------------------------------------------- */

/* 1. CÍRCULOS DE EVENTOS BPMN */
.node-shape-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-md);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.node-shape-circle:hover {
    box-shadow: var(--shadow-lg);
}

.node-shape-circle .circle-icon {
    font-size: 22px;
}

.node-shape-circle .node-circle-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    background: white;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    pointer-events: none;
}

/* Evento Inicial (Verde) */
.event-start {
    border: 3px solid #22c55e;
    background: #f0fdf4;
    color: #16a34a;
}

/* Evento de Tempo (Amarelo / Amber) */
.event-timer {
    border: 3px double #d97706;
    background: #fffbeb;
    color: #d97706;
}

/* Evento de Mensagem (Azul) */
.event-message {
    border: 3px solid #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* Evento Final (Vermelho) */
.event-end {
    border: 5px solid #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

/* 2. LOSANGOS DE DECISÃO / GATEWAY (DIAMONDS) */
.node-shape-diamond-wrapper {
    width: 76px;
    height: 76px;
    position: relative;
}

.node-shape-diamond {
    width: 76px;
    height: 76px;
    transform: rotate(45deg);
    border: 2.5px solid #d97706;
    background: #fffbeb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-md);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.node-shape-diamond:hover {
    box-shadow: var(--shadow-lg);
}

.node-shape-diamond .diamond-inner {
    transform: rotate(-45deg);
    color: #b45309;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-shape-diamond-wrapper .node-diamond-label {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    background: white;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    pointer-events: none;
}

/* 3. RETÂNGULOS DE TAREFAS (COM BORDAS ESPECÍFICAS) */
.node-task-user .node-card { border-left: 5px solid #2563eb; }
.node-task-service .node-card { border-left: 5px solid #9333ea; }
.node-task-rule .node-card { border-left: 5px solid #d97706; }
.node-subprocess .node-card { border-left: 5px solid #0891b2; border-style: dashed; }

/* 4. RAIAS & POOLS (RETÂNGULOS AMPLOS) */
.node-shape-pool {
    min-width: 480px;
    min-height: 160px;
    border: 2px dashed #0891b2;
    background: rgba(236, 254, 255, 0.45);
    border-radius: var(--radius-md);
    display: flex;
    align-items: stretch;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.node-shape-pool .pool-header {
    width: 38px;
    background: #0891b2;
    color: white;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    border-radius: 0 8px 8px 0;
    padding: 12px 0;
    letter-spacing: 0.5px;
}

.node-shape-pool .pool-content {
    flex: 1;
    padding: 16px;
    font-size: 11px;
    color: #0e7490;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   ALÇAS DE REDIMENSIONAMENTO MANUAL & LINHAS GUIAS DE ALINHAMENTO INTELIGENTE
   -------------------------------------------------------------------------- */

/* Alça de Redimensionamento Removida a Pedido */
.resize-handle-se {
    display: none !important;
}

/* Linhas Guias SVG de Alinhamento Comparativo */
.map-svg line.guide-line-align {
    stroke: #06b6d4 !important;
    stroke-width: 2px !important;
    stroke-dasharray: 4 4 !important;
    animation: pulseGuide 1s infinite alternate;
    pointer-events: none !important;
}

@keyframes pulseGuide {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Editor de Texto Inline para Duplo Clique */
.inline-text-editor {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
    width: 100%;
    z-index: 50;
}

/* Botão de Lápis de Edição Rápida no Canto Superior Esquerdo do Card */
.node-edit-btn {
    display: none !important;
}

/* --------------------------------------------------------------------------
   ESTILOS PARA FERRAMENTAS DE SETAS, POOLS & MULTIRAIAS
   -------------------------------------------------------------------------- */
.gadget-pink {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #fbcfe8;
}
.gadget-pink:hover {
    background: #fbcfe8;
    color: #9d174d;
}
.icon-pink {
    background: #fce7f3;
    color: #be185d;
}

/* 1. Piscina / Pool Horizontal */
/* Layering / Z-Index da Aba Mapa: Pools e Raias ficam no fundo (atrás das tarefas e linhas) */
.map-node.node-shape-pool,
.map-node.node-shape-multilane {
    z-index: 1 !important;
}

.map-node.node-shape-pool.selected,
.map-node.node-shape-multilane.selected {
    z-index: 2 !important;
}

.map-node.node-shape-pool.dragging,
.map-node.node-shape-multilane.dragging {
    z-index: 15 !important;
}

.node-shape-pool {
    background: #ffffff;
    border: 2px solid #64748b;
    border-radius: 6px;
    min-width: 320px;
    min-height: 160px;
    display: flex;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: absolute;
    overflow: visible;
}

.node-shape-pool .pool-header {
    width: 36px;
    background: #e2e8f0;
    border-right: 2px solid #64748b;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
    padding: 10px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    user-select: none;
}

.node-shape-pool .pool-content {
    flex: 1;
    padding: 12px;
    font-size: 12px;
    color: #64748b;
    background: rgba(248, 250, 252, 0.5);
    position: relative;
}

/* 2. Piscina Multiraias / Matriz Grid (Conforme imagem) */
.node-shape-multilane {
    background: #ffffff;
    border: 2px solid #475569;
    border-radius: 6px;
    min-width: 360px;
    min-height: 200px;
    display: flex;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    position: absolute;
    overflow: hidden;
}

.node-shape-multilane .pool-header {
    width: 36px;
    background: #cbd5e1;
    border-right: 2px solid #475569;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    padding: 10px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    user-select: none;
}

.multilane-grid-container {
    flex: 1;
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.multilane-cell {
    border-right: 1px dashed #cbd5e1;
    border-bottom: 1px dashed #cbd5e1;
    padding: 8px;
    font-size: 11px;
    color: #64748b;
    position: relative;
}

.multilane-cell:nth-child(2n) {
    border-right: none;
}
.multilane-cell:nth-child(n+3) {
    border-bottom: none;
}

/* Alças de Ajuste e Ponto de Contr/* --------------------------------------------------------------------------
   MANIPULAÇÃO DE SETAS ESTILO BIZAGI (VERDE ORIGEM, VERMELHO DESTINO, AZUL SEGMENTO)
   -------------------------------------------------------------------------- */
.map-link-path {
    cursor: move;
    stroke: #1e293b;
    stroke-width: 2.5px;
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.map-link-path:hover {
    stroke: #0284c7 !important;
    stroke-width: 3.5px !important;
}

/* 1. Alça de Origem (Círculo Verde Estilo Bizagi) */
.bizagi-handle-start {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #dcfce7;
    border: 2px solid #22c55e;
    border-radius: 50%;
    cursor: grab;
    z-index: 120;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, background 0.15s ease;
}

.bizagi-handle-start:hover {
    transform: translate(-50%, -50%) scale(1.35);
    background: #22c55e;
}

/* 2. Alça de Destino / Seta (Círculo Vermelho Estilo Bizagi) */
.bizagi-handle-end {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 50%;
    cursor: grab;
    z-index: 120;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, background 0.15s ease;
}

.bizagi-handle-end:hover {
    transform: translate(-50%, -50%) scale(1.35);
    background: #ef4444;
}

/* 3. Alça Central de Articulação Ortogonal (Pílula Azul Estilo Bizagi) */
.bizagi-handle-middle {
    position: absolute;
    width: 10px;
    height: 18px;
    background: #ffffff;
    border: 2px solid #0284c7;
    border-radius: 6px;
    cursor: ew-resize;
    z-index: 120;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, background 0.15s ease;
}

.bizagi-handle-middle:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background: #0284c7;
}

.bizagi-handle-middle.dir-ns {
    width: 18px;
    height: 10px;
    cursor: ns-resize;
}e(1.4); background: var(--primary-color); }

.waypoint-handle:hover {
    transform: translate(-50%, -50%) scale(1.3);
    background: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Home Presentation View (Zero Scrollbars, Expanded Hero Glass Card)
   -------------------------------------------------------------------------- */
.home-presentation-container {
    height: calc(100vh - 60px - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.home-hero-card.expanded-hero {
    flex: 1;
    height: 100%;
    background: radial-gradient(circle at 50% 45%, rgba(236, 72, 153, 0.18) 0%, rgba(99, 102, 241, 0.1) 45%, rgba(9, 13, 22, 0) 75%),
                linear-gradient(135deg, #090d16 0%, #0f172a 45%, #1e1b4b 100%);
    border-radius: var(--radius-lg);
    padding: 20px 40px 20px 40px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Desativar pseudo-elemento antes para eliminar qualquer risco/linha no fundo */
.home-hero-card.expanded-hero::before {
    display: none !important;
}

/* Wrapper do Logo com Flex 1 para Centralização Perfeita Vertical entre o topo e a barra de fluxo */
.hero-logo-wrapper {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Aura / Iluminação Orgânica Sem Bordas ou Riscos no Fundo do Logo */
.hero-logo-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5) 0%, rgba(168, 85, 247, 0.3) 40%, rgba(6, 182, 212, 0) 70%);
    animation: logoGlowPulse 4s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 1;
}

@keyframes logoGlowPulse {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.85);
        filter: blur(50px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.25);
        filter: blur(75px);
    }
}

/* Logo EVOFlow Aumentado (2x maior) com Animação Flutuante */
.hero-brand-logo {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 32px;
    user-select: none;
    animation: logoFloatMotion 3.6s ease-in-out infinite alternate;
}

@keyframes logoFloatMotion {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-14px) scale(1.02);
    }
}

/* Ícone do Logo Aumentado 2x Mais */
.hero-logo-icon {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    color: white;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    box-shadow: 0 20px 50px rgba(236, 72, 153, 0.55), 0 0 75px rgba(168, 85, 247, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.35);
}

/* Nome da Marca Aumentado 2x Mais */
.hero-brand-name {
    font-size: 130px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -4px;
    line-height: 1;
    text-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.hero-brand-sub {
    background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Barra com os Cards MANTIDA NA PARTE DE BAIXO (Inalterada) */
.home-hero-flow-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 24px 32px;
    border-radius: 24px;
    z-index: 2;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    margin-bottom: 10px;
}

.mini-flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: floatNode 3.2s ease-in-out infinite;
}

.mini-flow-node:nth-child(1) { animation-delay: 0s; }
.mini-flow-node:nth-child(3) { animation-delay: 0.8s; }
.mini-flow-node:nth-child(5) { animation-delay: 1.6s; }
.mini-flow-node:nth-child(7) { animation-delay: 2.4s; }

@keyframes floatNode {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.mini-flow-node:hover {
    transform: translateY(-8px) scale(1.1) !important;
    background: rgba(255, 255, 255, 0.2);
}

.mini-flow-node.start:hover { box-shadow: 0 12px 28px -4px rgba(52, 211, 153, 0.45); }
.mini-flow-node.ai:hover { box-shadow: 0 12px 28px -4px rgba(192, 132, 252, 0.45); }
.mini-flow-node.user:hover { box-shadow: 0 12px 28px -4px rgba(244, 114, 182, 0.45); }
.mini-flow-node.end:hover { box-shadow: 0 12px 28px -4px rgba(96, 165, 250, 0.45); }

.mini-flow-node:active {
    transform: scale(0.95) !important;
}

.mini-flow-node.start { border-color: #34d399; color: #34d399; }
.mini-flow-node.ai { border-color: #c084fc; color: #c084fc; }
.mini-flow-node.user { border-color: #f472b6; color: #f472b6; }
.mini-flow-node.end { border-color: #60a5fa; color: #60a5fa; }

.mini-flow-node i {
    font-size: 24px;
}

.mini-flow-arrow {
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    animation: flowPulse 2s linear infinite;
    position: relative;
}

@keyframes flowPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mini-flow-arrow::after {
    content: '';
    position: absolute;
    right: -2px;
    top: -4px;
    width: 0;
    height: 0;
    border-top: 5.5px solid transparent;
    border-bottom: 5.5px solid transparent;
    border-left: 8px solid #3b82f6;
}



