/* Central Business: só o que o styles.css do Ads Command Center não tem. Usa os tokens dele. */
.modal-overlay[hidden] { display: none; }
a.nav-item { text-decoration: none; }

/* Pílulas de status */
.biz-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.biz-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.biz-pill.ok   { background: var(--green-bg);  color: var(--green); }
.biz-pill.warn { background: var(--yellow-bg); color: var(--yellow); }
.biz-pill.bad  { background: var(--red-bg);    color: var(--red); }
.biz-pill.wait { background: var(--lilac-bg);  color: var(--lilac); }
.biz-pill.off  { background: var(--bg2);       color: var(--text3); }
.biz-pill.live { background: var(--accent-light); color: var(--magenta); }
.biz-pill.live::before { animation: bizPulso 1.2s ease-in-out infinite; }
@keyframes bizPulso { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .biz-pill.live::before { animation: none; } }

/* Cards de setor */
.biz-setores { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(540px, 100%), 1fr)); gap: 16px; }
.biz-setor-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; transition: transform var(--transition), box-shadow var(--transition); }
.biz-setor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.biz-setor-card:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.biz-setor-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.biz-setor-nome { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.biz-setor-desc { color: var(--text2); font-size: 13px; margin: 6px 0 18px; line-height: 1.5; }
.biz-setor-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.biz-setor-stats div { background: var(--bg2); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
.biz-setor-stats b { display: block; font-family: var(--font-display); font-weight: 300; font-size: 24px; }
.biz-setor-stats small { font-size: 13px; color: var(--text3); }
.biz-setor-stats span { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin-top: 2px; }
.biz-setor-stats .chama b { color: var(--lilac); }
.biz-setor-stats .alerta b { color: var(--red); }
.biz-setor-ult { font-size: 12px; color: var(--text2); margin-top: 16px; }
.biz-setor-ver { font-size: 12px; font-weight: 800; color: var(--magenta); margin-top: 10px; }

/* Detalhe do setor */
.biz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.biz-banner { background: var(--yellow-bg); border: 1px solid var(--yellow-border); color: var(--text); border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 700; margin-bottom: 16px; }
.biz-funil { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.biz-sec { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); margin-top: 16px; }
.biz-sec .section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.biz-count { background: var(--accent-light); color: var(--magenta); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.biz-vazio { color: var(--text3); font-size: 13px; padding: 8px 0; }
.biz-duas { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.biz-filtro { margin-left: auto; font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); }

/* Organograma */
.biz-org { display: flex; flex-direction: column; align-items: stretch; }
.biz-org-topo { display: flex; justify-content: center; }
.biz-org-topo .biz-agente { max-width: 340px; border-color: var(--magenta); }
.biz-org-linha { height: 18px; width: 2px; background: var(--border); margin: 0 auto; }
.biz-org-grupos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; border-top: 2px solid var(--border); padding-top: 14px; }
.biz-org-grupo { display: flex; flex-direction: column; gap: 10px; }
.biz-org-gnome { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; color: var(--text2); text-align: center; }
.biz-org-base { margin-top: 14px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text2); background: var(--bg2); border-radius: var(--radius-sm); padding: 10px; }
.biz-agente { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: transform var(--transition), box-shadow var(--transition); }
.biz-agente:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.biz-agente:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.biz-agente.fria { opacity: .62; border-style: dashed; }
.biz-ag-top { display: flex; justify-content: space-between; align-items: center; }
.biz-ag-num { font-family: var(--font-display); font-weight: 300; color: var(--text3); font-size: 13px; }
.biz-ag-nome { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 6px 0 3px; color: var(--text); }
.biz-ag-ult { font-size: 12px; color: var(--text2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.biz-ag-tag { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--purple); background: var(--lilac-bg); padding: 2px 8px; border-radius: 6px; }
[data-theme="dark"] .biz-ag-tag { color: var(--lilac); }
.biz-ag-tag.fria { color: var(--text2); background: var(--bg2); }

/* Feed */
.biz-feed { list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: 520px; overflow-y: auto; }
.biz-feed.mini { max-height: 240px; }
.biz-feed li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); }
.biz-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--bg2); color: var(--text2); }
.t-inicio .biz-ic { background: var(--accent-light); color: var(--magenta); }
.t-fim .biz-ic { background: var(--green-bg); color: var(--green); }
.t-erro .biz-ic { background: var(--red-bg); color: var(--red); }
.t-alerta .biz-ic { background: var(--yellow-bg); color: var(--yellow); }
.t-aprovacao .biz-ic { background: var(--lilac-bg); color: var(--lilac); }
.biz-feed-tit { font-size: 13px; }
.biz-feed-det { font-size: 12px; color: var(--text2); margin-top: 2px; white-space: pre-wrap; }
.biz-feed-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.biz-feed-meta a { color: var(--magenta); }

/* Aprovações */
.biz-aprov { border: 1px solid var(--lilac-bg); background: var(--card-hover); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.biz-aprov-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.biz-aprov-top span { font-size: 12px; color: var(--text2); }
.biz-aprov-txt { font-size: 13px; margin: 8px 0 12px; white-space: pre-wrap; line-height: 1.5; }
.biz-aprov-bt { display: flex; gap: 8px; flex-wrap: wrap; }

/* Regras */
.biz-regras { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text); line-height: 1.45; }
.biz-fria { font-size: 13px; color: var(--text2); line-height: 1.5; background: var(--bg2); border-radius: var(--radius-sm); padding: 12px; }

/* Modal do agente */
.biz-missao { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.biz-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text2); margin-bottom: 14px; }
.biz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#modal-corpo h4 { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; color: var(--text2); margin: 14px 0 6px; }
#modal-corpo ul:not(.biz-feed) { padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.biz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.biz-chips span { font-size: 12px; background: var(--bg2); border-radius: 999px; padding: 4px 10px; }
.biz-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.biz-textarea { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.modal-title .biz-pill { margin-left: 8px; vertical-align: middle; }

/* Toast */
.biz-toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 400; }
.biz-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-family: var(--font-display); font-weight: 300; font-size: 26px; }
.login-card p { color: var(--text2); font-size: 13px; margin-top: -6px; margin-bottom: 8px; }
.login-card label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; color: var(--text2); }
.login-card input { font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.login-card input:focus-visible { outline: 2px solid var(--magenta); }
.login-erro { color: var(--red); font-size: 13px; min-height: 18px; }

@media (max-width: 1000px) {
  .biz-duas { grid-template-columns: 1fr; }
  .biz-org-grupos { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .biz-setor-stats { grid-template-columns: repeat(3, 1fr); }
  .biz-cols { grid-template-columns: 1fr; }
  .topbar-sub, #refresh-time { display: none; }
}
