/* =========================================================
   SWC PMO · eap.css — Sprint 3
   Estilos da view EAP/WBS: KPIs, tabs, tabela hierárquica, modal.
========================================================= */

/* ── Select do projeto no topbar ──────────────────── */
.swm-select {
  background: rgba(255, 255, 255, .05);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  min-width: 280px;
  cursor: pointer;
  transition: border-color .15s;
}
.swm-select:hover  { border-color: rgba(245, 158, 11, .35); }
.swm-select:focus  { outline: none; border-color: var(--gold, #f59e0b); }
.swm-select option { background: #1a1d2e; color: #e5e7eb; }

/* ── KPIs por dimensão + total geral ──────────────── */
.eap-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.eap-kpi {
  background: #161b27;
  border: 1px solid #252d3d;
  border-radius: 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--c, #60a5fa);
}
.eap-kpi--grand {
  background: radial-gradient(circle at top left, rgba(245,158,11,.15), transparent 60%), #161b27;
  border: 1px solid rgba(245, 158, 11, .3);
  border-left: 3px solid #f59e0b;
}
.eap-kpi__label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: #8892a4;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.eap-kpi__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 2px 0;
}
.eap-kpi__row strong { color: #cbd5e1; font-weight: 600; }
.eap-kpi__row span   { color: #f1f5f9; font-weight: 700; }
.eap-kpi__row .gold  { color: #fbbf24; }
.eap-kpi__row.muted strong,
.eap-kpi__row.muted span,
.eap-kpi__row.muted small { color: #8892a4; font-weight: 400; }

/* ── Abas de dimensão ─────────────────────────────── */
.eap-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.eap-tab {
  background: transparent;
  border: 0;
  padding: 10px 18px;
  color: #8892a4;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.eap-tab:hover  { color: #cbd5e1; }
.eap-tab.active {
  color: var(--c, #f59e0b);
  border-bottom-color: var(--c, #f59e0b);
}

/* ── Panel da árvore ──────────────────────────────── */
.eap-panel {
  background: #161b27;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 14px;
  overflow: hidden;
}
.eap-panel__hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .02);
}
.eap-panel__hd strong { font-size: 14px; color: #f3f4f6; }
.eap-panel__hd small  { color: #8892a4; font-size: 12px; margin-left: 8px; }

/* ── Tabela hierárquica ──────────────────────────── */
.eap-table-wrap { overflow-x: auto; }
.eap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.eap-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .03);
  color: #8892a4;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  white-space: nowrap;
}
.eap-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: #cbd5e1;
  vertical-align: middle;
}
.eap-table tbody tr:hover td { background: rgba(255, 255, 255, .02); }

.eap-col-name   { min-width: 280px; }
.eap-col-code   { color: #8892a4; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.eap-col-num    { text-align: right; font-variant-numeric: tabular-nums; }
.eap-col-un     { text-align: center; color: #8892a4; font-size: 12px; }
.eap-col-money  { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eap-col-money.gold { color: #fbbf24; font-weight: 700; }
.eap-col-acts   { text-align: right; white-space: nowrap; min-width: 100px; }

/* Linhas branch x leaf */
.eap-row--branch .eap-row__name { font-weight: 700; color: #f1f5f9; }
.eap-row--leaf   .eap-row__name { font-weight: 500; color: #cbd5e1; }
.eap-row__obs {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  font-style: italic;
}

/* Toggle expansão */
.eap-toggle {
  background: transparent;
  border: 0;
  color: #8892a4;
  cursor: pointer;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  padding: 0;
  margin-right: 4px;
  border-radius: 4px;
  transition: background .12s, color .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.eap-toggle:hover { background: rgba(255, 255, 255, .06); color: #fbbf24; }
.eap-toggle--leaf { color: #475569; cursor: default; }
.eap-toggle--leaf:hover { background: transparent; color: #475569; }

/* Ações da linha */
.eap-act {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #8892a4;
  width: 24px;
  height: 24px;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 2px;
  padding: 0;
  transition: all .12s;
}
.eap-act:hover { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .3); color: #fbbf24; }
.eap-act--danger:hover { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .3); color: #f87171; }

/* Empty state */
.eap-empty {
  text-align: center;
  padding: 48px 20px !important;
  color: #8892a4;
}
.eap-empty p { margin: 0; font-size: 13.5px; }

/* ── Modal EAP (compartilha o overlay genérico do swm-modal) ── */
.eap-modal { width: min(640px, 92vw); max-height: 90vh; overflow: hidden; }
.eap-modal .pmo-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.eap-modal .pmo-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #8892a4;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.eap-modal .pmo-form input,
.eap-modal .pmo-form select,
.eap-modal .pmo-form textarea {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .15s;
}
.eap-modal .pmo-form input:focus,
.eap-modal .pmo-form select:focus,
.eap-modal .pmo-form textarea:focus {
  outline: none;
  border-color: var(--gold, #f59e0b);
}

/* ── Loading / Error genéricos compartilhados ────── */
.pmo-loading,
.pmo-error {
  padding: 32px 20px;
  text-align: center;
  border-radius: 12px;
  background: #161b27;
  border: 1px solid rgba(255, 255, 255, .06);
  color: #8892a4;
  font-size: 13.5px;
}
.pmo-error { color: #fca5a5; border-color: rgba(239, 68, 68, .25); background: rgba(239, 68, 68, .06); }
