:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1c2333;
  --bg4: #242d3d;
  --text: #e6edf3;
  --text2: #8b949e;
  --text3: #484f58;
  --border: #21262d;
  --accent: #6c5ce7;
  --green: #00b894;
  --yellow: #fdcb6e;
  --red: #e17055;
  --blue: #0984e3;
  --sidebar-w: 240px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  font-size: 16px;
  font-weight: 700;
}
.sidebar-sub {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(108, 92, 231, 0.08);
  color: var(--text);
}
.nav-item.active {
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-icon {
  font-size: 16px;
}
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
}
.user-email {
  font-size: 10px;
  color: var(--text3);
}

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
}

/* ===== SUMMARY BAR ===== */
.summary-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
  overflow: hidden;
}
.summary-item {
  flex: 1;
  padding: 18px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.summary-item:last-child {
  border-right: none;
}
.summary-value {
  font-size: 28px;
  font-weight: 700;
}
.summary-label {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== PHASE SECTION ===== */
.phase-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== AGENT GRID ===== */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

/* ===== AGENT CARD ===== */
.agent-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 14px;
}
.agent-card:hover {
  background: var(--bg3);
  border-color: var(--bg4);
}
.agent-card .card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.agent-card .card-icon svg {
  width: 20px;
  height: 20px;
}
.card-body {
  flex: 1;
  min-width: 0;
}
.card-name {
  font-size: 14px;
  font-weight: 600;
}
.card-role {
  font-size: 12px;
  color: var(--text2);
  margin-top: 1px;
}
.card-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.badge-ativo {
  background: rgba(0, 184, 148, 0.15);
  color: var(--green);
}
.badge-aguardando {
  background: rgba(253, 203, 110, 0.15);
  color: var(--yellow);
}
.badge-futuro {
  background: rgba(72, 79, 88, 0.3);
  color: var(--text3);
}
.card-arrow {
  color: var(--text3);
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ===== AGENT DETAIL ===== */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 20px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.detail-back:hover {
  background: var(--bg3);
  color: var(--text);
}
.detail-header {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.detail-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-icon svg {
  width: 28px;
  height: 28px;
}
.detail-info {
  flex: 1;
}
.detail-info h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.detail-role {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 10px;
}
.detail-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}
.detail-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.penta-badge {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 8px;
}
.penta-dots {
  display: flex;
  gap: 3px;
}
.penta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.penta-dot.on {
  background: var(--accent);
}

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.metric-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.metric-value {
  font-size: 24px;
  font-weight: 700;
}

/* ===== DETAIL SECTIONS ===== */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.detail-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.detail-box h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text2);
}
.func-list {
  list-style: none;
}
.func-list li {
  font-size: 12px;
  color: var(--text2);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.func-list li:last-child {
  border-bottom: none;
}
.func-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.hist-list {
  list-style: none;
}
.hist-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.hist-list li:last-child {
  border-bottom: none;
}
.hist-date {
  font-size: 10px;
  color: var(--text3);
  min-width: 50px;
  padding-top: 2px;
}
.hist-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}
.alert-list {
  list-style: none;
}
.alert-list li {
  font-size: 12px;
  color: var(--yellow);
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(253, 203, 110, 0.06);
  border-left: 3px solid var(--yellow);
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}

/* ===== VISION GRID ===== */
.vision-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.vision-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.vision-card h3 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.vision-card.good h3 {
  color: var(--green);
}
.vision-card.warn h3 {
  color: var(--yellow);
}
.vision-card.next h3 {
  color: var(--blue);
}
.vision-card ul {
  list-style: none;
}
.vision-card li {
  font-size: 11px;
  color: var(--text2);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
}
.vision-card li:last-child {
  border-bottom: none;
}

/* ===== EDITA FACIL PLACEHOLDER ===== */
.ef-placeholder {
  text-align: center;
  padding: 80px 40px;
  background: var(--bg2);
  border: 2px dashed var(--border);
  border-radius: 14px;
  margin-top: 20px;
}
.ef-placeholder h2 {
  font-size: 20px;
  color: var(--text2);
  margin-bottom: 10px;
}
.ef-placeholder p {
  font-size: 13px;
  color: var(--text3);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}
.ef-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  background: rgba(255, 159, 67, 0.12);
  color: #ff9f43;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== STATS PILLS ===== */
.stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pill {
  font-size: 10px;
  padding: 3px 10px;
  background: var(--bg);
  border-radius: 12px;
  color: var(--text2);
}
.pill b {
  color: var(--text);
}

/* ===== MOBILE ===== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu {
    display: block;
  }
  .overlay.show {
    display: block;
  }
  .main {
    margin-left: 0;
    padding: 20px 16px;
    padding-top: 56px;
  }
  .agent-grid {
    grid-template-columns: 1fr;
  }
  .summary-bar {
    flex-direction: column;
  }
  .summary-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .summary-item:last-child {
    border-bottom: none;
  }
  .detail-cols {
    grid-template-columns: 1fr;
  }
  .vision-grid {
    grid-template-columns: 1fr;
  }
  .detail-header {
    flex-direction: column;
  }
  .detail-meta {
    align-items: flex-start;
    flex-direction: row;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
