/* --- MODO DE ELIMINAÇÃO --- */
body.delete-mode-active .card { border-color: #e74c3c !important; }
body.delete-mode-active .card:hover { animation: shake 0.5s infinite; }
body.delete-mode-active .btn-delete-overlay { display: flex !important; }

@keyframes shake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(0.5deg); }
  75% { transform: rotate(-0.5deg); }
  100% { transform: rotate(0deg); }
}

.btn-delete-overlay {
    display: none; position: absolute; top: -8px; right: -8px; background: #e74c3c; color: white; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 50; border: 2px solid white;
}
.btn-delete-overlay:hover { background: #c0392b; transform: scale(1.1); }

.btn-toggle-delete {
    background: none; border: 1px solid #e74c3c; color: #e74c3c; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-toggle-delete.active { background: #e74c3c; color: white; }

.btn-export-handover {
    background: none; border: 1px solid #2ecc71; color: #2ecc71; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-export-handover:hover {
    background: #2ecc71; color: white;
}

.btn-export-xlsx {
    background: none; border: 1px solid #3498db; color: #3498db; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-export-xlsx:hover {
    background: #3498db; color: white;
}

/* --- CABEÇALHO DAS COLUNAS --- */
/* --- TÍTULO DAS COLUNAS (WORKFLOW) --- */
/* Nota: o estilo base do h3 vem do style_layout.css; aqui só afinamos para centrar e não “encolher” o header */

.col-header{
    display: flex;
    align-items: center;
    justify-content: center;   /* título centrado */
    padding: 10px;             /* igual ao respiro do follow-up */
    background: #dee2e6;
    border-radius: 6px 6px 0 0;
    position: relative;        /* para o botão absoluto */
}

.col-header h3{
    margin: 0;
    padding: 0 !important;     /* evita somar com o padding do layout */
    font-size: 0.75em;
    color: #495057;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
    flex: 1;                   /* ocupa espaço para permitir centrar */
    text-align: center;        /* CENTRADO */
}

/* botão não “empurra” o título */
.col-header .btn-collapse{
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}


/* Botão de Encolher */
.btn-collapse {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    color: #888;
    padding: 2px 5px;
    transition: color 0.2s;
}

.btn-collapse:hover { color: #333; }

/* --- ESTADO RECOLHIDO (COLLAPSED) --- */
.column-wrapper.collapsed {
    min-width: 40px !important;
    max-width: 40px !important;
    flex: 0 0 40px !important;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ced4da; /* Um pouco mais escuro para distinguir */
}

/* Esconde o conteúdo da coluna e o botão quando recolhido */
/* Esconde apenas o conteúdo (mantemos o botão visível para reabrir) */
.column-wrapper.collapsed .kanban-column {
    display: none;
}

/* Botão continua disponível no modo collapsed (mostra ➕) */
.column-wrapper.collapsed .btn-collapse {
    display: block;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9em;
    z-index: 2;
}

/* Roda o Título na vertical */
.column-wrapper.collapsed .col-header {
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.column-wrapper.collapsed h3 {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 10px 0;
    font-size: 0.85em;
    letter-spacing: 2px;
}

/* --- MODAL (BASE + CLOSE BUTTON) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 17, 23, 0.5);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: white; width: 500px; max-width: 90%;
    border-radius: var(--radius-modal, 10px); padding: 22px;
    box-shadow: var(--shadow-modal, 0 10px 25px rgba(0,0,0,0.3));
    display: flex; flex-direction: column; gap: 10px;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; color: #2c3e50; font-weight: 600; letter-spacing: -.15px; }
.modal-subtitle { font-size: 0.85em; color: var(--ink-soft, #7f8c8d); font-weight: 600; }

.detail-header-left {
    flex: 1;
    min-width: 0;
}
.detail-tree-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    flex-shrink: 0;
    margin: 0 12px;
}
.tree-mode-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}
.tree-mode-btn:hover:not(:disabled) {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.04);
}
.tree-mode-btn.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tree-mode-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tree-mode-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
}
.tree-mode-btn.active .tree-mode-badge {
    background: #0284c7;
    color: #ffffff;
}

.btn-modal-close {
    background: none; border: 1px solid #ddd; cursor: pointer;
    font-size: 16px; color: #888; padding: 4px 8px; border-radius: 7px;
    line-height: 1; flex-shrink: 0; transition: all 0.12s ease;
}
.btn-modal-close:hover { background: #f4f5f7; color: #333; border-color: #ccc; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }
.btn-save { background: #2ecc71; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.12s ease; }
.btn-save:hover { background: #27ae60; }
.btn-cancel { background: #e74c3c; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.12s ease; }
.btn-cancel:hover { background: #c0392b; }



/* --- DETAIL MODAL (árvore PR/SR/WO, 2 colunas) --- */
.detail-modal-box {
    width: 1230px;
    max-width: 95vw;
    height: 82vh;
    max-height: 850px;
    padding: 24px;
}

.detail-modal-body {
    flex: 1;
    display: flex;
    gap: 20px;
    min-height: 0;
}

.detail-tree-pane {
    flex: 0 0 44%;
    min-width: 420px;
    background: #12151c;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.detail-tree-col {
    --tree-indent: 22px;
    --tree-row-gap: 2px;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    padding: 16px 14px;
    position: relative;
    box-sizing: border-box;
}

.detail-tree-footer {
    padding: 10px 14px;
    background: #0d1017;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.detail-tree-footer .detail-tree-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: #1c212b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
    margin: 0;
}

.detail-tree-footer .tree-mode-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.detail-tree-footer .tree-mode-btn:hover:not(:disabled) {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.detail-tree-footer .tree-mode-btn.active {
    background: #2dd4bf;
    color: #0b1320;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.detail-tree-footer .tree-mode-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.detail-tree-footer .tree-mode-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-weight: 700;
}

.detail-tree-footer .tree-mode-btn.active .tree-mode-badge {
    background: #0f766e;
    color: #ffffff;
}

#detail-tree-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}
.detail-tree-connector {
    stroke: #14b8a6;
    stroke-width: 2;
    fill: none;
}
.detail-tree-connector-dot {
    fill: #2dd4bf;
}

#detail-tree-content { position: relative; z-index: 1; }

/* Estrutura genérica: qualquer nível (PR, SR, WO, ou futuro) usa exatamente as mesmas regras. */
.tree-node { position: relative; }

.tree-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.92em;
    line-height: 32px;
    margin-bottom: var(--tree-row-gap);
    background: transparent;
    color: #b7bdcb;
    transition: background 0.15s ease;
}
.tree-node-row.active { background: #1c212b; box-shadow: inset 3px 0 0 0 #2dd4bf; color: #fff; font-weight: bold; }

/* =========================================================
   1. ESTILO DO TÍTULO (Aumentar fonte e espaçamento)
   ========================================================= */
.tree-node-row.kind-pr.active, 
.tree-node-row.kind-pr:hover { 
    background: transparent !important; 
    box-shadow: none !important; 
}

.tree-node-row.kind-pr {
    font-weight: bold; 
    font-size: 1.4em;            /* <-- AQUI: Aumenta a fonte do título */
    margin-bottom: 28px;         /* <-- AQUI: Aumenta a distância para não sobrepor o 1º item */
    padding-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,.08); 
    color: #f3f4f6;
}

/* =========================================================
   2. AS SUAS ÚLTIMAS CORREÇÕES (Bracket e Setas)
   ========================================================= */
/* Corrige o Bracket: impede que a label do título estique até ao fim da linha */
.tree-node-row.kind-pr .tree-node-label {
    flex: initial !important; 
    padding-right: 4px; /* Pequeno respiro antes do bracket descer */
}

/* Setas da Árvore do Modal */
.modal-tree-arrow, .modal-tree-spacer {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62em;
    line-height: 1;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: #8890a3;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.15s ease;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}
.modal-tree-arrow:hover {
    background: transparent !important;
    color: #2dd4bf !important;
}
.modal-tree-arrow.open {
    transform: rotate(90deg);
}
.modal-tree-spacer {
    pointer-events: none;
    visibility: hidden;
}

.tree-node-row.kind-sr .tree-node-label { font-weight: 600; font-size: 1.04em; }
.tree-node-row.kind-wo { font-size: 0.9em; color: #9aa0ac; height: 32px; min-height: 32px; line-height: 32px; }
.tree-node-row.kind-wo:hover { color: #fff; }

.tree-node-row.kind-loc {
    font-size: 0.94em;
    color: #e2e8f0;
    font-weight: 600;
}
.tree-node-row.kind-loc:hover {
    background: rgba(56, 189, 248, 0.12);
}
.tree-node-row.kind-loc.active {
    background: #1c2533;
    box-shadow: inset 3px 0 0 0 #38bdf8;
    color: #fff;
    font-weight: bold;
}
.tree-loc-icon {
    font-size: 0.95em;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.tree-loc-title {
    color: #38bdf8;
    font-weight: 700;
}
.tree-loc-count {
    font-size: 0.78em;
    color: #94a3b8;
    font-weight: 500;
    margin-left: 2px;
}
.detail-header-loc {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.detail-node-loc-title {
    font-size: 1.1em;
    color: #0f172a;
}
.detail-loc-badge {
    display: inline-block;
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border: 1px solid rgba(2, 132, 199, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.76rem;
    font-weight: 600;
}

.tree-node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tree-node-meta { color: #6b7284; font-weight: 500; font-size: 0.88em; }

/* Indentação: uma única variável, aplicada em cada nível de aninhamento — cresce sozinha com a profundidade */
.tree-children {
    margin-left: var(--tree-indent);
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
}
.tree-children.always-open { max-height: none; overflow: visible; }
.tree-children.open { max-height: 2000px; }
.tree-children:not(.open):not(.always-open) { display: none !important; }

.detail-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.detail-info-header {
    font-size: 1.1em;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-info-section { display: flex; flex-direction: column; gap: 6px; }
.detail-notes-section, .detail-tasks-section { flex: 1; min-height: 0; display: flex; flex-direction: column; height: 100%; }
.detail-label { font-size: 0.82em; font-weight: bold; color: #7f8c8d; text-transform: uppercase; letter-spacing: 0.3px; }

#detail-followup-date {
    padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95em; width: 220px;
}

.detail-fu-row { flex-direction: row; align-items: flex-end; gap: 16px; }
.detail-fu-date-group { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.detail-fu-notes-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.fu-notes-inline {
    padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.92em;
    font-family: inherit; width: 100%; box-sizing: border-box;
}
.fu-notes-inline:focus { border-color: #3498db; outline: none; }

.notes-log-area {
    flex: 1;
    overflow-y: auto;
    min-height: 120px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
}

.notes-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 30px 10px;
}

.notes-stream-clean {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.notes-day-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.notes-day-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 2px 0;
}
.notes-day-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.notes-day-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.notes-day-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notes-line-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    transition: background 0.12s ease;
}
.notes-line-row:hover {
    background: #f8fafc;
}
.notes-bullet {
    color: #94a3b8;
    font-size: 1.1em;
    line-height: 1.3;
    user-select: none;
    flex-shrink: 0;
}
.note-line-origin {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.76em;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 1px;
}
.note-line-text {
    flex: 1;
    color: #1e293b;
    line-height: 1.45;
    word-break: break-word;
}
.notes-entry-delete {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}
.notes-line-row:hover .notes-entry-delete {
    opacity: 1;
}
.notes-entry-delete:hover {
    color: #ef4444;
    background: #fee2e2;
}

.notes-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    flex-shrink: 0;
}
.notes-inline-input {
    flex: 1;
    height: 36px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9em;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.notes-inline-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.notes-input-area .btn-save {
    white-space: nowrap;
    height: fit-content;
    align-self: flex-end;
}


/* --- SUMMARY MODAL --- */
.summary-modal-box {
    width: 780px;
    max-width: 94vw;
    max-height: 85vh;
}

.summary-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
    padding: 4px 0;
}

.summary-count {
    font-size: 0.85em;
    font-weight: 700;
    color: #555;
    padding: 6px 0 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.summary-col-header {
    font-size: 0.78em;
    font-weight: 900;
    text-transform: uppercase;
    color: #495057;
    background: #e9ecef;
    padding: 6px 10px;
    border-radius: 4px;
    margin: 12px 0 6px;
    letter-spacing: 0.5px;
}

.summary-row {
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
}
.summary-row:last-child { border-bottom: none; }

.summary-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-pr-id a {
    font-weight: 800;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.9em;
}
.summary-pr-id a:hover { color: var(--color-accept); }

.summary-pr-type {
    font-size: 0.7em;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 3px;
    color: white;
}
.type-badge-SIBS { background: var(--color-sibs); }
.type-badge-SCML { background: var(--color-scml); }
.type-badge-GERAL { background: var(--color-geral); }

.summary-pr-title {
    flex: 1;
    font-size: 0.88em;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.summary-fu-date {
    font-size: 0.78em;
    color: #e67e22;
    font-weight: 700;
    flex-shrink: 0;
}

.summary-notes {
    margin-top: 4px;
    padding-left: 12px;
    border-left: 2px solid #3498db;
}

.summary-notes-date {
    font-size: 0.75em;
    font-weight: 800;
    color: #888;
    display: block;
    margin-bottom: 2px;
}

.summary-note-text {
    font-size: 0.85em;
    color: #444;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.summary-fu-note {
    margin-top: 3px;
    padding-left: 12px;
    font-size: 0.82em;
    color: #7f8c8d;
    font-style: italic;
}


/* --- SUMMARY BUTTON (DROPDOWN) --- */
.btn-summary {
    background: none; border: 1px solid #8e44ad; color: #8e44ad; border-radius: 4px;
    padding: 5px 10px; cursor: pointer; font-weight: bold;
    display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-summary:hover {
    background: #8e44ad; color: white;
}

/* --- TRIGGER DAS NOTAS E BALÃO (TOOLTIP) --- */
.notes-trigger {
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    color: #3498db;
    position: relative;   /* base para o tooltip */
    margin-left: 0;
    display: inline-block;
}
.notes-trigger:hover { text-decoration: underline; }

/* O Balão de Texto (Tooltip CSS puro) */
.notes-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    right: 0;
    width: 250px;
    background: #333;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: normal;
    white-space: pre-wrap;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    pointer-events: none;
    text-align: left;
    line-height: 1.4;
}

/* Seta do balão */
.notes-trigger::before {
    content: '';
    position: absolute;
    bottom: 80%;
    right: 10px;
    border: 6px solid transparent;
    border-top-color: #333;
    display: none;
    z-index: 1000;
    pointer-events: none;
}



/*
  FIX: Tooltip do FU (fu_notes) centrado no card
  - o FU está em .card-actions-center
*/
.card-actions-center { position: relative; }

/* tooltip posiciona-se pelo container central em vez do próprio texto */
.card-actions-center .fu-notes-trigger { position: static; }

.card-actions-center .fu-notes-trigger::after,
.card-actions-center .fu-notes-trigger::before {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}




/* FOLLOW-UP: replicar config do texto do header (tamanho/alinhamento/cor) */
#board-followup .column-wrapper > h3 {
    margin: 0;
    padding: 10px;          /* dá o mesmo “respiro” do col-header do workflow */
    font-size: 0.75em;
    color: #495057;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
}


/* Título das colunas clicável para encolher/expandir */
.col-header h3{ cursor: pointer; }


/* --- PERFIS MODAL --- */
.profiles-modal-overlay{
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    /*backdrop-filter: blur(2px);*/
}

.profiles-modal-box{
    width: 860px;
    max-width: 92vw;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profiles-modal-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #fbfbfb;
}
.profiles-modal-header h3{ margin: 0; color: #2c3e50; font-size: 1.05em; }

.profiles-close{
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #888;
    padding: 6px 8px;
    border-radius: 6px;
}
.profiles-close:hover{ background: rgba(0,0,0,0.06); color:#333; }

.profiles-modal-body{
    display: flex;
    gap: 14px;
    padding: 14px;
}

.profiles-left{
    width: 46%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profiles-list-top{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.profiles-list-title{
    font-weight: 900;
    color: #34495e;
    font-size: 0.9em;
}
.profiles-search{
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.9em;
}
.profiles-search:focus{ outline: none; border-color: var(--color-accept); background: #fff; }

.profiles-list{
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: auto;
    max-height: 420px;
    background: #fff;
}

.profile-row{
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.profile-row:last-child{ border-bottom: none; }
.profile-row:hover{ background: #f7f7f7; }
.profile-row.selected{ background: #eef6ff; }
.profile-row .p-name{
    font-weight: 900;
    color: #2c3e50;
    display:flex;
    align-items:center;
    gap:8px;
}
.profile-row .p-badge{
    font-size: 0.72em;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e9ecef;
    color:#555;
}
.profile-row.active .p-badge{
    background: #2ecc71;
    color: #fff;
}
.profile-row .p-meta{
    font-size: 0.82em;
    color: #7f8c8d;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profiles-right{
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profiles-details{
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profiles-field{ display:flex; flex-direction:column; gap:4px; }
.profiles-label{ font-size: 0.8em; font-weight: 900; color:#555; text-transform: uppercase; letter-spacing: 0.5px; }
.profiles-value{ font-size: 0.95em; color:#2c3e50; }
.profiles-input{
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: #fafafa;
}
.profiles-input:disabled{ opacity: 0.7; cursor: not-allowed; }

.profiles-actions{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profiles-actions-row{
    display:flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-profiles,
.btn-profiles-primary,
.btn-profiles-danger{
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 800;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-profiles:hover{ background:#f7f7f7; }
.btn-profiles:disabled,
.btn-profiles-primary:disabled,
.btn-profiles-danger:disabled{
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-profiles-primary{
    border-color: var(--color-accept);
    color: var(--color-accept);
}
.btn-profiles-primary:hover{ background: var(--color-accept); color:#fff; }

.btn-profiles-danger{
    border-color: #e74c3c;
    color: #e74c3c;
}
.btn-profiles-danger:hover{ background:#e74c3c; color:#fff; }



/* Profiles modal hint (dynamic disabled reasons) */
.profiles-hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.35;
  min-height: 16px;
}

/* Profiles modal header layout (title left, actions right) */
.profiles-modal-header{
  justify-content: flex-start;
  gap: 10px;
}
.profiles-modal-header h3{
  flex: 1;
}


/* =========================
   TOAST NOTIFICATIONS
   ========================= */
#toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    color: #fff;
    background: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    max-width: 380px;
    word-break: break-word;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-info    { background: #2c3e50; }
.toast-success { background: #27ae60; }
.toast-warning { background: #e67e22; }
.toast-error   { background: #c0392b; }


/* =========================
   OPS LOG MODAL
   ========================= */
.opslog-modal-box {
    width: 820px;
    max-width: 94vw;
    max-height: 85vh;
}

.opslog-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-opslog-clear {
    background: none;
    border: 1px solid #ccc;
    color: #888;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
}
.btn-opslog-clear:hover { background: #f0f0f0; color: #333; }

.opslog-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
    padding: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.82em;
    background: #1e1e2e;
    border-radius: 6px;
    color: #cdd6f4;
}

.opslog-entry {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 10px;
    align-items: baseline;
    line-height: 1.4;
}
.opslog-entry:last-child { border-bottom: none; }

.opslog-ts {
    color: #6c7086;
    flex-shrink: 0;
    min-width: 95px;
}

.opslog-action {
    color: #89b4fa;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 160px;
}

.opslog-detail {
    color: #a6adc8;
    word-break: break-word;
}

/* Colorir por tipo de resultado */
.opslog-detail:empty { display: none; }

/* --- OPS LOG BUTTON (DROPDOWN) --- */
.btn-opslog {
    background: none; border: 1px solid #7f8c8d; color: #7f8c8d; border-radius: 4px;
    padding: 5px 10px; cursor: pointer; font-weight: bold;
    display: flex; align-items: center; gap: 5px; transition: all 0.2s;
}
.btn-opslog:hover {
    background: #7f8c8d; color: white;
}


/* =========================
   PROFILES INBOX BADGES
   ========================= */
/* Badge no botão de perfil (top bar) */
.profiles-inbox-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.72em;
    font-weight: 800;
    line-height: 1;
    margin-left: 4px;
}

/* Badge no modal de perfis (junto ao nome) */
.p-inbox-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.72em;
    font-weight: 800;
    line-height: 1;
    margin-left: auto;
}


/* =========================
   COLLAPSED COLUMN UPDATE GLOW
   ========================= */
.column-wrapper.collapsed.collapsed-has-update {
    animation: collapsed-col-glow 1.5s infinite ease-in-out;
    border: 2px solid rgba(230, 126, 34, 0.6);
}

@keyframes collapsed-col-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.3);
    }
    50% {
        box-shadow: 0 0 12px 3px rgba(230, 126, 34, 0.7);
    }
}

.column-wrapper.collapsed.collapsed-has-red {
    animation: collapsed-col-glow-red 2.2s infinite ease-in-out;
    border: 2px solid rgba(220, 60, 60, 0.6);
}

@keyframes collapsed-col-glow-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 50, 50, 0);
    }
    50% {
        box-shadow: 0 0 12px 3px rgba(220, 50, 50, 0.6);
    }
}

/* === ORELHAS DE VISTA (Inbox / To-do / Follow-up) ===
   Bloco único e contínuo: sem gaps nem curvas decorativas entre elas
   (essas curvas foram desenhadas para UMA orelha isolada; em grupo colidiam). */
.sidebar-handle.handle-tab {
    top: 300px;
    height: 80px;
    gap: 0;
    border-radius: 0;
}
.sidebar-handle.handle-tab::before,
.sidebar-handle.handle-tab::after {
    content: none; /* remove a curva decorativa individual */
}
.sidebar-handle.handle-tab:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
#tab-inbox { border-radius: 15px 0 0 0; }
#tab-todo { top: 380px; }
#tab-fulist.handle-tab-fu { top: 460px; height: 110px; border-radius: 0 0 0 15px; }

.sidebar.collapsed #tab-inbox { border-radius: 0 15px 0 0; }
.sidebar.collapsed #tab-fulist.handle-tab-fu { border-radius: 0 0 15px 0; }
.sidebar.collapsed #tab-todo { border-radius: 0; }

.handle-vtext {
    writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
    letter-spacing: 2px; text-transform: uppercase; font-size: 0.72em; white-space: nowrap;
}
.sidebar-handle.handle-tab.tab-active {
    background: #34495e;
    color: white;
    box-shadow: inset 3px 0 0 0 #3498db;
}
.sidebar.collapsed .sidebar-handle.handle-tab.tab-active {
    box-shadow: inset -3px 0 0 0 #3498db, 4px 0 8px rgba(0,0,0,0.15);
}
/* Alarme nas orelhas: glow vermelho pulsante (replica o has-alarm do topo) */
@keyframes tab-neon-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50%      { box-shadow: 0 0 10px 2px rgba(231, 76, 60, 0.85); }
}
.sidebar-handle.handle-tab.tab-alert {
    animation: tab-neon-pulse 1.2s infinite ease-in-out;
    z-index: 2; /* garante que o glow não fica tapado pelo separador da orelha vizinha */
}
.sidebar-handle.handle-tab.tab-alert .handle-vtext { color: #ff8c7a; }
.sidebar-handle.handle-tab.blink-alert .handle-vtext { animation: blink-text 1.5s infinite; }

/* Badge de contagem na orelha Inbox: canto superior, fora da coluna de texto centrado */
.sidebar-handle.handle-tab .handle-badge {
    top: 4px;
    left: auto;
    right: 3px;
    transform: none;
    font-size: 0.68em;
    padding: 1px 4px;
}

/* === MODAL TO-DO === */
#sview-todo {
    flex: 1; display: flex; flex-direction: column; gap: 8px;
    padding: 8px; min-height: 0;
}
.todo-list {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px; min-height: 0;
}
.todo-item {
    display: flex; align-items: flex-start; gap: 8px;
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 7px;
    padding: 8px 10px; font-size: 0.9em; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    user-select: none;
    cursor: grab;
}
.todo-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.todo-item:active {
    cursor: grabbing;
}
.todo-item.completed {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: 0.7;
}
.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #94a3b8;
}
.todo-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #3b82f6;
    margin-top: 2px;
    flex-shrink: 0;
}
.todo-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: grab;
}
.todo-item:active .todo-body {
    cursor: grabbing;
}
.todo-item-project .todo-body {
    cursor: pointer;
}
.todo-origin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: fit-content;
    transition: all 0.15s ease;
}
.todo-badge-pr {
    font-weight: 700;
}
.todo-item:hover .todo-origin-badge {
    background: rgba(2, 132, 199, 0.14);
    color: #0369a1;
}
.todo-badge-title {
    color: #64748b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todo-text {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1e293b;
    line-height: 1.35;
    font-size: 0.92em;
}
.todo-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}
.todo-date { color: #94a3b8; font-weight: 600; white-space: nowrap; font-size: 0.85em; }
.todo-remove {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    font-size: 14px; font-weight: 700; padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
    margin-top: 0px; opacity: 0.75; transition: all 0.15s ease;
}
.todo-item:hover .todo-remove { opacity: 1; }
.todo-remove:hover { color: #ef4444; background: #fee2e2; opacity: 1; }
.todo-sortable-ghost {
    opacity: 0.35;
    background: #e0f2fe !important;
    border: 1px dashed #38bdf8 !important;
}
.todo-sortable-chosen {
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.todo-input-area { display: flex; gap: 8px; align-items: flex-end; }
.todo-input-area textarea {
    flex: 1; resize: vertical; border: 1px solid #ccc; border-radius: 6px;
    padding: 7px 10px; font-family: inherit; font-size: 0.9em;
}
.btn-todo-add {
    background: #3498db; border: none; border-radius: 6px; color: white;
    font-weight: 600; padding: 8px 16px; cursor: pointer;
}
.btn-todo-add:hover { background: #2980b9; }
.panel-empty { color: #999; font-style: italic; padding: 8px 2px; font-size: 0.9em; }

/* === MODAL FOLLOW-UPS === */
.fulist-content {
    flex: 1; overflow-y: auto; padding: 8px;
    display: flex; flex-direction: column; gap: 10px; min-height: 0;
}
.fulist-head { flex-wrap: wrap; }
.fulist-item {
    background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 7px;
    padding: 9px 12px; display: flex; flex-direction: column; gap: 6px;
}
.fulist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fulist-id {
    color: #2980b9; font-weight: 700; text-decoration: none; white-space: nowrap;
    font-size: 0.78em; background: #eaf2f8; border-radius: 4px; padding: 2px 6px;
}
.fulist-id:hover { text-decoration: underline; }
.fulist-title {
    font-size: 0.9em; color: #2c3e50; font-weight: 600;
    white-space: normal; word-break: break-word; line-height: 1.3;
}
.fulist-parent { color: #7f8c8d; font-weight: 500; font-size: 0.92em; }
.fulist-notes {
    resize: vertical; border: 1px solid #ddd; border-radius: 6px;
    padding: 6px 9px; font-family: inherit; font-size: 0.85em; color: #333;
    background: white; box-sizing: border-box; width: 100%;
}


/* webGP v3.0.3: modal consolidado */
.detail-modal-box{width:min(1320px,96vw);max-width:1320px}.detail-tree-pane{flex:0 0 44%;min-width:420px}.detail-tree-col{flex:1 1 auto;width:100%}.detail-info-col{flex:1 1 56%}
.detail-tabs{display:flex;gap:4px;border-bottom:1px solid #dfe3e8}.detail-tab{border:0;background:transparent;padding:9px 14px;cursor:pointer;color:#68707c;font-weight:600;border-bottom:3px solid transparent}.detail-tab.active{color:#1769aa;border-bottom-color:#3498db}.detail-tab-panel{display:none;min-height:0;flex:1;overflow:auto}.detail-tab-panel.active{display:flex;flex-direction:column}
.detail-scope-text{width:100%;min-height:240px;resize:vertical;box-sizing:border-box;padding:12px;border:1px solid #d7dce2;border-radius:8px;font:inherit;line-height:1.45}.detail-save-state{min-height:18px;margin-top:5px;font-size:.78rem;color:#77808c}
.tree-node-row{font-size:.86em;height:32px!important;min-height:32px!important;line-height:32px!important;box-sizing:border-box!important;padding:0 8px!important}.tree-node-row.active{font-weight:800;transform:none}.tree-node-row.kind-pr,.tree-node-row.kind-pr.active,.tree-node-row.kind-pr:hover{height:auto!important;min-height:auto!important;line-height:normal!important;font-size:1.06em!important;font-weight:700!important;margin-bottom:18px!important;padding:10px 10px!important;border-bottom:1px solid rgba(255,255,255,0.08)!important;background:transparent!important;box-shadow:none!important;transform:none!important;cursor:default!important}.tree-node-row.kind-pr .tree-node-label{flex:1!important;padding-right:0!important}.tree-entity-id{font-weight:700}.tree-entity-type{color:#77808c}.tree-node-row.entity-terminal{opacity:.48;filter:grayscale(.65);text-decoration:line-through}.tree-node-row.entity-terminal *{text-decoration:line-through}
.detail-external-status{display:inline-block;margin-left:10px;color:#77808c;font-size:.82em;font-weight:700}.detail-status-row{display:flex;align-items:center;gap:8px;margin-top:6px}.detail-status-select{padding:5px 8px;border:1px solid #ccd3dc;border-radius:6px}.detail-status-select:disabled{opacity:.55;cursor:not-allowed;background:#eceff2}
/* Estilos da Lista de Tarefas / Fluxo */
#detail-tab-tasks, #detail-tab-notes {
    overflow: hidden;
}
#detail-tasks-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}
.tasks-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: #495057;
}
.tasks-list-clean {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}
.tasks-empty {
    padding: 24px;
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    font-size: 0.9em;
}
.flow-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
    position: relative;
    border-bottom: 1px solid #f0f2f5;
}
.flow-item-row:hover {
    background: #f8f9fa;
}
.flow-item-row.completed {
    opacity: 0.6;
}
.flow-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.flow-bullet {
    width: 16px;
    text-align: center;
    font-size: 0.85em;
    color: #7f8c8d;
    flex-shrink: 0;
}
.flow-text {
    flex: 1;
    font-size: 0.92em;
    color: #2c3e50;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}
.flow-text.completed {
    text-decoration: line-through;
    color: #7f8c8d;
}
.flow-edit-row {
    display: flex;
    flex: 1;
    gap: 6px;
    align-items: center;
}
.flow-edit-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #3498db;
    border-radius: 4px;
    font-size: 0.9em;
}
.flow-btn-mini {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
}
.flow-btn-mini.save {
    background: #3498db;
    color: white;
}
.flow-btn-mini.cancel {
    background: #e0e0e0;
    color: #333;
}
.flow-pin-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.3;
    transition: all 0.15s ease;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 2px;
}
.flow-item-row:hover .flow-pin-btn {
    opacity: 0.7;
}
.flow-pin-btn:hover {
    opacity: 1 !important;
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.05);
}
.flow-pin-btn.pinned {
    opacity: 1 !important;
    filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.4));
}
.flow-menu-container {
    position: relative;
    flex-shrink: 0;
}
.flow-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #95a5a6;
    font-size: 1.1em;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.flow-item-row:hover .flow-menu-btn {
    color: #2c3e50;
}
.flow-menu-btn:hover {
    background: #e9ecef;
}
.flow-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    border: 1px solid #e1e5ea;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 175px;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.flow-menu-dropdown button {
    background: transparent;
    border: none;
    padding: 7px 12px;
    text-align: left;
    font-size: 0.85em;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.flow-menu-dropdown button:hover {
    background: #f1f3f5;
}
.flow-menu-dropdown button.danger {
    color: #e74c3c;
}
.flow-menu-dropdown button.danger:hover {
    background: #fdf2f2;
}

/* Painel inferior de Inserção Orgânico (No fundo do modal) */
.flow-add-bar-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: auto;
    flex-shrink: 0;
}
.flow-radio-group {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.flow-radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #64748b;
    user-select: none;
    position: relative;
    transition: color 0.15s ease;
}
.flow-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}
.flow-radio-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
    background: #fff;
    flex-shrink: 0;
}
.flow-radio-item input[type="radio"]:checked + .flow-radio-circle {
    border-color: #3498db;
}
.flow-radio-item input[type="radio"]:checked + .flow-radio-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3498db;
}
.flow-radio-item:hover .flow-radio-circle {
    border-color: #3498db;
}
.flow-radio-item.active {
    color: #0f172a;
}
.flow-input-inline {
    flex: 1;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9em;
    resize: none;
    line-height: 20px;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow-y: hidden;
}
.flow-input-inline:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
.flow-btn-inline {
    padding: 0 16px;
    height: 36px;
    font-weight: 600;
    flex-shrink: 0;
}
@media(max-width:950px){.detail-modal-body{flex-direction:column}.detail-tree-pane{flex:0 0 auto;min-width:0;width:100%;max-height:45vh}.detail-tree-col{flex:1 1 auto;min-width:0;width:100%}}

/* Modais auxiliares: Logs, Arquivo e Criar Perfil */
.modal-overlay-custom {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}
.modal-overlay-custom.high-z {
    z-index: 2600;
}
.modal-box-clean {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.logs-modal-box {
    width: 860px;
    max-width: 95vw;
    height: 85vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
}
.archive-modal-box {
    width: 860px;
    max-width: 95vw;
    height: 85vh;
    max-height: 850px;
    display: flex;
    flex-direction: column;
}
.archive-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.archive-count-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}
.archive-search-bar {
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}
.archive-search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}
.archive-search-icon {
    position: absolute;
    left: 10px;
    pointer-events: none;
    font-size: 14px;
    color: #94a3b8;
}
.archive-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 30px 8px 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.88rem;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: all 0.15s ease;
}
.archive-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.btn-archive-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s ease;
}
.btn-archive-clear:hover {
    color: #ef4444;
    background: #fee2e2;
}
.archive-filter-stats {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}
.create-profile-modal-box {
    width: 420px;
    max-width: 95vw;
}
.modal-header-clean {
    padding: 14px 18px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header-clean .title {
    font-weight: 700;
    font-size: 1.05em;
    color: #2c3e50;
}
.logs-diagnostic-card {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fafafa;
}
.diag-banner {
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.diag-banner.diag-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.diag-banner.diag-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
}
.diag-banner.diag-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.diag-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.diag-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.diag-headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.diag-headline strong {
    font-size: 1.02rem;
}
.diag-banner.diag-error .diag-headline strong {
    color: #991b1b;
}
.diag-banner.diag-warning .diag-headline strong {
    color: #92400e;
}
.diag-banner.diag-ok .diag-headline strong {
    color: #166534;
}
.diag-time {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}
.diag-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
}
.diag-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.diag-label {
    font-weight: 700;
    color: #475569;
    min-width: 140px;
    flex-shrink: 0;
}
.diag-val {
    color: #1e293b;
    flex: 1;
    word-break: break-word;
}
.diag-phase {
    font-weight: 700;
    color: #b91c1c;
}
.diag-reason {
    font-weight: 600;
    color: #dc2626;
}
.diag-snippet-toggle {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0 0 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}
.diag-snippet-toggle:hover {
    text-decoration: underline;
}
.diag-snippet-box {
    margin-top: 6px;
    background: #0f172a;
    border-radius: 6px;
    padding: 10px 12px;
    overflow-x: auto;
}
.diag-snippet-label {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
}
.diag-snippet-code {
    margin: 0;
    color: #fca5a5;
    font-family: Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}
.logs-raw-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.logs-raw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
}
.logs-raw-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.logs-file-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.log-file-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.log-file-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.log-file-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}
.logs-pre {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 14px 18px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    background: #f8fafc;
    min-height: 0;
}
.archive-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.archive-entry {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.archive-entry:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
.arc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.arc-id {
    color: #0284c7;
    font-weight: 700;
    font-size: 0.95em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.arc-id:hover {
    text-decoration: underline;
    color: #0369a1;
}
.arc-type {
    font-size: 0.72em;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.arc-status {
    font-size: 0.74em;
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 4px;
    color: #334155;
    font-weight: 700;
}
.arc-status.closed {
    background: #dcfce7;
    color: #166534;
}
.arc-status.canceled {
    background: #fee2e2;
    color: #991b1b;
}
.arc-dates {
    font-size: 0.78em;
    color: #64748b;
    margin-left: auto;
    font-weight: 500;
}
.arc-title {
    font-size: 0.92em;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}
.arc-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.76em;
    color: #64748b;
}
.arc-meta-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.arc-match-tag {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.arc-note-box {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-left: 3px solid #38bdf8;
    border-radius: 0 6px 6px 0;
    font-size: 0.84em;
    color: #334155;
    line-height: 1.4;
}
.arc-note-box .arc-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78em;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 3px;
}
.arc-note-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.arc-expand-btn {
    background: none;
    border: none;
    color: #0284c7;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 0 0 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.arc-expand-btn:hover {
    text-decoration: underline;
    color: #0369a1;
}
.arc-all-notes {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #f1f5f9;
    border-radius: 6px;
}
.arc-note-line {
    font-size: 0.82em;
    color: #1e293b;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 4px;
}
.arc-note-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.arc-note-line-date {
    font-weight: 700;
    color: #64748b;
    margin-right: 6px;
}
.archive-empty {
    text-align: center;
    padding: 40px 14px;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.95em;
}
.arc-highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 0 2px;
    border-radius: 2px;
}
.profile-form-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.profile-form-label {
    font-size: 0.85em;
    opacity: 0.7;
    display: block;
    margin-bottom: 5px;
}
.profile-form-input {
    width: 100%;
    box-sizing: border-box;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 9px 12px;
    color: #333;
    font-size: 0.95em;
}
.profile-form-status {
    font-size: 0.83em;
    min-height: 18px;
    color: #2980b9;
}
.profile-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-secondary-flat {
    background: #f0f2f5;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 18px;
    color: #555;
    cursor: pointer;
}
.btn-primary-flat {
    background: #3498db;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   ANEXOS DE PROJETO (MODAL DETALHE)
   ========================================================================== */
.detail-tab-count {
    background: #2563eb;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 5px;
    display: inline-block;
    line-height: 1.2;
}

.attachments-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 10px 0;
}

.attachments-archive-banner {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.archive-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.archive-banner-info {
    flex: 1;
    min-width: 0;
}
.archive-banner-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #92400e;
}
.archive-banner-subtitle {
    font-size: 0.78rem;
    color: #b45309;
    margin-top: 2px;
}
.btn-open-zip {
    background: #d97706;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.btn-open-zip:hover {
    background: #b45309;
}

.attachments-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 18px 14px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}
.attachments-dropzone:hover,
.attachments-dropzone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}
.attachments-dropzone .dropzone-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
    line-height: 1;
}
.attachments-dropzone .dropzone-text {
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 2px;
}
.attachments-dropzone .dropzone-browse {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.attachments-dropzone .dropzone-sub {
    font-size: 0.76rem;
    color: #94a3b8;
}

.attachments-upload-status {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.84rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-spinner {
    animation: spin-att 1.2s infinite linear;
}
@keyframes spin-att {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.attachments-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 4px 2px;
    border-bottom: 1px solid #e2e8f0;
}
.attachments-list-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-open-folder {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.76rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-open-folder:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 2px;
}
.attachment-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.attachment-item-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.attachment-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}
.attachment-name-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.attachment-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-item-row:hover .attachment-name {
    color: #2563eb;
}
.attachment-meta {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 1px;
}
.attachment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.attachment-action-btn {
    background: none;
    border: none;
    padding: 5px 7px;
    cursor: pointer;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.15s ease;
}
.attachment-action-btn.btn-delete:hover {
    color: #ef4444;
    background: #fee2e2;
}
.btn-arc-open-zip {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #92400e;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.15s ease;
}
.btn-arc-open-zip:hover {
    background: #fde68a;
    color: #78350f;
}

.attachments-empty {
    padding: 24px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.86rem;
    font-style: italic;
}
