/* === Variáveis de Cores === */
:root {
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #dcdde1;

    --blue: #3498db;
    --blue-hover: #2980b9;
    --blue-light: #74b9ff;
    --green: #2ecc71;
    --green-hover: #27ae60;
    --yellow: #ffeb3b;
    --red: #e74c3c;
    --critical: #8e44ad;
    --gray: #95a5a6;
    --black: #1e272e;
    --dark-orange: #d35400;
    --dark-orange-hover: #b84a00;
}

/* === Reset e Base === */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-dark); line-height: 1.6; padding: 12px 16px; height: 100vh; overflow: hidden; box-sizing: border-box; }
.container { max-width: 100%; margin: 0 auto; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.hidden { display: none !important; }

h1, h2, h3 { color: var(--text-dark); }

/* === Botões Gerais === */
button { cursor: pointer; border: none; border-radius: 6px; padding: 10px 20px; font-weight: bold; transition: 0.3s; }
.btn-primary { background-color: var(--blue); color: var(--white); }
.btn-primary:hover { background-color: var(--blue-hover); }
.btn-success { background-color: var(--green); color: var(--white); }
.btn-success:hover { background-color: var(--green-hover); }
.btn-warning { background-color: var(--yellow); color: var(--text-dark); }
.btn-warning:hover { background-color: #e2b607; }
.btn-secondary { background-color: var(--border-color); color: var(--text-dark); }
.btn-secondary:hover { background-color: #c8d6e5; }
.btn-danger { background-color: var(--red); color: var(--white); padding: 6px 12px; font-size: 12px; }
.btn-edit { background-color: var(--blue); color: var(--white); padding: 6px 12px; font-size: 12px; }

/* === Header e Dashboard === */
.header { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; flex-wrap: wrap; gap: 15px;}
.header-actions { display: flex; gap: 10px; align-items: center; }
.db-status { font-size: 12px; padding: 6px 12px; border-radius: 20px; font-weight: bold; background: #eee; border: 1px solid #ccc; color: #555; }
.db-linked { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
#op-cards-container.grid { grid-template-columns: repeat(auto-fill, minmax(352px, 1fr)); }
.card { background-color: var(--white); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; flex-direction: column; position: relative; }
.card-status-indicator { display: none; }
.card-status-pill { position: absolute; top: 16px; right: 14px; padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.18); z-index: 2; }
.card-title { font-size: 18px; margin-bottom: 10px; color: var(--blue); padding-right: 20px; padding-left: 50px; }
.op-card-title { font-size: 22px; font-weight: 900; color: var(--blue); letter-spacing: 0.3px; padding-right: 110px; padding-left: 62px; margin-bottom: 14px; margin-top: 2px; line-height: 1.25; min-height: 28px; display: block; overflow-wrap: break-word; word-break: break-word; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
.card-seq-id { position: absolute; top: 14px; left: 14px; background: linear-gradient(135deg, #2c3e50, #34495e); color: #fff; font-size: 15px; font-weight: 900; padding: 5px 11px; border-radius: 8px; letter-spacing: 1.5px; z-index: 2; box-shadow: 0 3px 8px rgba(44,62,80,0.35); font-family: 'Courier New', monospace; min-width: 38px; text-align: center; }
.card-summary { font-size: 14px; color: var(--text-light); flex-grow: 1; margin-bottom: 20px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-actions { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border-color); padding-top: 15px; }

/* === Formulário Base === */
.form-container { background-color: var(--white); border-radius: 8px; padding: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 14px; }
.form-control { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; }

/* === Farol de Status === */
.title-status-row { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.title-col { flex: 2; min-width: 300px; }
.status-col { flex: 1; min-width: 200px; }
.justificativa-col { flex: 2; min-width: 300px; display: none; }
.justificativa-col.show { display: block; }

.farol-container { display: flex; gap: 8px; margin-top: 5px; align-items: center; }
.farol-btn { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: width 0.2s, height 0.2s, opacity 0.2s; opacity: 0.45; flex-shrink: 0; }
.farol-btn:hover { opacity: 0.75; }
.farol-btn.active { width: 21px; height: 21px; opacity: 1; border-color: #2c3e50; box-shadow: 0 0 6px rgba(0,0,0,0.3); }

.bg-cinza   { background-color: var(--gray); }
.bg-verde   { background-color: var(--green); }
.bg-amarelo { background-color: var(--yellow); }
.bg-vermelho{ background-color: var(--red); }
.bg-critico { background-color: var(--critical); }

/* === Abas === */
.tabs { display: flex; border-bottom: 3px solid var(--black); margin-bottom: 20px; gap: 5px; flex-wrap: wrap; }
.tab-btn { background-color: #f1f2f6; border: 1px solid transparent; padding: 10px 15px; font-size: 13px; font-weight: bold; color: var(--text-light); border-radius: 6px 6px 0 0; margin-bottom: -3px; border-bottom: 3px solid transparent; transition: 0.2s; }
.tab-btn:hover { background-color: #e4e7eb; }
.tab-btn.active { background-color: var(--black); color: var(--white); border-color: var(--black); border-bottom-color: var(--black); }

.tab-star { background-color: var(--dark-orange); color: var(--white); }
.tab-star:hover { background-color: var(--dark-orange-hover); color: var(--white); }
.tab-star.active { background-color: var(--black); color: var(--white); }
.star-letter { font-size: 1.4em; color: var(--white); font-weight: 900; margin-right: 2px; line-height: 1; transition: color 0.2s; }
.tab-star.active .star-letter { color: var(--blue-light); }
textarea.form-control { min-height: 400px; resize: vertical; }

/* === Rich Text Editor (contenteditable + toolbar) === */
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 5px 6px; background: #f4f6f8; border: 1px solid var(--border-color); border-bottom: none; border-radius: 6px 6px 0 0; align-items: center; }
.rich-toolbar button, .rich-toolbar select { font-size: 12px; padding: 4px 9px; background: #fff; border: 1px solid var(--border-color); border-radius: 4px; cursor: pointer; color: #2c3e50; line-height: 1.1; }
.rich-toolbar button:hover, .rich-toolbar select:hover { background: #ecf0f1; border-color: #bdc3c7; }
.rich-toolbar button:active { background: #d6eaf8; }
.rich-toolbar input[type="color"] { width: 28px; height: 26px; padding: 2px; cursor: pointer; border: 1px solid var(--border-color); border-radius: 4px; background: #fff; }
.rich-editor { min-height: 110px; max-height: 320px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 0 0 6px 6px; background: #fff; font-size: 13px; line-height: 1.6; color: #2c3e50; }
.rich-editor:focus { outline: 2px solid rgba(52,152,219,.3); border-color: #3498db; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #95a5a6; pointer-events: none; font-style: italic; }
.rich-editor ul, .rich-editor ol { margin: 6px 0 6px 22px; padding: 0; }
.rich-editor p { margin: 4px 0; }
.rich-editor img { max-width: 100%; height: auto; }

/* === Kanban Form === */
.kanban-form { background-color: #f8f9fa; padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); margin-bottom: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: start; }

/* === Kanban Board === */
.kanban-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 15px; min-height: 350px; }
.kanban-col { flex: 1; min-width: 200px; background-color: #f1f2f6; border-radius: 8px; display: flex; flex-direction: column; }
.kanban-col-header { padding: 10px; font-weight: bold; text-align: center; border-bottom: 2px solid var(--border-color); background-color: #dfe4ea; border-radius: 8px 8px 0 0; font-size: 14px; line-height: 1.3; }
.kanban-col-body { padding: 10px; flex-grow: 1; min-height: 200px; }

.kanban-card { background-color: var(--white); border: 1px solid var(--border-color); border-radius: 6px; padding: 12px 12px 12px 12px; margin-bottom: 10px; cursor: grab; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; max-width: 100%; position: relative; }
.kanban-card:active { cursor: grabbing; }
/* Card-top reserva espaço à direita pro indicator-wrapper absoluto (105px = max-width do indicator + gap) */
.kanban-card-top { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 8px; max-width: 100%; padding-right: 105px; }
.kanban-card-top h4 { flex: 1 1 auto; min-width: 0; font-size: 14px; margin: 0; color: var(--blue); line-height: 1.3; overflow-wrap: break-word; word-break: break-word; }
.k-seq-id { font-size: 10px; font-weight: 800; color: #7f8c8d; background: #f1f2f6; border-radius: 4px; padding: 2px 5px; flex-shrink: 0; line-height: 1.4; margin-top: 1px; }
.kanban-card-content { flex-grow: 1; min-width: 0; overflow: hidden; }
.kanban-card h4 { font-size: 14px; margin-bottom: 5px; color: var(--blue); }
.kanban-card p { font-size: 12px; margin-bottom: 3px; color: var(--text-light); overflow-wrap: break-word; word-break: break-word; }
.k-badge { display: inline-block; padding: 2px 6px; background-color: #e0e0e0; border-radius: 4px; font-size: 11px; margin-right: 5px; color: #333;}

.kanban-card-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-color); }
.k-btn-action { font-size: 11px; font-weight: bold; cursor: pointer; transition: color 0.2s; }
.k-btn-action:hover { text-decoration: underline; }
.k-btn-view { color: var(--green); }
.k-btn-edit { color: var(--blue); }
.k-btn-delete { color: var(--red); }

/* Indicadores na Task */
/* Indicator pinned absoluto no canto superior direito do card */
.indicator-wrapper { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 100px; z-index: 2; pointer-events: none; }
.indicator-wrapper > * { pointer-events: auto; }
.indicator-text { font-size: 10px; font-weight: bold; white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; background: rgba(255,255,255,0.9); padding: 1px 5px; border-radius: 3px; }
.text-red { color: var(--red); }
.text-gray { color: #95a5a6; }
.task-indicator { width: 12px; height: 12px; border-radius: 50%; }
.task-indicator.gray { background-color: #bdc3c7; }
.task-indicator.red { background-color: var(--red); box-shadow: 0 0 6px var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); } }

/* === Diagrama de Gantt === */
.gantt-wrapper { margin-top: 30px; border-top: 2px solid var(--border-color); padding-top: 20px; }
.gantt-header-row { display: flex; align-items: center; gap: 20px; margin-bottom: 15px; flex-wrap: wrap; }
.gantt-title { font-size: 18px; color: var(--blue); margin: 0; }
.gantt-view-controls { display: flex; gap: 5px; background: #e0e6ed; padding: 4px; border-radius: 6px; }
.gantt-btn { padding: 4px 12px; font-size: 12px; border: none; background: transparent; cursor: pointer; border-radius: 4px; color: var(--text-dark); transition: 0.2s; font-weight: bold;}
.gantt-btn:hover { background: #ced6e0; }
.gantt-btn.active { background: var(--blue); color: var(--white); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.gantt-container { background: var(--white); border: 1px solid var(--border-color); border-radius: 8px; overflow-x: auto; padding-bottom: 10px; position: relative; }
.gantt-grid { display: grid; min-width: 800px; transition: 0.3s; }
.gantt-header-cell { background: #f1f2f6; padding: 4px 1px; font-size: 11px; text-align: center; border-bottom: 2px solid var(--border-color); border-right: 1px solid #e1e2e6; font-weight: bold; color: var(--text-light); overflow: hidden; white-space: nowrap; }
.gantt-weekend { background: #e8eaef; color: #95a5a6; }
.gantt-task-name { padding: 8px 10px; font-size: 12px; font-weight: 500; border-right: 2px solid var(--border-color); border-bottom: 1px solid #f9f9f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; background: #fff; position: sticky; left: 0; z-index: 12; box-shadow: 2px 0 4px rgba(0,0,0,0.06); }
.gantt-bar-container { border-bottom: 1px solid #f9f9f9; padding: 4px 0; display: flex; align-items: center; }
.gantt-bar { height: 22px; border-radius: 4px; width: 100%; min-width: 5px; color: #fff; font-size: 10px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,0.2); position: relative; }
.gantt-bar-baseline { height: 6px; width: 100%; min-width: 3px; background: repeating-linear-gradient(45deg, #7f8c8d, #7f8c8d 4px, transparent 4px, transparent 8px); border: 1.5px dashed #2c3e50; border-radius: 3px; opacity: 0.65; margin-top: 2px; }
.gantt-bar-progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.30); border-right: 2px solid rgba(255,255,255,0.7); pointer-events: none; }
.gantt-bar-text { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-bar-pct { position: relative; z-index: 1; margin-left: auto; padding-left: 6px; font-weight: 800; font-size: 9px; opacity: 0.95; }

/* === Progresso chips === */
.progresso-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 0; }
.progresso-step-btn { padding: 4px 10px; font-size: 14px; font-weight: 800; min-width: 32px; }
.progresso-chip { padding: 4px 12px; border-radius: 14px; border: 1.5px solid #ddd; background: #fff; color: #7f8c8d; font-size: 11px; font-weight: 700; cursor: pointer; user-select: none; transition: all 0.15s; }
.progresso-chip:hover { border-color: #3498db; color: #3498db; }
.progresso-chip.active { background: #3498db; border-color: #3498db; color: #fff; }
.k-prog-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #ecf0f1; color: #2c3e50; font-size: 10px; font-weight: 800; border: 1px solid #d5dbde; margin-left: 6px; vertical-align: middle; }
.k-prog-chip[data-pct="100"] { background: #d4efdf; color: #1e8449; border-color: #abebc6; }
.k-prog-chip[data-pct="0"]   { background: #f4f6f7; color: #7f8c8d; }

/* === WBS canvas === */
.wbs-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wbs-toolbar .wbs-help { font-size: 11px; color: #7f8c8d; }
.wbs-toolbar button { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: 1.5px solid #ddd; background: #fff; cursor: pointer; font-weight: 700; color: #2c3e50; }
.wbs-toolbar button:hover { border-color: #3498db; color: #3498db; }
.wbs-toolbar-overlay { position: absolute; top: 8px; left: 8px; z-index: 100; background: rgba(255,255,255,0.97); padding: 6px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.wbs-canvas-wrap { position: relative; width: 100%; height: 600px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: #fafbfc; background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px); background-size: 20px 20px; }
.wbs-scroll-area { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: auto; }
.wbs-canvas-wrap.fullscreen { position: fixed !important; top: 0; left: 0; width: 100vw !important; height: 100vh !important; z-index: 9999; border-radius: 0; border: none; }
.wbs-fs-hint { position: fixed; top: 8px; right: 8px; z-index: 99; background: rgba(44,62,80,0.85); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 11px; pointer-events: none; }
.wbs-fs-hint.hidden-fs { display: none; }
.wbs-canvas-wrap.fullscreen .wbs-fs-hint.hidden-fs { display: block; }
.wbs-svg { display: block; min-width: 100%; min-height: 100%; user-select: none; }
.wbs-block { cursor: grab; }
.wbs-block.dragging { cursor: grabbing; }
.wbs-block-rect { fill: #fff; stroke: #bdc3c7; stroke-width: 1.5; rx: 8; transition: stroke 0.15s, filter 0.15s; }
.wbs-block:hover .wbs-block-rect { stroke: #3498db; filter: drop-shadow(0 2px 6px rgba(52, 152, 219, 0.25)); }
.wbs-block.selected .wbs-block-rect { stroke: #3498db; stroke-width: 2.5; }
.wbs-block-title { font-size: 12px; font-weight: 700; fill: #2c3e50; pointer-events: none; }
.wbs-block-sub { font-size: 10px; fill: #7f8c8d; pointer-events: none; }
.wbs-block-status { stroke: #fff; stroke-width: 1.5; }
.wbs-handle { fill: #3498db; stroke: #fff; stroke-width: 2; cursor: crosshair; opacity: 0.65; transition: opacity 0.15s, r 0.15s; }
.wbs-handle:hover { opacity: 1; r: 7; }
.wbs-handle.handle-ss { fill: #9b59b6; }
.wbs-conn { fill: none; stroke-width: 2; cursor: pointer; }
.wbs-conn.fs { stroke: #3498db; }
.wbs-conn.ss { stroke: #9b59b6; stroke-dasharray: 5 4; }
.wbs-conn:hover { stroke-width: 3.5; }
.wbs-conn.selected { stroke-width: 4 !important; filter: drop-shadow(0 0 6px rgba(231,76,60,0.7)); }
.lag-info-section { background: #f8f9fa; border-radius: 8px; padding: 14px; margin: 6px 0 14px; border: 1px solid #e8ecef; }
.lag-desc { font-size: 13px; font-weight: 700; color: #2c3e50; margin: 0 0 12px; line-height: 1.4; text-align: center; }
.lag-conn-preview { display: flex; align-items: stretch; gap: 0; margin: 0 0 14px; }
.lag-mini-card { flex: 1; min-width: 0; background: #fff; border: 1.5px solid #d5dbde; border-radius: 6px; padding: 8px 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.lag-mini-title { font-weight: 700; color: #2c3e50; font-size: 12px; line-height: 1.25; word-break: break-word; }
.lag-mini-dates { font-size: 10px; color: #7f8c8d; margin-top: 4px; }
.lag-mini-meta { font-size: 10px; color: #7f8c8d; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.lag-mini-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.1); }
.lag-mini-prog { background: #ecf0f1; color: #2c3e50; padding: 1px 5px; border-radius: 6px; font-size: 9px; font-weight: 800; margin-left: auto; }
.lag-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 8px; min-width: 60px; }
.lag-arrow-line { width: 100%; height: 2px; background: #7f8c8d; }
.lag-arrow-line.fs { background: #3498db; }
.lag-arrow-line.ss { background: #9b59b6; }
.lag-arrow-pill { background: #34495e; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; margin: 4px 0; }
.lag-arrow-pill.fs { background: #3498db; }
.lag-arrow-pill.ss { background: #9b59b6; }
.lag-arrow-tip { color: #7f8c8d; font-size: 14px; line-height: 1; margin-top: -2px; }
.lag-edit-section { padding-top: 10px; border-top: 1px dashed #ddd; }
.lag-edit-help { font-size: 11px; color: #7f8c8d; margin: 0 0 8px; }
.lag-edit-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.wbs-conn-label { font-size: 9px; font-weight: 700; fill: #fff; pointer-events: none; }
.wbs-conn-label-bg { fill: #34495e; rx: 3; }
.wbs-temp-conn { fill: none; stroke: #3498db; stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
.wbs-conn-virtual { fill: none; stroke: #b2bec3; stroke-width: 1.5; stroke-dasharray: 3 3; pointer-events: none; }
.wbs-conn-tree { fill: none; stroke: #7f8c8d; stroke-width: 1.8; pointer-events: none; }
.wbs-conn-rel { fill: none; stroke-width: 2; cursor: pointer; stroke-dasharray: 6 4; opacity: 0.9; }
.wbs-conn-rel.fs { stroke: #3498db; }
.wbs-conn-rel.ss { stroke: #9b59b6; }
.wbs-conn-rel:hover { stroke-width: 3.5; opacity: 1; }
.wbs-conn-rel.selected { stroke-width: 4 !important; filter: drop-shadow(0 0 6px rgba(231,76,60,0.7)); opacity: 1; }
.wbs-conn-rel.critical { stroke: #e74c3c !important; stroke-width: 2.6 !important; }
.wbs-svg.hide-conns .wbs-conn-rel,
.wbs-svg.hide-conns .wbs-conn-cross,
.wbs-svg.hide-conns .wbs-conn-label-bg,
.wbs-svg.hide-conns .wbs-conn-label { display: none; }
.wbs-block.critical .wbs-block-rect { stroke: #e74c3c; stroke-width: 2.8; filter: drop-shadow(0 0 6px rgba(231,76,60,0.45)); }
.wbs-conn.critical, .wbs-conn-tree.critical { stroke: #e74c3c !important; stroke-width: 2.6 !important; }
.gantt-bar.critical { box-shadow: 0 0 0 2.5px #e74c3c inset, 0 1px 4px rgba(231,76,60,0.4); }
.gantt-arrow.critical { stroke: #e74c3c !important; stroke-width: 2.4 !important; opacity: 1; }
.gantt-arrow-head.critical { fill: #e74c3c !important; }
.wbs-stats { display: inline-block; padding: 4px 10px; font-size: 11px; color: #2c3e50; background: rgba(255,255,255,0.95); border-radius: 6px; margin-left: 6px; font-weight: 700; }
.wbs-stats .crit-num { color: #e74c3c; }
.btn-critical-on { background: #e74c3c !important; color: #fff !important; border-color: #c0392b !important; }
.btn-conns-off { background: #95a5a6 !important; color: #fff !important; border-color: #7f8c8d !important; opacity: 0.8; }
.op-network-view-btn { padding: 4px 10px; font-size: 11px; }
.op-network-view-btn.active { background: #2c3e50 !important; color: #fff !important; border-color: #1e2b38 !important; }
.network-pan { cursor: grab; }
.network-pan.panning { cursor: grabbing; }
.network-pan.panning * { user-select: none; }
.wbs-conn-cross { fill: none; stroke-width: 1.5; opacity: 0.55; stroke-dasharray: 5 4; cursor: pointer; }
.wbs-conn-cross.fs { stroke: #3498db; }
.wbs-conn-cross.ss { stroke: #9b59b6; }
.wbs-conn-cross:hover { opacity: 1; stroke-width: 2.5; }

/* WBS hub blocks (project + sprint) */
.wbs-hub { pointer-events: none; }
.wbs-hub-root .wbs-hub-rect { fill: #2c3e50; stroke: #1e2b38; stroke-width: 2; rx: 10; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.18)); }
.wbs-hub-sprint .wbs-hub-rect { fill: #2471a3; stroke: #1a5276; stroke-width: 2; rx: 10; filter: drop-shadow(0 2px 6px rgba(36,113,163,0.30)); }
.wbs-hub-nosprint .wbs-hub-rect { fill: #5d6d7e; stroke: #4d5f72; stroke-width: 2; rx: 10; filter: drop-shadow(0 2px 6px rgba(93,109,126,0.25)); }
.wbs-hub-pacote .wbs-hub-rect   { fill: #0d6e94; stroke: #0a5273; stroke-width: 2; rx: 10; filter: drop-shadow(0 2px 6px rgba(13,110,148,0.30)); }
.wbs-hub-title { fill: #fff; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.wbs-hub-sub { fill: rgba(255,255,255,0.95); font-size: 11px; font-weight: 700; }
.wbs-hub-count-text { fill: rgba(255,255,255,0.85); font-size: 10px; font-weight: 700; pointer-events: none; letter-spacing: 0.3px; }
.wbs-hub-meta { fill: rgba(255,255,255,0.95); font-size: 10px; font-weight: 700; pointer-events: none; }
.wbs-hub-prog { font-size: 12px; font-weight: 800; }
.wbs-hub-status { stroke: #fff; stroke-width: 1.5; }
.wbs-hub-dates { fill: rgba(255,255,255,0.85); font-size: 10px; font-weight: 600; pointer-events: none; }

/* Task block (foreignObject HTML wrap) */
.wbs-block > foreignObject { pointer-events: none; }
.wbs-task-fo { width: 100%; height: 100%; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 0; pointer-events: none; }
.wbs-task-name { font-size: 12px; font-weight: 700; color: #2c3e50; line-height: 1.25; word-wrap: break-word; word-break: break-word; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wbs-task-dates { font-size: 10px; color: #7f8c8d; font-weight: 600; flex-shrink: 0; line-height: 1.4; }
.wbs-task-lane { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 9px; font-weight: 800; margin-left: 4px; vertical-align: middle; letter-spacing: 0.2px; }
.wbs-task-meta { font-size: 10px; color: #7f8c8d; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wbs-task-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1.5px rgba(0,0,0,0.08); }
.wbs-task-resp { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wbs-task-prog { background: #ecf0f1; color: #2c3e50; padding: 1px 7px; border-radius: 8px; font-weight: 800; font-size: 10px; flex-shrink: 0; }
.wbs-task-prog[data-pct="100"] { background: #d4efdf; color: #1e8449; }
.wbs-task-prog[data-pct="0"]   { background: #f4f6f7; color: #95a5a6; }

.wbs-toolbar-divider { display: inline-block; width: 1px; height: 18px; background: #ddd; margin: 0 4px; vertical-align: middle; }

/* === Gantt arrows overlay === */
.gantt-container { position: relative; }
.gantt-arrows-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.gantt-arrow { fill: none; stroke-width: 1.6; pointer-events: stroke; }
.gantt-arrow.fs { stroke: rgba(52, 73, 94, 0.7); }
.gantt-arrow.ss { stroke: rgba(155, 89, 182, 0.85); stroke-dasharray: 4 3; }
.gantt-arrow-head { fill: rgba(52, 73, 94, 0.85); }
.gantt-arrow-head.ss { fill: rgba(155, 89, 182, 0.95); }

/* === Modals === */
.dialog-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(2px); }
.dialog-overlay.active { opacity: 1; visibility: visible; }
.dialog-box { background: var(--white); padding: 30px; border-radius: 10px; width: 400px; max-width: 90%; text-align: center; transform: translateY(-20px); transition: 0.3s; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.dialog-overlay.active .dialog-box { transform: translateY(0); }
.dialog-icon { font-size: 40px; margin-bottom: 15px; }
.dialog-title { font-size: 20px; margin-bottom: 10px; color: var(--text-dark); }
.dialog-msg { font-size: 15px; color: var(--text-light); margin-bottom: 25px; }

/* Modal Visualização de Tarefa */
.task-modal-box { background: var(--bg-color); padding: 0; border-radius: 12px; width: 600px; max-width: 95%; transform: translateY(-20px); transition: 0.3s; box-shadow: 0 15px 35px rgba(0,0,0,0.3); overflow: hidden; display: flex; flex-direction: column; max-height: 90vh;}
.dialog-overlay.active .task-modal-box { transform: translateY(0); }

.tm-header { background: var(--black); color: var(--white); padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; transition: background-color 0.3s; }
.tm-header.late { background-color: var(--red); }
.tm-header h3 { color: var(--white); margin-bottom: 5px; font-size: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 0; }
.tm-status-badge { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.tm-late-info { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.4); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: bold; }

.tm-close { color: var(--white); background: transparent; border: none; font-size: 24px; cursor: pointer; opacity: 0.7; padding: 0; line-height: 1; }
.tm-close:hover { opacity: 1; }
.tm-body { padding: 20px; background: var(--white); overflow-y: auto; }

.tm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.tm-item { background: #f8f9fa; padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); }
.tm-item-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; font-weight: bold; margin-bottom: 4px; }
.tm-item-value { font-size: 14px; color: var(--text-dark); font-weight: 500; }
.tm-full-width { grid-column: span 2; }

.tm-history-container { margin-top: 20px; border-top: 2px dashed var(--border-color); padding-top: 15px; }
.tm-history-title { font-size: 14px; font-weight: bold; color: var(--blue); margin-bottom: 15px; display: flex; align-items: center; gap: 5px; }
.tm-history-list { max-height: 200px; overflow-y: auto; padding-right: 10px; position: relative; }
.tm-history-list::-webkit-scrollbar { width: 6px; }
.tm-history-list::-webkit-scrollbar-track { background: #f1f2f6; border-radius: 4px; }
.tm-history-list::-webkit-scrollbar-thumb { background: #bdc3c7; border-radius: 4px; }
.tm-history-list::-webkit-scrollbar-thumb:hover { background: var(--blue); }

.tm-history-item { padding-left: 15px; border-left: 2px solid var(--blue-light); position: relative; padding-bottom: 15px; }
.tm-history-item:last-child { border-left: 2px solid transparent; padding-bottom: 0; }
.tm-history-item::before { content: ''; position: absolute; left: -5px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.tm-history-date { font-size: 11px; color: var(--text-light); margin-bottom: 4px; font-weight: bold; }
.tm-history-text { font-size: 13px; color: var(--text-dark); line-height: 1.4;}

.form-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 20px; }

/* === Status Change Modal === */
.scm-status-btn { padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: bold; cursor: pointer; border: 3px solid transparent; color: #fff; transition: 0.15s; }
.scm-status-btn:hover { opacity: 0.85; }
.scm-status-btn.scm-active { border-color: #2c3e50; box-shadow: 0 2px 8px rgba(0,0,0,0.25); transform: scale(1.05); }
.k-btn-status { color: #7f8c8d; }
.k-btn-status:hover { color: var(--blue); }

/* === Main Header === */
.main-header { display: flex; align-items: center; gap: 16px; padding: 16px 0 12px; border-bottom: 3px solid var(--black); margin-bottom: 0; flex-shrink: 0; }
.main-logo { height: 48px; width: auto; object-fit: contain; }
.main-title { font-size: 26px; font-weight: 700; color: var(--text-dark); margin: 0; }

/* === Main Tabs === */
.main-tabs { display: flex; gap: 4px; border-bottom: 3px solid var(--black); margin-bottom: 24px; align-items: flex-end; padding-top: 10px; flex-shrink: 0; }
.main-tab-btn { background: #e4e7eb; border: 1px solid #c5cdd6; border-bottom: none; padding: 10px 24px; font-size: 14px; font-weight: bold; color: var(--text-light); border-radius: 6px 6px 0 0; transition: 0.2s; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; margin-bottom: 0; }
.main-tab-btn:hover { background: #cdd3da; color: var(--text-dark); }
.main-tab-btn.active { background: var(--black); color: var(--white); border-color: var(--black); margin-bottom: -3px; padding-bottom: 13px; }

/* Tabs inline no header — economiza linha vertical inteira */
.main-tabs-inline { display: flex; gap: 4px; margin: 0 0 0 20px; padding: 0; border: none; align-items: center; }
.main-tabs-inline .main-tab-btn { padding: 8px 18px; font-size: 13px; border-radius: 6px; border: 1px solid #c5cdd6; margin: 0; }
.main-tabs-inline .main-tab-btn.active { background: var(--black); color: var(--white); border-color: var(--black); margin: 0; padding: 8px 18px; }
.main-tab-icon { font-size: 16px; line-height: 1; }
.main-tab-content { display: none; }
.main-tab-content.active { display: block; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-right: 4px; }

/* === Summary Bar (Executive Dashboard) === */
.summary-bar { display: flex; flex-wrap: wrap; gap: 0; align-items: stretch; margin-bottom: 20px; background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); overflow: hidden; }
/* Compact variant — usado quando summary fica inline ao header (sem ocupar linha inteira) */
.summary-bar.summary-compact { margin: 0; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); flex-wrap: nowrap; }
.summary-bar.summary-compact .summary-total-block { padding: 8px 14px; gap: 0; }
.summary-bar.summary-compact .summary-total-num { font-size: 22px; }
.summary-bar.summary-compact .summary-total-label { font-size: 9px; letter-spacing: 0.5px; }
.summary-bar.summary-compact .summary-pill { padding: 6px 12px; gap: 2px; min-width: 60px; }
.summary-bar.summary-compact .summary-pill-num { font-size: 18px; }
.summary-bar.summary-compact .summary-pill-label { font-size: 9px; letter-spacing: 0.3px; }
.summary-bar.summary-compact .summary-pill-dot { width: 6px; height: 6px; }
.summary-total-block { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 24px; border-right: 1px solid var(--border-color); gap: 2px; }
.summary-total-num { font-size: 42px; font-weight: 900; color: var(--text-dark); line-height: 1; }
.summary-total-label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; }
.summary-pills-wrap { display: flex; flex-wrap: wrap; flex: 1; }
.summary-pill { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 20px; cursor: pointer; border: none; border-right: 1px solid #f0f1f3; gap: 5px; transition: all 0.2s; min-width: 90px; flex: 1; background: #fafbfc; }
.summary-pill:last-child { border-right: none; }
.summary-pill:hover { background: #f1f3f5; }
.summary-pill-num { font-size: 32px; font-weight: 900; line-height: 1; transition: 0.2s; }
.summary-pill-row { display: flex; align-items: center; gap: 5px; }
.summary-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.summary-pill-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
/* Active state */
.summary-pill.pill-active { transform: none; }
.summary-pill.pill-active-nao_iniciado { background: #eef0f1; border-bottom: 3px solid #7f8c8d; }
.summary-pill.pill-active-ok           { background: #d4f5e3; border-bottom: 3px solid #1e8449; }
.summary-pill.pill-active-atencao      { background: #fef9d0; border-bottom: 3px solid #c7870a; }
.summary-pill.pill-active-risco        { background: #fde8e8; border-bottom: 3px solid #c0392b; }
.summary-pill.pill-active-critico      { background: #ede0f5; border-bottom: 3px solid #6c3483; }

/* === Multi-Select Equipe === */
.equipe-ms { position: relative; }
.equipe-ms-display { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; background: #fff; min-height: 42px; user-select: none; transition: border-color 0.2s; }
.equipe-ms-display:hover { border-color: var(--blue); }
.equipe-ms.open .equipe-ms-display { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.equipe-ms-val { font-size: 14px; color: var(--text-dark); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equipe-ms-val.placeholder { color: #bdc3c7; }
.equipe-ms-arrow { font-size: 11px; color: #95a5a6; margin-left: 6px; flex-shrink: 0; transition: transform 0.2s; display: inline-block; }
.equipe-ms.open .equipe-ms-arrow { transform: rotate(180deg); }
.equipe-ms-drop { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 600; min-width: 220px; }
.equipe-ms.open .equipe-ms-drop { display: block; }
.equipe-ms-search { width: 100%; padding: 9px 12px; border: none; border-bottom: 1px solid #f1f2f6; border-radius: 8px 8px 0 0; font-size: 13px; outline: none; background: #fafbfc; }
.equipe-ms-search:focus { background: #fff; }
.equipe-ms-list { max-height: 160px; overflow-y: auto; padding: 4px 0; }
.equipe-ms-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text-dark); transition: background 0.1s; }
.equipe-ms-item:hover { background: #f0f4f8; }
.equipe-ms-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--blue); }
.equipe-ms-footer { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #f1f2f6; }
.equipe-ms-new-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 12px; outline: none; }
.equipe-ms-new-input:focus { border-color: var(--blue); }
.equipe-ms-new-btn { padding: 6px 12px; background: var(--green); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: bold; flex-shrink: 0; }
.equipe-ms-new-btn:hover { background: var(--green-hover); }
.equipe-ms-ok { width: calc(100% - 16px); margin: 0 8px 8px; padding: 8px; background: var(--blue); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: bold; display: block; }
.equipe-ms-ok:hover { background: var(--blue-hover); }

/* === Viewer Mode (read-only) === */
body.viewer-mode .admin-edit { display: none !important; }
body.viewer-mode input[type=text],
body.viewer-mode input[type=date],
body.viewer-mode input[type=email],
body.viewer-mode select { pointer-events: none !important; background: #f4f6f8 !important; color: #555 !important; }

/* Perfil "equipe" — esconde Cadastro accordion, farol manual do projeto, botão Nova Operação.
   Sobrevive a re-renders (não depende de applyPermissions rodar após cada DOM mutation). */
body.role-equipe #op-acc-cadastro,
body.role-equipe [data-role="proj-status-manual"],
body.role-equipe .admin-only { display: none !important; }
/* Viewer também esconde cadastro + farol projeto */
body.viewer-mode #op-acc-cadastro,
body.viewer-mode [data-role="proj-status-manual"] { display: none !important; }
/* Attribute hidden HTML padrão — força ocultação em qualquer perfil quando setado via JS */
#op-acc-cadastro[hidden] { display: none !important; }
body.viewer-mode textarea { background: #f4f6f8 !important; color: #555 !important; resize: none !important; cursor: default; }
body.viewer-mode .equipe-ms-display,
body.viewer-mode .sprint-ss-display { pointer-events: none !important; cursor: default !important; background: #f4f6f8 !important; }
body.viewer-mode .farol-btn { pointer-events: none !important; cursor: default !important; }
body.viewer-mode .kanban-card { cursor: default !important; }

/* === Accordion === */
.op-accordion { border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.op-accordion-hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #f4f6f8; cursor: pointer; user-select: none; font-weight: 700; font-size: 14px; color: var(--text-dark); transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s; border-left: 4px solid transparent; }
.op-accordion-hd:hover { background: #eaecef; }
.kanban-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 12px;
    flex-wrap: nowrap;
    font-weight: 600;
    font-size: 14px;
}
.kanban-stats:empty { display: none; }
.kanban-new-task-link:hover { background: #2980b9 !important; color: #fff !important; }
.kanban-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform .15s, box-shadow .15s;
    cursor: default;
}
.kanban-stat-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.kanban-stat-chip.zero { opacity: 0.35; }
.kanban-stat-chip .kanban-stat-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.kanban-stat-chip.s-critico      { background: #f4e6f7; color: #6c3483; }
.kanban-stat-chip.s-critico      .kanban-stat-dot { background: #8e44ad; }
.kanban-stat-chip.s-risco        { background: #fdecea; color: #922b21; }
.kanban-stat-chip.s-risco        .kanban-stat-dot { background: #e74c3c; }
.kanban-stat-chip.s-atencao      { background: #fff8dc; color: #7d5a00; }
.kanban-stat-chip.s-atencao      .kanban-stat-dot { background: #ffeb3b; }
.kanban-stat-chip.s-ok           { background: #e8f5e9; color: #1e8449; }
.kanban-stat-chip.s-ok           .kanban-stat-dot { background: #2ecc71; }
.kanban-stat-chip.s-nao_iniciado { background: #ecf0f1; color: #5a6877; }
.kanban-stat-chip.s-nao_iniciado .kanban-stat-dot { background: #95a5a6; }
.kanban-stat-chip.s-total {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    font-weight: 900;
    letter-spacing: .3px;
    padding: 6px 15px;
    font-size: 14px;
    border: none;
}
.kanban-stat-chip.s-total .kanban-stat-dot { display: none; }
.kanban-stat-sep {
    width: 1px;
    height: 18px;
    background: rgba(0,0,0,0.15);
    margin: 0 4px;
}
.op-accordion:not(.closed) > .op-accordion-hd { background: linear-gradient(90deg, #d6eaf8 0%, #eaf3fb 100%); color: var(--blue); border-left-color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); font-weight: 900; }

/* Accordion fullscreen */
.op-accordion-hd .acc-fs-btn { background: transparent; border: 1px solid transparent; cursor: pointer; padding: 2px 8px; margin: 0 8px 0 auto; font-size: 14px; border-radius: 5px; color: inherit; transition: background 0.15s, border-color 0.15s; line-height: 1; }
.op-accordion-hd .acc-fs-btn:hover { background: rgba(52,152,219,0.18); border-color: var(--blue); }
/* Accordion export buttons */
.acc-export-btns { display:inline-flex; align-items:center; gap:4px; margin-right:6px; }
.acc-export-btn { background:#f0f3f6; border:1px solid #bdc3c7; cursor:pointer; padding:3px 9px; font-size:11px; font-weight:700; border-radius:5px; color:#555; line-height:1.4; display:inline-flex; align-items:center; gap:4px; transition:background 0.15s,border-color 0.15s,color 0.15s; white-space:nowrap; }
.acc-export-btn:hover { background:#d6eaf8; border-color:var(--blue); color:var(--blue); }
.acc-export-btn:active { background:#aed6f1; }
.op-accordion.acc-fs { position: fixed; inset: 0; z-index: 9999; margin: 0; border-radius: 0; background: #fff; overflow: auto; box-shadow: none; }
.op-accordion.acc-fs > .op-accordion-hd { position: sticky; top: 0; z-index: 10; border-radius: 0; }
.op-accordion.acc-fs > .op-accordion-body { min-height: calc(100vh - 50px); display: flex; flex-direction: column; }
.op-accordion.acc-fs > .op-accordion-body > .wbs-canvas-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
body.acc-fs-active { overflow: hidden; }
.op-accordion-hd .op-acc-arrow { font-size: 12px; transition: transform 0.25s; }
.op-accordion-body { padding: 16px; }
.op-accordion.closed .op-accordion-body { display: none; }
.op-accordion.closed .op-acc-arrow { transform: rotate(-90deg); }

/* === Project title+status box === */
/* View-project: scroll interno só na área de accordions */
#op-view-project { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
#op-view-project > .form-container { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* Topo fixo do view-project — header + filtros sempre visíveis (sem position:sticky pois scroll é interno) */
.op-project-sticky-top { flex-shrink: 0; background: var(--bg-light, #f5f6f8); padding-bottom: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.op-project-sticky-top .header { margin-top: 10px; margin-bottom: 6px; padding-bottom: 8px; }
.op-filters-bar { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; margin: 0 0 4px 0; overflow: hidden; }
.op-filters-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: pointer; user-select: none; transition: background .15s; }
.op-filters-toggle:hover { background: #f8f9fa; }
.op-filters-toggle-label { font-size: 12px; font-weight: 800; color: var(--text-dark); letter-spacing: .3px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.op-filters-toggle-summary { font-size: 11px; color: var(--text-light); font-weight: 600; flex: 1; }
.op-filters-toggle-arrow { font-size: 14px; color: var(--text-light); transition: transform .2s; }
.op-filters-bar.collapsed .op-filters-toggle-arrow { transform: rotate(-90deg); }
.op-filters-body { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-color); }
.op-filters-bar.collapsed .op-filters-body { display: none; }
.op-filters-body > div:empty { display: none; }

.op-proj-header-box { flex: 1; border: 1.5px solid var(--border-color); border-radius: 10px; padding: 14px 18px; display: flex; align-items: center; gap: 20px; background: #fff; flex-wrap: wrap; }
.op-proj-header-box h2 { margin: 0; font-size: 26px; font-weight: 900; color: var(--blue); }
.op-proj-header-box .op-proj-sub { color: var(--text-dark); font-size: 15px; font-weight: 700; margin-top: 4px; }
.op-proj-status-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.status-desc-block {
    margin-top: 6px;
    max-width: 420px;
    font-size: 12px;
    line-height: 1.45;
    color: #2c3e50;
    background: #f8f9fa;
    border-left: 3px solid #bdc3c7;
    border-radius: 4px;
    padding: 8px 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}
.status-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}
.status-desc-txt {
    flex: 1 1 auto;
    color: #5a6877;
    font-weight: 400;
}
.status-desc-block:empty { display: none; }
.status-desc-block.status-desc-inline {
    margin-top: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.status-chip-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid #e1e5ea;
    border-left-width: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
    max-width: 100%;
}
.status-chip-mini[data-status="ok"]           { border-left-color: var(--green); }
.status-chip-mini[data-status="atencao"]      { border-left-color: var(--yellow); }
.status-chip-mini[data-status="risco"]        { border-left-color: var(--red); }
.status-chip-mini[data-status="critico"]      { border-left-color: var(--critical, #8e44ad); }
.status-chip-mini[data-status="nao_iniciado"] { border-left-color: var(--gray, #95a5a6); }
.status-chip-mini .status-desc-dot { margin-right: 2px; width: 8px; height: 8px; }
.status-chip-mini b { font-weight: 700; }
.status-chip-mini .status-chip-desc { font-weight: 400; color: #5a6877; }
.status-desc-block[data-status="ok"]           { border-left-color: var(--green); }
.status-desc-block[data-status="atencao"]      { border-left-color: var(--yellow); }
.status-desc-block[data-status="risco"]        { border-left-color: var(--red); }
.status-desc-block[data-status="critico"]      { border-left-color: var(--critical, #8e44ad); }
.status-desc-block[data-status="nao_iniciado"] { border-left-color: var(--gray, #95a5a6); }
.status-desc-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.12);
}
.op-proj-title-side { display: flex; flex-direction: column; }
.op-proj-just-mid { display: none; flex: 2; flex-direction: column; min-width: 520px; max-width: 960px; margin: 0; align-self: stretch; justify-content: center; }
.op-proj-just-mid.show { display: flex; }
.op-proj-just-mid textarea { font-size: 13px; padding: 6px 10px; }

/* === Sprint Single-Select === */
.sprint-ss { position: relative; }
.sprint-ss-display { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; background: #fff; min-height: 42px; user-select: none; transition: border-color 0.2s; }
.sprint-ss-display:hover { border-color: var(--blue); }
.sprint-ss.open .sprint-ss-display { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.sprint-ss-val { font-size: 14px; color: var(--text-dark); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sprint-ss-val.placeholder { color: #bdc3c7; }
.sprint-ss-arrow { font-size: 11px; color: #95a5a6; margin-left: 6px; flex-shrink: 0; transition: transform 0.2s; display: inline-block; }
.sprint-ss.open .sprint-ss-arrow { transform: rotate(180deg); }
.sprint-ss-drop { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 600; min-width: 220px; }
.sprint-ss.open .sprint-ss-drop { display: block; }
.sprint-ss-search { width: 100%; padding: 9px 12px; border: none; border-bottom: 1px solid #f1f2f6; border-radius: 8px 8px 0 0; font-size: 13px; outline: none; background: #fafbfc; }
.sprint-ss-list { max-height: 160px; overflow-y: auto; padding: 4px 0; }
.sprint-ss-item { display: flex; align-items: center; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text-dark); transition: background 0.1s; }
.sprint-ss-item:hover { background: #f0f4f8; }
.sprint-ss-item-sel { background: #eaf4ff; color: var(--blue); font-weight: 600; }
.sprint-ss-footer { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #f1f2f6; }
.sprint-ss-new-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 12px; outline: none; }
.sprint-ss-new-input:focus { border-color: var(--blue); }
.sprint-ss-new-btn { padding: 6px 12px; background: var(--green); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: bold; flex-shrink: 0; }
.sprint-ss-new-btn:hover { background: var(--green-hover); }

/* ===================== RESPONSIVE ===================== */

/* --- Tablet (≤900px) --- */
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .summary-total-num { font-size: 34px; }
    .summary-pill-num  { font-size: 26px; }
    .summary-pill      { min-width: 72px; padding: 12px 14px; }
    .main-title        { font-size: 20px; }
}

/* --- Mobile (≤640px) --- */
@media (max-width: 640px) {

    /* Base */
    body { padding: 8px; }

    /* Main header — mobile: logos mesma linha, título abaixo */
    .main-header { flex-wrap: wrap; gap: 0; padding: 10px 0 8px; align-items: center; }
    .main-logo   { height: 36px; }
    .main-header > .main-logo:first-child { order: 1; flex-shrink: 0; }
    .main-header > .main-logo:last-child  { order: 1; flex-shrink: 0; margin-left: auto; }
    .header-spacer { display: none; }
    .main-title  { order: 2; flex: 1 1 100%; font-size: 18px; text-align: center; margin: 6px 0 4px; }
    .main-header > #user-bar { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

    /* Main tabs */
    .main-tabs { overflow-x: auto; flex-wrap: nowrap; gap: 2px; -webkit-overflow-scrolling: touch; padding-bottom: 0; }
    .main-tab-btn { padding: 8px 14px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

    /* Section headers */
    .header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; padding-bottom: 12px; }
    .header h1, .header h2 { font-size: 18px; }
    .header-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    .header-actions button, .header-actions .db-status { flex: 1 1 auto; text-align: center; }

    /* Summary bar */
    .summary-bar { border-radius: 10px; }
    .summary-total-block { padding: 12px 14px; border-right: none; border-bottom: 1px solid var(--border-color); flex-direction: row; gap: 10px; justify-content: flex-start; width: 100%; }
    .summary-total-num   { font-size: 28px; }
    .summary-total-label { font-size: 11px; }
    .summary-pills-wrap  { width: 100%; }
    .summary-pill        { min-width: 0; flex: 1 1 18%; padding: 10px 6px; gap: 3px; }
    .summary-pill-num    { font-size: 20px; }
    .summary-pill-dot    { width: 6px; height: 6px; }
    .summary-pill-label  { font-size: 8px; letter-spacing: 0; }

    /* Cards */
    .grid { grid-template-columns: 1fr; gap: 12px; }
    .card { padding: 14px; }
    .card-title { font-size: 15px; }

    /* Form container */
    .form-container { padding: 14px; }

    /* 2-col form grids → 1 col */
    .form-grid-2col { grid-template-columns: 1fr !important; }

    /* STAR title row (3col) → stack */
    .form-grid-resp-dates { grid-template-columns: 1fr !important; }

    /* Title-status row (initiative/project status) */
    .title-status-row    { flex-direction: column; gap: 12px; }
    .title-col, .status-col, .justificativa-col { min-width: unset; flex: unset; width: 100%; }
    .op-proj-header-box { flex-direction: column; align-items: flex-start; }
    .op-proj-status-side { margin-left: 0; align-items: flex-start; }
    .justificativa-col.show { display: block; }

    /* Kanban form — 1 col */
    .kanban-form { grid-template-columns: 1fr !important; gap: 10px; }

    /* Dates row inside kanban → 2 col dates + stacked status */
    .k-dates-row { grid-template-columns: 1fr 1fr !important; }
    .k-dates-row > div:nth-child(3),   /* Duração */
    .k-dates-row > div:nth-child(4) {  /* Status */
        grid-column: 1 / -1;
    }

    /* Obs + buttons row → stack vertically */
    .k-obs-actions { flex-direction: column !important; }
    .k-task-btns   { align-self: stretch !important; flex-direction: row !important; justify-content: flex-end !important; }
    .k-task-btns button { flex: 1; }

    /* Kanban board — narrower cols, horizontal scroll */
    .kanban-board { gap: 6px; }
    .kanban-col   { min-width: 160px; }
    .kanban-col-header { font-size: 12px; padding: 8px 6px; }
    .kanban-card  { padding: 8px; }
    .kanban-card h4 { font-size: 13px; }

    /* Gantt */
    .gantt-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Task view modal */
    .task-modal-box { max-height: 96vh; border-radius: 8px; }
    .tm-header      { padding: 14px; }
    .tm-header h3   { font-size: 15px; }
    .tm-body        { padding: 14px; }
    .tm-grid        { grid-template-columns: 1fr !important; gap: 10px; }
    .tm-full-width  { grid-column: span 1 !important; }

    /* Dialog box */
    .dialog-box { padding: 20px; }

    /* Form actions */
    .form-actions { flex-direction: column; gap: 10px; }
    .form-actions button { width: 100%; }

    /* Buttons general - touch-friendly */
    button { min-height: 40px; }
    .kanban-card-actions { gap: 16px; }
    .k-btn-action { font-size: 12px; }

    /* Hide Gantt on very small screens (optional — it's hard to use on mobile) */
    /* .gantt-wrapper { display: none; } */
}

/* === CADASTRO TABS (Waves / Sprints / Tasks) === */
.cad-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-color); margin-bottom: 16px; }
.cad-tab { background: transparent; border: none; padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; }
.cad-tab:hover { color: var(--text-dark); }
.cad-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.cad-pane.hidden { display: none; }
.cad-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 15px; padding: 10px 0; align-items: end; }
.cad-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.cad-list-wrap { margin-top: 14px; border-top: 1px solid var(--border-color); padding-top: 14px; overflow-x: auto; }
.cad-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cad-list-table th { text-align: left; padding: 8px 10px; background: #f8f9fa; color: #2c3e50; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border-color); }
.cad-list-table th.sortable { cursor: pointer; user-select: none; transition: background .15s; }
.cad-list-table th.sortable:hover { background: #eaecef; }
.cad-list-table th.sortable.sort-asc::after  { content: ' ▲'; font-size: 9px; color: var(--blue); }
.cad-list-table th.sortable.sort-desc::after { content: ' ▼'; font-size: 9px; color: var(--blue); }
.cad-list-table th.sortable:not(.sort-asc):not(.sort-desc)::after { content: ' ⇅'; font-size: 9px; color: #bdc3c7; }
.cad-list-table td { padding: 8px 10px; border-bottom: 1px solid #ecf0f1; color: var(--text-dark); vertical-align: middle; }
.cad-list-table tr:hover td { background: #fafbfc; }
.cad-list-table .cad-act { display: inline-block; padding: 4px 10px; font-size: 11px; font-weight: 700; border-radius: 4px; cursor: pointer; margin-right: 4px; border: 1px solid transparent; }
.cad-list-table .cad-act-edit { color: var(--blue); border-color: var(--blue); }
.cad-list-table .cad-act-edit:hover { background: var(--blue); color: #fff; }
.cad-list-table .cad-act-del { color: var(--red); border-color: var(--red); }
.cad-list-table .cad-act-del:hover { background: var(--red); color: #fff; }
.cad-list-table .cad-status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cad-empty { padding: 18px; text-align: center; color: #95a5a6; font-size: 12px; }

/* === WAVE SINGLE-SELECT DROPDOWN (clone do sprint-ss, sem inline-create) === */
.wave-ss { position: relative; }
.wave-ss-display { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; background: #fff; min-height: 42px; user-select: none; transition: border-color 0.2s; }
.wave-ss-display:hover { border-color: var(--blue); }
.wave-ss.open .wave-ss-display { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.wave-ss-val { font-size: 14px; color: var(--text-dark); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave-ss-val.placeholder { color: #bdc3c7; }
.wave-ss-arrow { font-size: 11px; color: #95a5a6; margin-left: 6px; flex-shrink: 0; transition: transform 0.2s; display: inline-block; }
.wave-ss.open .wave-ss-arrow { transform: rotate(180deg); }
.wave-ss-drop { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 600; min-width: 220px; }
.wave-ss.open .wave-ss-drop { display: block; }
.wave-ss-search { width: 100%; padding: 9px 12px; border: none; border-bottom: 1px solid #f1f2f6; border-radius: 8px 8px 0 0; font-size: 13px; outline: none; background: #fafbfc; }
.wave-ss-list { max-height: 160px; overflow-y: auto; padding: 4px 0; }
.wave-ss-item { display: flex; align-items: center; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text-dark); transition: background 0.1s; }
.wave-ss-item:hover { background: #f0f4f8; }
.wave-ss-item-sel { background: #eaf4ff; color: var(--blue); font-weight: 600; }
body.viewer-mode .wave-ss-display { pointer-events: none !important; cursor: default !important; background: #f4f6f8 !important; }

@media (max-width: 768px) {
    .cad-form { grid-template-columns: 1fr; }
    .cad-list-table { font-size: 12px; }
    .cad-list-table th, .cad-list-table td { padding: 6px 8px; }
}

/* === TASK SUBTABS (Formulário / Grid bulk) === */
.task-subtabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #ecf0f1; padding-bottom: 0; }
.task-subtab { background: #f8f9fa; border: 1px solid #ecf0f1; border-bottom: none; padding: 8px 16px; font-size: 12px; font-weight: 700; color: #7f8c8d; cursor: pointer; border-radius: 6px 6px 0 0; margin-bottom: -1px; transition: all 0.15s; }
.task-subtab:hover { color: #2c3e50; background: #fff; }
.task-subtab.active { color: var(--blue); background: #fff; border-color: #ecf0f1; border-bottom: 2px solid #fff; position: relative; z-index: 1; }
.task-sub-pane.hidden { display: none; }

/* === GRID BULK === */
.grid-toolbar { display: flex; gap: 10px; align-items: center; padding: 8px 0; margin-bottom: 10px; flex-wrap: wrap; }
.grid-toolbar .grid-search { flex: 1; min-width: 180px; max-width: 280px; padding: 7px 10px; font-size: 13px; }
.grid-counter { font-size: 12px; color: #7f8c8d; font-weight: 700; }
.grid-hint { font-size: 11px; color: #95a5a6; font-style: italic; }

.grid-scroll-wrap { overflow-x: auto; overflow-y: visible; max-height: 600px; border: 1px solid #ecf0f1; border-radius: 6px; background: #fff; }
.task-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1400px; font-size: 12px; }
.task-grid thead th { position: sticky; top: 0; background: #2c3e50; color: #fff; padding: 8px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; border-right: 1px solid #34495e; text-align: left; white-space: nowrap; z-index: 2; }
.task-grid thead th:last-child { border-right: none; }
.task-grid tbody tr:nth-child(odd) td { background: #fafbfc; }
.task-grid tbody tr:hover td { background: #eaf4ff; }
.task-grid tbody td { padding: 3px 4px; border-bottom: 1px solid #ecf0f1; border-right: 1px solid #f1f2f6; vertical-align: middle; }
.task-grid tbody td:last-child { border-right: none; }

.task-grid input[type=text], .task-grid input[type=date], .task-grid select {
    width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 3px;
    background: transparent; font-size: 12px; outline: none; min-height: 26px;
    color: #2c3e50; transition: background 0.1s, border-color 0.1s;
}
.task-grid input:hover, .task-grid select:hover { background: #fff; border-color: #ddd; }
.task-grid input:focus, .task-grid select:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(52,152,219,0.15); }
.task-grid input[readonly] { background: #ecf0f1; color: #7f8c8d; cursor: not-allowed; }

.grid-col-handle { width: 36px; text-align: center; }
.grid-col-tarefa { min-width: 220px; }
.task-grid .grid-handle { font-size: 11px; color: #7f8c8d; text-align: center; font-weight: 700; }

.task-grid td.grid-status-cell { padding: 0 4px; }
.task-grid .grid-status-select { font-size: 11px; padding: 4px 4px; min-height: 26px; border-radius: 3px; }
.task-grid .grid-status-select.status-nao_iniciado { background: #ecf0f1; }
.task-grid .grid-status-select.status-ok { background: #d5f5e3; color: #1e8449; }
.task-grid .grid-status-select.status-atencao { background: #fcf3cf; color: #c87f0a; }
.task-grid .grid-status-select.status-risco { background: #f5b7b1; color: #922b21; }
.task-grid .grid-status-select.status-critico { background: #e8daef; color: #6c3483; }

.task-grid .grid-prog-select { font-weight: 700; }
.task-grid input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.grid-del-btn { background: transparent; border: none; cursor: pointer; padding: 4px 8px; font-size: 14px; border-radius: 3px; color: var(--red); }
.grid-del-btn:hover { background: var(--red); color: #fff; }
.grid-edit-btn { background: transparent; border: none; cursor: pointer; padding: 4px 8px; font-size: 14px; border-radius: 3px; color: var(--blue); margin-right: 2px; }
.grid-edit-btn:hover { background: var(--blue); color: #fff; }
.grid-acts-cell { white-space: nowrap; text-align: center; }

.task-grid tr.grid-row-editing td { background: #fff8e1 !important; }
.task-grid tr.grid-row-editing td.grid-col-tarefa { background: #fff3c4 !important; }
/* Task incompleta (faltando Descrição/Responsável/Data Início/Data Fim) — NÃO persiste no servidor */
.task-grid tr.grid-row-incomplete td { background: #fdecea !important; }
.task-grid tr.grid-row-incomplete td:first-child { border-left: 4px solid #c0392b !important; position: relative; }
.task-grid tr.grid-row-incomplete td.grid-col-tarefa input,
.task-grid tr.grid-row-incomplete .grid-resp-cell.empty,
.task-grid tr.grid-row-incomplete td input[type="date"][value=""] { box-shadow: inset 0 0 0 2px #e74c3c88; border-color: #c0392b !important; }

.grid-col-just { min-width: 180px; }
.task-grid td.grid-just-cell { padding: 2px 4px; }
.grid-just-input { width: 100%; font-size: 11px; padding: 4px 6px; border: 1px solid #f39c12; background: #fef9e7; border-radius: 3px; }
.grid-just-input:focus { border-color: #d68910; box-shadow: 0 0 0 2px rgba(243,156,18,0.25); }
.task-grid.no-just-needed th.grid-col-just,
.task-grid.no-just-needed td.grid-just-cell { display: none; }

/* Fullscreen do grid de tasks */
/* Diário de Bordo — criticidade semáforo (dot à esquerda) */
.diario-crit-group { flex-wrap: nowrap !important; }
.diario-crit-opt { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 5px 9px; border: 2px solid #d8dee3; border-radius: 14px; background: #fff; font-size: 11px; font-weight: 700; color: #2c3e50; transition: all 0.15s; user-select: none; white-space: nowrap; opacity: 0.55; }
.diario-crit-opt:hover { border-color: #95a5a6; opacity: 0.85; }
.diario-crit-opt.active { opacity: 1; transform: scale(1.08); box-shadow: 0 3px 10px rgba(0,0,0,0.18); font-weight: 900; }
.diario-crit-opt.active[data-crit="0"] { background: #ecf0f1; border-color: #7f8c8d; color: #2c3e50; }
.diario-crit-opt.active[data-crit="1"] { background: #d5f5e3; border-color: #1e8449; color: #145a32; }
.diario-crit-opt.active[data-crit="2"] { background: #fff7b3; border-color: #b7950b; color: #6e5808; }
.diario-crit-opt.active[data-crit="3"] { background: #f5b7b1; border-color: #922b21; color: #641e16; }
.diario-crit-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12); }
.diario-crit-opt.active .diario-crit-dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2); }
.diario-crit-label { white-space: nowrap; }

/* Diário de Bordo — status do registro select */
.diario-status-select { font-weight: 700; }
.diario-status-select.st-aberto       { background: #d6eaf8; color: #1f618d; }
.diario-status-select.st-em_andamento { background: #fdebd0; color: #9c640c; }
.diario-status-select.st-resolvido    { background: #d4efdf; color: #186a3b; }
.diario-status-select.st-cancelado    { background: #ecf0f1; color: #424949; }
.diario-status-chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.diario-status-chip.st-aberto       { background: #d6eaf8; color: #1f618d; }
.diario-status-chip.st-em_andamento { background: #fdebd0; color: #9c640c; }
.diario-status-chip.st-resolvido    { background: #d4efdf; color: #186a3b; }
.diario-status-chip.st-cancelado    { background: #ecf0f1; color: #424949; }

/* Diário de Bordo — tipo single-select com CRUD inline */
.tipo-ss { position: relative; }
.tipo-ss-display { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 14px; min-height: 38px; transition: border-color 0.15s; }
.tipo-ss-display:hover { border-color: var(--blue); }
.tipo-ss-val.placeholder { color: #95a5a6; font-style: italic; }
.tipo-ss-arrow { font-size: 11px; color: #7f8c8d; }
.tipo-ss-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 600; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); max-height: 280px; overflow: hidden; display: flex; flex-direction: column; }
.tipo-ss-addrow { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid #f1f2f6; background: #fafbfc; }
.tipo-ss-addrow input { flex: 1; font-size: 12px; padding: 6px 8px; }
.tipo-ss-addrow button { padding: 6px 12px; font-size: 13px; font-weight: 800; }
.tipo-ss-list { overflow-y: auto; max-height: 220px; }
.tipo-ss-item { display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer; transition: background 0.1s; border-bottom: 1px solid #f7f8f9; }
.tipo-ss-item:last-child { border-bottom: none; }
.tipo-ss-item:hover { background: #f4f8fb; }
.tipo-ss-item.selected { background: #eaf3fb; font-weight: 700; }
.tipo-ss-item-name { flex: 1; font-size: 13px; color: #2c3e50; }
.tipo-ss-item-edit-input { flex: 1; font-size: 13px; padding: 4px 6px; border: 1px solid var(--blue); border-radius: 4px; }
.tipo-ss-item-act { background: transparent; border: none; cursor: pointer; padding: 2px 6px; font-size: 12px; border-radius: 3px; }
.tipo-ss-item-act.edit { color: var(--blue); }
.tipo-ss-item-act.edit:hover { background: var(--blue); color: #fff; }
.tipo-ss-item-act.del { color: var(--red); }
.tipo-ss-item-act.del:hover { background: var(--red); color: #fff; }
.tipo-ss-item-act.save { color: #1e8449; }
.tipo-ss-item-act.save:hover { background: #1e8449; color: #fff; }
.tipo-ss-item-empty { padding: 14px; text-align: center; font-size: 12px; color: #95a5a6; }

.task-sub-pane.task-grid-fs { position: fixed; inset: 0; z-index: 9999; background: #fff; padding: 16px 20px; overflow: hidden; display: flex !important; flex-direction: column; }
.task-sub-pane.task-grid-fs > *:not(.grid-scroll-wrap) { flex-shrink: 0; }
.task-sub-pane.task-grid-fs .grid-scroll-wrap { flex: 1 1 auto; min-height: 0; max-height: none; height: auto; overflow: auto; }
body.task-grid-fs-active { overflow: hidden; }

/* Pessoa multi-select cargo (não-bold) */
.pessoa-ms-cargo { font-weight: 400; color: #7f8c8d; font-size: 12px; }

.grid-empty-state { padding: 40px 20px; text-align: center; color: #95a5a6; font-size: 13px; }

/* Responsável cell (clica abre picker compartilhado) */
.grid-col-resp { min-width: 180px; }
.grid-resp-cell { padding: 6px 8px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 12px; min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: transparent; transition: background 0.1s, border-color 0.1s; }
.grid-resp-cell:hover { background: #fff; border-color: #ddd; }
.grid-resp-cell.empty { color: #95a5a6; font-style: italic; }
.grid-resp-cell.has-val { color: #2c3e50; font-weight: 600; }
.grid-resp-arrow { font-size: 10px; color: #7f8c8d; flex-shrink: 0; }

/* Picker compartilhado de pessoa no grid (popup absoluto) */
.grid-pessoa-picker { position: absolute; z-index: 800; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); width: 320px; max-width: 90vw; }
.grid-pessoa-picker.hidden { display: none; }
.grid-pessoa-picker .pessoa-ms-search { border-radius: 8px 8px 0 0; border-bottom: 1px solid #f1f2f6; }
.grid-pessoa-picker .pessoa-ms-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.grid-pessoa-picker .pessoa-ms-ok { border-radius: 0 0 8px 8px; }

/* Flag cells (entrega / milestone) — visual claro quando ligado */
.grid-col-flag { min-width: 110px; }
.grid-flag-cell { padding: 2px 4px !important; text-align: center; }
.grid-flag-label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; transition: background 0.1s; min-height: 26px; }
.grid-flag-label:hover { background: #f0f4f8; }
.grid-flag-label.is-on.entrega { background: #d1f2eb; color: #0e6655; }
.grid-flag-label.is-on.milestone { background: #e8daef; color: #6c3483; }
.grid-flag-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
.grid-flag-label span { white-space: nowrap; }

/* Sticky 1ª coluna (tarefa) opcional — efeito de profundidade */
.task-grid thead .grid-col-tarefa { z-index: 3; left: 0; position: sticky; background: #2c3e50; }
.task-grid tbody td.grid-col-tarefa { position: sticky; left: 0; background: inherit; z-index: 1; box-shadow: 2px 0 4px rgba(0,0,0,0.04); }
.task-grid tbody tr:nth-child(odd) td.grid-col-tarefa { background: #fafbfc; }
.task-grid tbody tr:hover td.grid-col-tarefa { background: #eaf4ff; }

@media (max-width: 768px) {
    .grid-scroll-wrap { max-height: 500px; }
    .task-grid { min-width: 1200px; }
    .grid-toolbar { flex-direction: column; align-items: stretch; }
    .grid-toolbar .grid-search { max-width: 100%; }
}

/* === DASHBOARD EXECUTIVO === */
.exec-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; padding: 14px; background: #f8f9fa; border-radius: 8px; border: 1px solid #ecf0f1; }
.exec-filter-group label { display: block; font-size: 11px; font-weight: 700; color: #7f8c8d; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.exec-filter-group select { width: 100%; }

.exec-summary-text { background: linear-gradient(135deg, #f1f8ff 0%, #fafbfc 100%); border-left: 4px solid var(--blue); padding: 14px 18px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; color: #2c3e50; line-height: 1.6; }
.exec-summary-text strong { color: var(--blue); }

.exec-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.exec-hero-card { background: #fff; border: 1px solid #ecf0f1; border-radius: 10px; padding: 18px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.exec-hero-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.exec-hero-card.good::before { background: var(--green); }
.exec-hero-card.warn::before { background: #e67e22; }
.exec-hero-card.bad::before  { background: var(--red); }
.exec-hero-card.neutral::before { background: #95a5a6; }
.exec-hero-card.good { background: linear-gradient(180deg, #f0faf4 0%, #fff 60%); }
.exec-hero-card.warn { background: linear-gradient(180deg, #fff8e8 0%, #fff 60%); }
.exec-hero-card.bad  { background: linear-gradient(180deg, #fdecea 0%, #fff 60%); }

.exec-hero-value-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.exec-hero-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
    line-height: 1;
    border: 1px solid rgba(0,0,0,0.06);
    white-space: nowrap;
}
.exec-hero-pill.good    { background: var(--green); color: #fff; }
.exec-hero-pill.warn    { background: #f39c12; color: #fff; }
.exec-hero-pill.bad     { background: var(--red); color: #fff; }
.exec-hero-pill.neutral { background: #ecf0f1; color: #5a6877; }
.exec-hero-msg {
    font-size: 12px;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 4px 0 8px 0;
    border-left: 3px solid #bdc3c7;
    background: #f8f9fa;
    color: #2c3e50;
}
.exec-hero-msg.good    { border-left-color: var(--green); }
.exec-hero-msg.warn    { border-left-color: #f39c12; }
.exec-hero-msg.bad     { border-left-color: var(--red); color: #922b21; font-weight: 600; }
.exec-hero-msg.neutral { border-left-color: #95a5a6; color: #5a6877; }

.exec-table-master tbody tr.row-verdict-bad,
.cad-list-table tbody tr.row-verdict-bad,
.aging-table tbody tr.row-verdict-bad     { background: linear-gradient(90deg, #fdecea 0%, #fff 50%); }
.exec-table-master tbody tr.row-verdict-warn,
.cad-list-table tbody tr.row-verdict-warn,
.aging-table tbody tr.row-verdict-warn    { background: linear-gradient(90deg, #fff8e8 0%, #fff 50%); }
.exec-table-master tbody tr.row-verdict-good,
.cad-list-table tbody tr.row-verdict-good,
.aging-table tbody tr.row-verdict-good    { background: linear-gradient(90deg, #f0faf4 0%, #fff 50%); }
.exec-table-master tbody tr.row-verdict-neutral,
.cad-list-table tbody tr.row-verdict-neutral,
.aging-table tbody tr.row-verdict-neutral { background: #fafbfc; }
.exec-table-master tbody tr:hover,
.cad-list-table tbody tr:hover,
.aging-table tbody tr:hover { filter: brightness(0.97); }

.kanban-card.kanban-card-verdict-bad     { box-shadow: inset 3px 0 0 var(--red); }
.kanban-card.kanban-card-verdict-warn    { box-shadow: inset 3px 0 0 #f39c12; }
.kanban-card.kanban-card-verdict-good    { box-shadow: inset 3px 0 0 var(--green); }
.kanban-card.kanban-card-verdict-neutral { box-shadow: inset 3px 0 0 #95a5a6; }

/* === PROFILE MODAL TABS === */
.pf-tab.active { color: var(--blue) !important; border-bottom-color: var(--blue) !important; background: #fff !important; }
.pf-pane.hidden { display: none; }

/* === NOTIFICAÇÕES — agrupamento === */
.notif-group { border-bottom: 1px solid #ecf0f1; }
.notif-group:last-child { border-bottom: none; }
.notif-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
    border-bottom: 1px solid #ecf0f1;
}
.notif-group-head:hover { background: #eaecef; }
.notif-group-icon { font-size: 14px; flex-shrink: 0; }
.notif-group-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--blue);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notif-group-count { font-size: 11px; display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.notif-group-body { background: #fff; }
.notif-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 14px 8px 24px;
    border-bottom: 1px solid #f1f2f6;
    cursor: pointer;
    transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8f9fa; }
.notif-item-icon { font-size: 13px; flex-shrink: 0; line-height: 1.4; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 12px; font-weight: 700; line-height: 1.3; }
.notif-item-desc { font-size: 12px; color: var(--text-dark); margin-top: 2px; line-height: 1.3; }

/* === PAINEL DO GP === */
.gp-summary {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fafbfc;
    border-radius: 8px;
    margin-bottom: 14px;
    border: 1px solid #ecf0f1;
}
.gp-forecast-card {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #ecf0f1;
    border-left: 4px solid #bdc3c7;
    background: #fff;
}
.gp-forecast-card.good    { background: linear-gradient(180deg, #f0faf4 0%, #fff 60%); border-left-color: var(--green); }
.gp-forecast-card.warn    { background: linear-gradient(180deg, #fff8e8 0%, #fff 60%); border-left-color: #f39c12; }
.gp-forecast-card.bad     { background: linear-gradient(180deg, #fdecea 0%, #fff 60%); border-left-color: var(--red); }
.gp-forecast-card.neutral { background: #fafbfc; border-left-color: #95a5a6; }
.gp-forecast-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #2c3e50; margin-bottom: 10px; }
.gp-forecast-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.gp-forecast-item { display: flex; flex-direction: column; gap: 2px; }
.gp-forecast-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #7f8c8d; letter-spacing: .5px; }
.gp-forecast-value { font-size: 18px; font-weight: 800; color: #2c3e50; }
.gp-forecast-arrow { font-size: 22px; color: #95a5a6; }
.gp-forecast-msg { font-size: 13px; color: #2c3e50; margin-bottom: 6px; line-height: 1.4; }
.gp-forecast-sub { font-size: 11px; color: #7f8c8d; }

.gp-section { margin-top: 8px; }
.gp-section-title { font-size: 13px; font-weight: 700; color: #2c3e50; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.gp-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.gp-action-box {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    border-left: 3px solid #bdc3c7;
}
.gp-action-box.good { border-left-color: var(--green); }
.gp-action-box.warn { border-left-color: #f39c12; background: linear-gradient(180deg, #fff8e8 0%, #fff 40%); }
.gp-action-box.bad  { border-left-color: var(--red);  background: linear-gradient(180deg, #fdecea 0%, #fff 40%); }
.gp-action-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gp-action-icon { font-size: 16px; }
.gp-action-title { font-size: 12px; font-weight: 700; color: #2c3e50; text-transform: uppercase; letter-spacing: .4px; flex: 1; }
.gp-action-count { background: #2c3e50; color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 800; min-width: 22px; text-align: center; }
.gp-action-box.bad  .gp-action-count { background: var(--red); }
.gp-action-box.warn .gp-action-count { background: #f39c12; }
.gp-action-box.good .gp-action-count { background: var(--green); }

.gp-block-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.gp-block-empty { font-size: 11px; color: #1e8449; font-style: italic; padding: 4px 0; }
.gp-item { display: flex; flex-direction: column; padding: 5px 8px; background: #fafbfc; border-radius: 4px; border-left: 2px solid #d5dbdf; }
.gp-item-name { font-size: 12px; font-weight: 600; color: #2c3e50; line-height: 1.3; }
.gp-item-meta { font-size: 10px; color: #7f8c8d; margin-top: 2px; }
.exec-hero-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #7f8c8d; margin-bottom: 8px; }
.exec-hero-value { font-size: 32px; font-weight: 800; color: #2c3e50; line-height: 1; margin-bottom: 6px; }
.exec-hero-sub { font-size: 12px; color: #7f8c8d; }
.exec-hero-trend { display: inline-block; font-size: 12px; font-weight: 700; margin-left: 8px; }
.exec-hero-trend.up   { color: var(--green); }
.exec-hero-trend.down { color: var(--red); }

.exec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.exec-col { background: #fff; border: 1px solid #ecf0f1; border-radius: 8px; padding: 14px; }
.exec-section { margin-bottom: 24px; background: #fff; border: 1px solid #ecf0f1; border-radius: 8px; padding: 14px; }
.exec-section-title { font-size: 13px; font-weight: 700; color: #2c3e50; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; padding-bottom: 8px; border-bottom: 2px solid #f1f2f6; }

.exec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exec-table th { text-align: left; padding: 8px 10px; background: #f8f9fa; color: #2c3e50; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid #ecf0f1; }
.exec-table td { padding: 8px 10px; border-bottom: 1px solid #ecf0f1; color: #2c3e50; vertical-align: middle; }
.exec-table tr:hover td { background: #fafbfc; }
.exec-table .exec-cell-status { width: 14px; }
.exec-status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }

/* SPI pill nas tabelas: pastel + texto preto. Discreto — status do projeto carrega o destaque. */
.exec-spi-pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; border: 1px solid transparent; }
.exec-spi-pill.good { background: #d5f5e3; color: #1f2937; border-color: #b9e5cb; }
.exec-spi-pill.warn { background: #fdf2d3; color: #1f2937; border-color: #f0e0a8; }
.exec-spi-pill.bad  { background: #fadbd8; color: #1f2937; border-color: #f1b9b3; }

.exec-week-block { margin-bottom: 12px; }
.exec-week-header { font-size: 12px; font-weight: 700; color: #7f8c8d; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.exec-week-item { display: grid; grid-template-columns: 90px 30px 1fr 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; background: #fafbfc; border-radius: 6px; margin-bottom: 4px; font-size: 13px; }
.exec-week-item.at-risk { background: #fdedec; border-left: 3px solid var(--red); }
.exec-week-date { font-size: 12px; font-weight: 700; color: #2c3e50; }
.exec-week-kind { font-size: 16px; text-align: center; }

.exec-workload-row { display: grid; grid-template-columns: 160px 1fr 90px auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.exec-workload-name { font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-workload-bar  { height: 16px; background: #ecf0f1; border-radius: 4px; overflow: hidden; }
.exec-workload-fill { height: 100%; transition: width 0.3s; }
.exec-workload-fill.good { background: var(--green); }
.exec-workload-fill.warn { background: #e67e22; }
.exec-workload-fill.bad  { background: var(--red); }
.exec-workload-count { font-size: 12px; color: #7f8c8d; text-align: right; }

.exec-mix-bar { display: grid; grid-template-columns: 160px 1fr 60px auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 12px; }
.exec-mix-name { font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exec-mix-track { height: 14px; background: #ecf0f1; border-radius: 3px; overflow: hidden; }
.exec-mix-fill { height: 100%; }
.exec-mix-count { font-size: 11px; color: #7f8c8d; text-align: right; font-weight: 700; }

.exec-velocity-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 160px; padding: 10px 5px; border-bottom: 2px solid #ecf0f1; gap: 6px; }
.exec-vel-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.exec-vel-bar { width: 100%; background: linear-gradient(180deg, var(--blue) 0%, #1f6391 100%); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; transition: height 0.3s; }
.exec-vel-bar-value { font-size: 11px; font-weight: 700; color: #2c3e50; margin-bottom: 2px; }
.exec-vel-bar-label { font-size: 10px; color: #7f8c8d; margin-top: 4px; text-transform: uppercase; letter-spacing: .3px; }

@media (max-width: 768px) {
    .exec-row { grid-template-columns: 1fr; }
    .exec-week-item { grid-template-columns: 1fr; }
    .exec-workload-row { grid-template-columns: 1fr; }
}

/* === ENTREGAVEIS SUB-FORM (waves e sprints) === */
.entreg-subform { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; margin-top: 4px; }
.entreg-subform .entreg-add { padding: 8px 12px; font-size: 12px; min-height: 38px; }
.entreg-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.entreg-item { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; align-items: center; padding: 6px 10px; background: #f8f9fa; border-radius: 6px; font-size: 13px; }
.entreg-item-desc { color: #2c3e50; }
.entreg-item-date { color: #7f8c8d; font-size: 12px; }
.entreg-item-del { color: var(--red); cursor: pointer; font-size: 16px; padding: 2px 8px; border-radius: 4px; }
.entreg-item-del:hover { background: var(--red); color: #fff; }
.entreg-empty { padding: 8px; font-size: 12px; color: #95a5a6; text-align: center; font-style: italic; }

/* === KPI HELP BADGE === */
.kpi-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    border: 1px solid #d5dbdf;
    transition: background .15s, color .15s;
    user-select: none;
}
.kpi-help:hover, .kpi-help:focus {
    background: var(--blue, #3498db);
    color: #fff;
    outline: none;
    border-color: var(--blue, #3498db);
}
/* Quando dentro de header escuro/branco (ex: th de tabela) */
.exec-table th .kpi-help,
.aging-table th .kpi-help { background: #fff; color: #2c3e50; border-color: #d5dbdf; }
.exec-table th .kpi-help:hover,
.aging-table th .kpi-help:hover { background: var(--blue, #3498db); color: #fff; }

.kpi-help-tip {
    position: fixed;
    z-index: 99999;
    display: none;
    max-width: 360px;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}
.kpi-help-tip-title {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}
.kpi-help-tip-section { margin-top: 8px; }
.kpi-help-tip-section:first-of-type { margin-top: 0; }
.kpi-help-tip-h {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #5dade2;
    margin-bottom: 3px;
}
.kpi-help-tip-body { color: #ecf0f1; }

/* === MÉTRICAS / KPIs === */
.metricas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metrica-card { background: #fff; border: 1px solid #ecf0f1; border-radius: 8px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.metrica-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #7f8c8d; margin-bottom: 6px; }
.metrica-card-value { font-size: 24px; font-weight: 800; color: #2c3e50; line-height: 1; }
.metrica-card-sub { font-size: 11px; color: #7f8c8d; margin-top: 4px; }
.metrica-card.good .metrica-card-value { color: var(--green); }
.metrica-card.warn .metrica-card-value { color: #e67e22; }
.metrica-card.bad  .metrica-card-value { color: var(--red); }
.metrica-card.good { background: linear-gradient(180deg, #f0faf4 0%, #fff 60%); }
.metrica-card.warn { background: linear-gradient(180deg, #fff8e8 0%, #fff 60%); }
.metrica-card.bad  { background: linear-gradient(180deg, #fdecea 0%, #fff 60%); }
.metrica-card.neutral { background: linear-gradient(180deg, #f4f6f8 0%, #fff 60%); }
.metrica-card-value-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.metrica-card-value-row .metrica-card-value { margin-bottom: 0; }
.metrica-card .exec-hero-pill { font-size: 10px; padding: 4px 10px; letter-spacing: .5px; }
.metrica-card .exec-hero-msg { font-size: 11px; padding: 5px 8px; margin: 4px 0 6px 0; line-height: 1.4; }

/* === Chips de filtro de operações no dashboard === */
.op-id-chip {
    cursor: pointer;
    background: #eef2f5;
    color: #5a6877;
    border: 1px solid #dde3e9;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    user-select: none;
    transition: background .12s, color .12s, border-color .12s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.op-id-chip-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.6);
}
.op-id-chip.active {
    background: #2980b9;
    color: #fff;
    border-color: #1f5f8b;
}
.op-id-chip:hover {
    background: #2980b9;
    color: #fff;
    border-color: #1f5f8b;
}
.op-id-chip.active:hover {
    background: #eef2f5;
    color: #5a6877;
    border-color: #dde3e9;
}
.op-id-chip-clear {
    cursor: pointer;
    background: transparent;
    color: #c0392b;
    border: 1px dashed #c0392b;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 800;
    user-select: none;
    transition: background .12s, color .12s;
    white-space: nowrap;
}
.op-id-chip-clear:hover {
    background: #c0392b;
    color: #fff;
}

/* === SPI: visual suave (pastel + texto preto). Status do projeto já carrega o destaque forte;
 *     SPI é KPI de apoio, não deve competir visualmente com o status geral. === */
.metrica-card.spi-soft,
.metrica-card.spi-soft.good,
.metrica-card.spi-soft.warn,
.metrica-card.spi-soft.bad,
.metrica-card.spi-soft.neutral { background: #fafbfc; border-color: #e3e7eb; }
.metrica-card.spi-soft .metrica-card-value { color: #1f2937; }

.exec-hero-card.spi-soft,
.exec-hero-card.spi-soft.good,
.exec-hero-card.spi-soft.warn,
.exec-hero-card.spi-soft.bad,
.exec-hero-card.spi-soft.neutral { background: #fafbfc; }
.exec-hero-card.spi-soft::before { background: #cfd6dc; }
.exec-hero-card.spi-soft .exec-hero-value { color: #1f2937; }

.exec-hero-pill.spi-soft.good,
.exec-hero-pill.pill-soft.good    { background: #d5f5e3; color: #1f2937; border-color: #b9e5cb; }
.exec-hero-pill.spi-soft.warn,
.exec-hero-pill.pill-soft.warn    { background: #fdf2d3; color: #1f2937; border-color: #f0e0a8; }
.exec-hero-pill.spi-soft.bad,
.exec-hero-pill.pill-soft.bad     { background: #fadbd8; color: #1f2937; border-color: #f1b9b3; }
.exec-hero-pill.spi-soft.neutral,
.exec-hero-pill.pill-soft.neutral { background: #ecf0f1; color: #1f2937; border-color: #d5dbdf; }

.exec-hero-msg.spi-soft,
.exec-hero-msg.pill-soft           { background: #f8f9fa; color: #1f2937; font-weight: 400; border-left-color: #d5dbdf; }
.exec-hero-msg.spi-soft.good,
.exec-hero-msg.pill-soft.good      { background: #f0faf4; border-left-color: #b9e5cb; color: #1f2937; font-weight: 400; }
.exec-hero-msg.spi-soft.warn,
.exec-hero-msg.pill-soft.warn      { background: #fdf8e7; border-left-color: #f0e0a8; color: #1f2937; font-weight: 400; }
.exec-hero-msg.spi-soft.bad,
.exec-hero-msg.pill-soft.bad       { background: #fdeeec; border-left-color: #f1b9b3; color: #1f2937; font-weight: 400; }
.exec-hero-msg.spi-soft.neutral,
.exec-hero-msg.pill-soft.neutral   { background: #f8f9fa; border-left-color: #d5dbdf; color: #1f2937; font-weight: 400; }

.metricas-section { margin-top: 16px; }
.metricas-section-title { font-size: 13px; font-weight: 700; color: #2c3e50; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }

.velocity-bar-row { display: grid; grid-template-columns: 180px 1fr 80px; gap: 10px; align-items: center; padding: 6px 0; }
.velocity-bar-name { font-size: 13px; color: #2c3e50; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.velocity-bar-track { height: 18px; background: #ecf0f1; border-radius: 4px; overflow: hidden; position: relative; }
.velocity-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green) 0%, #27ae60 100%); transition: width 0.3s; }
.velocity-bar-count { font-size: 12px; color: #7f8c8d; text-align: right; }

.aging-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.aging-table th { text-align: left; padding: 6px 8px; background: #f8f9fa; color: #2c3e50; font-weight: 700; font-size: 11px; text-transform: uppercase; border-bottom: 2px solid #ecf0f1; }
.aging-table td { padding: 6px 8px; border-bottom: 1px solid #ecf0f1; }
.aging-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.aging-tag.fresh { background: #d5f5e3; color: #1e8449; }
.aging-tag.warn  { background: #fdebd0; color: #c87f0a; }
.aging-tag.stale { background: #f5b7b1; color: #922b21; }

@media (max-width: 768px) {
    .entreg-subform { grid-template-columns: 1fr; }
    .entreg-item { grid-template-columns: 1fr; }
    .velocity-bar-row { grid-template-columns: 1fr; }
}

/* === PESSOA MULTI-SELECT (clone do equipe-ms) === */
.pessoa-ms { position: relative; }
.pessoa-ms-display { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; background: #fff; min-height: 42px; user-select: none; transition: border-color 0.2s; }
.pessoa-ms-display:hover { border-color: var(--blue); }
.pessoa-ms.open .pessoa-ms-display { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.pessoa-ms-val { font-size: 14px; color: var(--text-dark); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pessoa-ms-val.placeholder { color: #bdc3c7; }
.pessoa-ms-arrow { font-size: 11px; color: #95a5a6; margin-left: 6px; flex-shrink: 0; transition: transform 0.2s; display: inline-block; }
.pessoa-ms.open .pessoa-ms-arrow { transform: rotate(180deg); }
.pessoa-ms-drop { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); z-index: 600; min-width: 260px; }
.pessoa-ms.open .pessoa-ms-drop { display: block; }
.pessoa-ms-search { width: 100%; padding: 9px 12px; border: none; border-bottom: 1px solid #f1f2f6; border-radius: 8px 8px 0 0; font-size: 13px; outline: none; background: #fafbfc; }
.pessoa-ms-search:focus { background: #fff; }
.pessoa-ms-list { max-height: 200px; overflow-y: auto; padding: 4px 0; }
.pessoa-ms-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--text-dark); transition: background 0.1s; }
.pessoa-ms-item:hover { background: #f0f4f8; }
.pessoa-ms-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: var(--blue); }
.pessoa-ms-item-meta { font-size: 11px; color: var(--text-light); margin-left: auto; }
.pessoa-ms-group { display: flex; align-items: center; gap: 6px; padding: 6px 12px; margin-top: 2px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #5a6877; background: #eef2f5; border-top: 1px solid #dde3e9; border-bottom: 1px solid #dde3e9; position: sticky; top: 0; z-index: 1; }
.pessoa-ms-group:first-child { margin-top: 0; border-top: none; }
.pessoa-ms-group-count { background: #cfd6dc; color: #1f2937; border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 700; }
.pessoa-ms-ok { width: 100%; padding: 8px; background: var(--blue); color: #fff; border: none; border-radius: 0 0 8px 8px; cursor: pointer; font-size: 13px; font-weight: bold; border-top: 1px solid #f1f2f6; }
.pessoa-ms-ok:hover { background: var(--blue-hover, #2980b9); }
body.viewer-mode .pessoa-ms-display { pointer-events: none !important; cursor: default !important; background: #f4f6f8 !important; }

/* === STATUS BOARD (O que fizemos / fazemos / faremos) === */
.sb-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.sb-col { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07); min-height: 160px; }
.sb-col-header { padding: 14px 16px 13px; display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 13px; letter-spacing: 0.2px; }
.sb-col-done  .sb-col-header { background: linear-gradient(135deg,#e8f5e9,#c8e6c9); color: #2e7d32; border-bottom: 2px solid #a5d6a7; }
.sb-col-doing .sb-col-header { background: linear-gradient(135deg,#e3f2fd,#bbdefb); color: #1565c0; border-bottom: 2px solid #90caf9; }
.sb-col-todo  .sb-col-header { background: linear-gradient(135deg,#f3e5f5,#e1bee7); color: #6a1b9a; border-bottom: 2px solid #ce93d8; }
.sb-col-done  .sb-col-body { background: #f7fdf7; }
.sb-col-doing .sb-col-body { background: #f4f9ff; }
.sb-col-todo  .sb-col-body { background: #fdf5ff; }
.sb-col-body { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sb-card { background: #fff; border-radius: 9px; padding: 12px 13px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); border-left: 4px solid transparent; transition: transform 0.15s, box-shadow 0.15s; font-size: 13px; }
.sb-card:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,0.11); }
.sb-col-done  .sb-card { border-left-color: #4caf50; }
.sb-col-doing .sb-card { border-left-color: #2196f3; }
.sb-col-todo  .sb-card { border-left-color: #9c27b0; }
.sb-col-doing .sb-card.sb-overdue { border-left-color: #e53935; }
.sb-card-name { font-weight: 700; color: #2c3e50; line-height: 1.35; word-break: break-word; }
.sb-card-dates { font-size: 11px; color: #7f8c8d; }
.sb-progress-wrap { margin: 8px 0 2px; }
.sb-progress-bar { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.sb-progress-fill { height: 100%; border-radius: 3px; }
.sb-progress-pct { font-size: 11px; font-weight: 700; color: #546e7a; margin-top: 3px; text-align: right; }
.sb-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.sb-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.sb-badge-backlog     { background: #ecf0f1; color: #7f8c8d; }
.sb-badge-in_progress { background: #e3f2fd; color: #1976d2; }
.sb-badge-review      { background: #fff8e1; color: #f57f17; }
.sb-badge-attention   { background: #fff3e0; color: #e65100; }
.sb-badge-issues      { background: #fce4ec; color: #c62828; }
.sb-badge-blocked     { background: #ffebee; color: #b71c1c; }
.sb-badge-done        { background: #e8f5e9; color: #2e7d32; }
.sb-sem-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.sb-overdue-tag { color: #e53935; font-size: 10px; font-weight: 800; margin-left: 5px; }
.sb-col-counter { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 12px; font-weight: 900; margin-left: auto; }
.sb-col-done  .sb-col-counter { background: #2e7d32; color: #fff; }
.sb-col-doing .sb-col-counter { background: #1565c0; color: #fff; }
.sb-col-todo  .sb-col-counter { background: #6a1b9a; color: #fff; }
.sb-empty { text-align: center; color: #bdc3c7; padding: 28px 10px; font-size: 13px; font-style: italic; }
.sb-resp-tag { font-size: 10px; color: #7f8c8d; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-card-title-row { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 5px; }
.sb-card-title-row .sb-badge { flex-shrink: 0; margin-top: 1px; }
.sb-card-title-row .sb-card-name { margin: 0; flex: 1; min-width: 0; }
.sb-card-name { font-weight: 700; color: #2c3e50; line-height: 1.35; word-break: break-word; }
.sb-badge-todo { background: #f3e5f5; color: #6a1b9a; }
.sb-progress-pct { display: flex; align-items: center; justify-content: flex-end; }
/* Chips header accordion */
.sb-hdr-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; margin-left: 5px; }
.sb-hdr-done  { background: #e8f5e9; color: #2e7d32; }
.sb-hdr-doing { background: #e3f2fd; color: #1565c0; }
.sb-hdr-todo  { background: #f3e5f5; color: #6a1b9a; }
.sb-hdr-total { background: #f1f3f5; color: #546e7a; }
@media (max-width: 860px) { .sb-board { grid-template-columns: 1fr; } }
