:root {
  --gg-blue-dark: #1A56A5; --gg-blue-med: #2E7DD1; --gg-teal: #00C9A7;
  --ink: #0f172a; --muted: #64748b; --bg: #f1f5f9; --card: #fff; --line: #e2e8f0;
  --green: #16a34a; --red: #dc2626; --amber: #d97706;
  --radius: 14px; --shadow: 0 6px 24px rgba(15,23,42,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: linear-gradient(180deg, var(--gg-blue-dark), #0e3a75); color: #fff;
  padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.brand img { width: 46px; height: 46px; border-radius: 12px; background: #fff; padding: 4px; object-fit: contain; }
.brand strong { display: block; font-size: 15px; } .brand span { font-size: 11.5px; opacity: .8; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin: 14px 12px 4px; }
.sidebar nav a { padding: 10px 14px; border-radius: 10px; font-size: 14.5px; opacity: .88; display: flex; gap: 10px; align-items: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.sidebar nav a.on { background: rgba(255,255,255,.18); opacity: 1; font-weight: 600; box-shadow: inset 3px 0 0 var(--gg-teal); }
.sidebar .rodape { font-size: 12px; opacity: .75; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; line-height: 1.5; }
.content { flex: 1; padding: 28px 36px; max-width: 1240px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; } .page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card, .panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card { padding: 18px; } .card .label { font-size: 13px; color: var(--muted); }
.card .valor { font-size: 26px; font-weight: 700; margin-top: 6px; } .card .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.panel { padding: 22px; margin-bottom: 18px; } .panel h2 { font-size: 16px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.agentes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.agente { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.agente .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agente p { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.on { background: #dcfce7; color: #166534; } .pill.off { background: #f1f5f9; color: #64748b; }
.pill.fase { background: #fef3c7; color: #92400e; } .pill.ativo { background: #ccfbf1; color: #0f766e; }
.pill.rascunho { background: #e0e7ff; color: #3730a3; } .pill.aprovado { background: #dcfce7; color: #166534; }
.pill.publicado { background: #ccfbf1; color: #0f766e; } .pill.descartado { background: #fee2e2; color: #991b1b; }
.pill.sempreco { background: #fef3c7; color: #92400e; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafcff; }
.tabela-wrap { overflow-x: auto; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gg-teal); border-color: transparent; }
input[type=checkbox] { width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.campo { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
.btn { background: var(--gg-blue-dark); color: #fff; border: none; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.btn:hover { background: var(--gg-blue-med); } .btn.teal { background: #0f9e85; } .btn.teal:hover { background: var(--gg-teal); }
.btn.ghost { background: var(--bg); color: var(--ink); } .btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.tabs a.on { background: var(--gg-blue-dark); color: #fff; border-color: var(--gg-blue-dark); font-weight: 600; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.ok { background: #f0fdf4; color: #166534; } .flash.erro { background: #fef2f2; color: #991b1b; } .flash.info { background: #eff6ff; color: #1e40af; }
.aviso { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 12.5px; }
.bloco { background: var(--bg); border-radius: 10px; padding: 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; position: relative; }
.copiar { position: absolute; top: 8px; right: 8px; }
.bloco:has(.copiar) { padding-top: 46px; }
.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.slide { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: linear-gradient(160deg, #fff, #f0f9ff); }
.slide .n { font-size: 11px; font-weight: 700; color: var(--gg-blue-med); text-transform: uppercase; }
.slide h3 { font-size: 15px; margin: 4px 0 6px; } .slide p { font-size: 13.5px; line-height: 1.45; }
.slide .prompt { font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { background: #eff6ff; color: var(--gg-blue-dark); padding: 3px 10px; border-radius: 99px; font-size: 12.5px; }
.conta { font-size: 11.5px; font-weight: 700; } .conta.ok { color: var(--green); } .conta.ruim { color: var(--red); }
ul.lista { padding-left: 18px; } ul.lista li { margin-bottom: 6px; font-size: 14px; line-height: 1.45; }
.alerta li { color: #92400e; }
.artes { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.artes a { flex: 0 0 auto; scroll-snap-align: start; }
.artes img { height: 340px; min-width: 272px; background: var(--bg); border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); display: block; }
.refazer { display: flex; gap: 8px; margin-top: 12px; }
.refazer input { flex: 1; padding: 7px 10px; font-size: 13px; }
.edit-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.edit-item .n { font-size: 11px; font-weight: 700; color: var(--gg-blue-med); text-transform: uppercase; }
textarea.mono { font-family: Consolas, monospace; font-size: 13px; min-height: 420px; }
@media (max-width: 900px) { .sidebar { display: none; } .content { padding: 16px; } .grid-2 { grid-template-columns: 1fr; } }

/* Gestorzinhos — mascotes robôs dos agentes */
.robo { flex: none; display: inline-block; vertical-align: middle; filter: drop-shadow(0 3px 6px rgba(15,23,42,.18)); }
.agente-id { display: flex; align-items: center; gap: 10px; }
.card-robo { position: relative; }
.card-robo .robo { position: absolute; right: 14px; top: 12px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.page-head h1 .robo { filter: drop-shadow(0 4px 10px rgba(15,23,42,.22)); }
.sidebar nav .sec.sec-robo { display: flex; align-items: center; gap: 8px; opacity: .9; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 700; }
.sidebar nav .sec-robo .robo { filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.agente:hover .robo, .card-robo:hover .robo { animation: robo-oi .9s ease-in-out; }
@keyframes robo-oi { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .agente:hover .robo, .card-robo:hover .robo { animation: none; } }

/* Menu lateral: um grupo recolhível por Gestorzinho */
.sidebar nav { overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.sidebar details.grupo { border-radius: 10px; }
.sidebar details.grupo > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; opacity: .92; user-select: none; }
.sidebar details.grupo > summary::-webkit-details-marker { display: none; }
.sidebar details.grupo > summary::after { content: "▸"; margin-left: auto; font-size: 11px; opacity: .7; transition: transform .15s; }
.sidebar details.grupo[open] > summary::after { transform: rotate(90deg); }
.sidebar details.grupo > summary:hover { background: rgba(255,255,255,.1); }
.sidebar details.grupo > summary.atual { background: rgba(255,255,255,.12); }
.sidebar details.grupo > summary .robo { filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.sidebar details.grupo .itens { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 18px;
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); }
.sidebar details.grupo .itens a { padding: 7px 10px; font-size: 13.5px; }
.menu-movel { display: none; }
@media (max-width: 900px) {
  .menu-movel { display: block; position: fixed; top: 10px; left: 10px; z-index: 30; border: 0; border-radius: 10px;
    background: var(--gg-blue-dark); color: #fff; padding: 9px 14px; font: 600 14px Inter, sans-serif; box-shadow: var(--shadow); }
  body.menu-aberto .sidebar { display: flex; position: fixed; z-index: 25; left: 0; top: 0; width: 280px; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .content { padding-top: 58px; }
}

/* Usuários e acessos */
.agentes-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.agentes-check label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; cursor: pointer; background: #fff; font-size: 13.5px; }
.agentes-check label:has(input:checked) { border-color: var(--gg-teal); background: #ecfdf8; }
.mini-robos { display: flex; flex-wrap: wrap; gap: 2px; }

/* Tarefas entre agentes */
.tarefa-fluxo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0; font-weight: 600; }
.tarefa-fluxo .seta { color: var(--muted); font-weight: 400; }
.resultado { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
pre.log { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 10px 12px; font-size: 12px; white-space: pre-wrap; max-height: 240px; overflow: auto; }
.pill.st-pendente { background: #fef3c7; color: #92400e; } .pill.st-executando { background: #dbeafe; color: #1e40af; }
.pill.st-concluida { background: #dcfce7; color: #166534; } .pill.st-erro { background: #fee2e2; color: #991b1b; }
.pill.st-recusada, .pill.st-cancelada { background: #e2e8f0; color: #475569; }

/* ---------- Marketing com a equipe (fila, padrões, conferência) ---------- */
.equipe-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.equipe-topo h2 { margin: 0; }
.fluxo { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.etapa { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.etapa.on { background: var(--gg-blue-dark); color: #fff; font-weight: 600; }
.eq-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
ul.conf { list-style: none; padding: 0; display: grid; gap: 6px; }
ul.conf li { font-size: 13.5px; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.conf-erro { color: var(--red); } ul.conf li.conf-erro { background: #fef2f2; }
ul.conf li.conf-atencao { background: #fffbeb; } ul.conf li.conf-ok { background: #f0fdf4; color: var(--green); }
.fluxo-form { display: grid; gap: 8px; }
ul.hist { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
ul.hist li { font-size: 13.5px; border-left: 3px solid var(--line); padding-left: 10px; }
ul.hist li.h-status { border-left-color: var(--gg-blue-med); } ul.hist li.h-conferencia { border-left-color: var(--gg-teal); }
.pill.pedido { background: #f1f5f9; color: #475569; } .pill.em_revisao { background: #e0f2fe; color: #075985; }
.pill.ajustes { background: #fef3c7; color: #92400e; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col-k { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-h { display: flex; justify-content: space-between; font-weight: 600; font-size: 13.5px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.cartao { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: #fff; }
.cartao:hover { border-color: var(--gg-blue-med); }
.cores { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cor { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; }
.cor i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.1); display: inline-block; }
.guia { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(6, 220px); } }

/* ---------- Agendamentos ---------- */
.ag-abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.ag-abas a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; }
.ag-abas a.on { border-color: var(--gg-blue-dark); box-shadow: 0 0 0 2px rgba(26,86,165,.15); font-weight: 600; }
.rotinas { display: grid; gap: 10px; }
.rotina { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.rotina summary { cursor: pointer; list-style: none; }
.rotina summary .muted { margin-top: 4px; }
.rotina[open] summary { margin-bottom: 12px; }
.agenda-form .form-grid { margin-bottom: 10px; }
