/* Agents (agents.daniloborguetti.com.br) — tema light do design system GTM Pro (gtmpro/DESIGN.md) */
@font-face {
  font-family: 'Aeonik';
  src: url('/assets/fonts/Aeonik-Bold-1.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg:        #F7F7FA;
  --bg-card:   #FFFFFF;
  --blue:      #2E6FE0;
  --blue-deep: #1A42FF;
  --grad:      linear-gradient(135deg, #1A42FF 0%, #58AEFF 100%);
  --text:      #0A0B18;
  --muted:     #5A637A;
  --faint:     #8A92A6;
  --border:    rgba(10,11,24,.08);
  --border-md: rgba(10,11,24,.14);
  --r:         12px;
  --r-lg:      18px;
  --ok:        #1F9D62;
  --warn:      #B7791F;
  --danger:    #D64545;
  --shadow:    0 10px 30px rgba(10,11,24,.06);
  --area-hub:       #111827;
  --area-gestao:    #2E6FE0;
  --area-marketing: #F2742B;
  --area-comercial: #1E9E6A;
  --area-infra:     #64748B;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Sora', sans-serif; background: var(--bg); color: var(--text); font-size: .9rem; line-height: 1.55; min-height: 100vh; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, .wordmark { font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; width: 100%; }
.small { font-size: .78rem; }
.sub { color: var(--muted); }
.lbl { font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.link { color: var(--blue); font-weight: 500; }
.link:hover { text-decoration: underline; }
.empty { color: var(--faint); padding: 28px 8px; text-align: center; font-size: .85rem; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Topo ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(247,247,250,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.wm-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--grad); }
.tabs { display: flex; gap: 4px; }
.tab { padding: 8px 14px; border-radius: 100px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 2px rgba(10,11,24,.06), 0 0 0 1px var(--border); }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: var(--blue); color: #fff; font-size: .68rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 500; color: var(--blue); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 rgba(46,111,224,.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,111,224,.45); } 70% { box-shadow: 0 0 0 8px rgba(46,111,224,0); } 100% { box-shadow: 0 0 0 0 rgba(46,111,224,0); } }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { background: var(--bg-card); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.field input { height: 44px; border: 1px solid var(--border-md); border-radius: 10px; padding: 0 14px; background: #fff; font-size: 1rem; }
.field input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,111,224,.14); }
.err { color: var(--danger); font-size: .8rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--grad); color: #fff; font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; padding: 12px 24px; border-radius: 100px; transition: filter .2s, transform .2s; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-block { width: 100%; }

/* ---------- Time ---------- */
.view { padding: 28px 0 60px; }
.hub { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 26px; cursor: pointer; transition: box-shadow .2s; }
.hub:hover { box-shadow: var(--shadow); }
.hub-main { display: flex; align-items: center; gap: 20px; min-width: 0; }
.hub-name { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; }
.hub-role { color: var(--muted); margin-top: 2px; }
.hub-stats { display: flex; gap: 26px; }
.stat { text-align: right; }
.stat b { display: block; font-family: 'Aeonik', 'Sora', sans-serif; font-size: 1.3rem; line-height: 1.1; }
.stat span { font-size: .72rem; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.avatar { border-radius: 50%; background: #E8E9EF; object-fit: cover; flex: 0 0 auto; }
.avatar-fallback { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; color: #fff; flex: 0 0 auto; }
.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.area-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 12px; }
.area-dot { width: 8px; height: 8px; border-radius: 50%; }
.area-head h2 { font-size: .95rem; }
.area-count { margin-left: auto; color: var(--faint); font-size: .78rem; }
.area { min-width: 0; }
.cards { display: grid; gap: 10px; min-width: 0; }
.card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; text-align: left; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--border-md); }
.card-body { min-width: 0; flex: 1; }
.card-name { font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; font-size: .98rem; display: flex; align-items: baseline; gap: 8px; }
.card-slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .66rem; color: var(--faint); font-weight: 400; }
.card-role { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: .66rem; padding: 2px 8px; border-radius: 100px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip.more { border-style: dashed; }
.badge { font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; color: #fff; }

/* ---------- Drawer ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(10,11,24,.28); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg-card); z-index: 31; overflow-y: auto; padding: 28px 28px 40px; box-shadow: -12px 0 40px rgba(10,11,24,.12); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-close { position: absolute; top: 14px; right: 14px; }
.d-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.d-head h2 { font-size: 1.5rem; }
.d-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.d-sec { margin-top: 20px; }
.d-sec h3 { font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.d-desc { font-size: .85rem; color: var(--muted); line-height: 1.65; }
.d-kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: .82rem; }
.d-kv dt { color: var(--faint); }
.d-kv dd code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.d-runs { display: grid; gap: 6px; }
.d-run { display: flex; gap: 10px; align-items: center; font-size: .8rem; color: var(--muted); padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; width: 100%; text-align: left; }
.d-run:hover { border-color: var(--border-md); color: var(--text); }
.d-run .when { margin-left: auto; color: var(--faint); font-size: .72rem; white-space: nowrap; }

/* ---------- Execuções ---------- */
.runs { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.runs-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; max-height: calc(100vh - 130px); overflow-y: auto; position: sticky; top: 76px; }
.runs-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.runs-ul { list-style: none; display: grid; gap: 6px; }
.run-item { width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--r); border: 1px solid transparent; display: grid; gap: 6px; }
.run-item:hover { background: var(--bg); }
.run-item.is-sel { background: var(--bg); border-color: var(--border-md); }
.run-top { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: var(--faint); }
.run-prompt { font-size: .83rem; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.run-item.is-stub .run-prompt { color: var(--faint); font-style: italic; }
.run-agents { display: flex; align-items: center; gap: 0; }
.run-agents .avatar, .run-agents .avatar-fallback { width: 22px; height: 22px; font-size: .55rem; border: 2px solid var(--bg-card); margin-left: -6px; }
.run-agents .avatar:first-child, .run-agents .avatar-fallback:first-child { margin-left: 0; }
.run-agents .more { font-size: .68rem; color: var(--faint); margin-left: 6px; }
.status { width: 8px; height: 8px; border-radius: 50%; background: #C9CDD8; flex: 0 0 auto; }
.status.running { background: var(--blue); animation: pulse 1.6s infinite; }
.status.done { background: var(--ok); }
.status.stale { background: var(--warn); }
.proj { padding: 1px 8px; border-radius: 100px; border: 1px solid var(--border); font-size: .66rem; color: var(--muted); }
.flow-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); min-height: 420px; padding: 18px 18px 14px; position: relative; }
.flow-head { display: grid; gap: 4px; margin-bottom: 10px; }
.flow-title { font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.flow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .76rem; color: var(--faint); }
.flow-plan { font-size: .8rem; color: var(--muted); }
.flow-plan b { color: var(--text); font-weight: 600; }
.flow-scroll { overflow-x: auto; }
.flow { display: block; font-family: 'Sora', sans-serif; }
.flow .edge { stroke: #CBD0DC; stroke-width: 1.6; fill: none; }
.flow .edge.running { stroke: var(--blue); stroke-dasharray: 6 6; animation: dash 1s linear infinite; }
.flow .edge.done { stroke: #AEB5C6; }
@keyframes dash { to { stroke-dashoffset: -24; } }
.flow .node rect { fill: #fff; stroke: var(--border-md); }
.flow .node.running rect { stroke: var(--blue); stroke-width: 1.8; }
.flow .node.hub rect { stroke: var(--area-hub); }
.flow .node.demand rect { fill: var(--bg); stroke: var(--border); }
.flow .node .name { font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; font-size: 13px; fill: var(--text); stroke: none; }
.flow .node .desc { font-size: 11px; fill: var(--muted); stroke: none; }
.flow .node .skills { font-size: 10px; fill: var(--faint); stroke: none; }
.flow .node .dur { font-size: 10px; fill: var(--faint); stroke: none; }
.flow .ring { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 40 90; animation: spin 1.4s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.flow .check { stroke: var(--ok); stroke-width: 2; }
.flow .node.stale .check { stroke: var(--warn); }
.flow .fallback-text { font-family: 'Aeonik', 'Sora', sans-serif; font-weight: 700; font-size: 13px; fill: #fff; stroke: none; }
.timeline { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.timeline summary { font-size: .74rem; color: var(--faint); cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.timeline table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .76rem; }
.timeline td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--muted); }
.timeline td:first-child { white-space: nowrap; color: var(--faint); font-variant-numeric: tabular-nums; }
.timeline td:nth-child(2) { white-space: nowrap; }
.timeline td b { color: var(--text); font-weight: 600; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .runs { grid-template-columns: minmax(0, 1fr); }
  .runs-list { position: static; max-height: 300px; }
}
@media (max-width: 640px) {
  .top-in { gap: 14px; }
  .wordmark { font-size: 1rem; }
  #live-text { display: none; }
  .areas { grid-template-columns: minmax(0, 1fr); }
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub-main > div { min-width: 0; }
  .hub-stats { justify-content: flex-start; }
  .stat { text-align: left; }
  .drawer { padding: 24px 18px 40px; }
}
