/* Portal dos agentes v2 · marca ezis (Manual de Identidade Visual): Funnel Display, navy predominante, azul para o
   positivo e as ações, ciano nos detalhes, vermelho para o negativo, laranja e amarelo para alertas. Página clara. */

@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/static/fonts/funnel-display-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/static/fonts/funnel-display-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #00123F;
  --navy-2: #0A2257;
  --blue: #066BEF;
  --blue-ink: #0558C4;
  --blue-wash: #E8F1FE;
  --cyan: #25DAEF;
  --cyan-wash: #E3F9FC;
  --gray: #E4E4E4;
  --red: #d64328;
  --red-wash: #FBEAE6;
  --orange: #ff7700;
  --orange-wash: #FFF1E5;
  --yellow: #ffe000;
  --yellow-wash: #FFFBD9;

  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --zebra: #F7F8FB;
  --text: #00123F;
  --muted: #4A5878;
  --faint: #7D889F;
  --line: #E4E4E4;
  --grid: #ECEEF3;
  --focus: 0 0 0 3px rgba(6, 107, 239, .35);
  --radius: 12px;
  --font: "Funnel Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- carregando / negado */
.carregando, .negado { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.carregando p { color: var(--muted); margin-top: 14px; }
.negado-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px;
  max-width: 440px; display: grid; gap: 14px; justify-items: center; }
.negado-card h1 { font-size: 1.35rem; font-weight: 700; }
.negado-card p { color: var(--muted); }

/* ---------------------------------------------------------------- estrutura */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--navy) var(--side), transparent var(--side)); }
.side { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; display: flex; flex-direction: column;
  padding: 22px 14px 16px; gap: 6px; overflow-y: auto; }
.side-logo { display: inline-flex; padding: 2px 10px 0; align-self: flex-start; }
.side-logo img { height: 34px; width: auto; display: block; }
.side-prod { font-size: .8rem; font-weight: 600; padding: 10px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 10px; display: grid; gap: 1px; }
.side-prod span { font-weight: 400; opacity: .68; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.78);
  text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; font-weight: 600; }
.nav .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--yellow);
  color: var(--navy); font-size: .74rem; font-weight: 700; display: inline-grid; place-items: center; }
.side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 6px 0; display: grid; gap: 10px; }
.user-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; }
.avatar.convidado { background: var(--cyan); color: var(--navy); }
.user-row strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row span { font-size: .78rem; opacity: .7; }
.btn-sair { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.86); border-radius: 9px; padding: 7px 10px; cursor: pointer; font-size: .84rem; justify-self: start; }
.btn-sair:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-sair svg.ic { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px 20px; padding: 14px 28px; min-height: 72px; }
.top-logo { display: none; }
.top-title { min-width: 0; flex: 1; }
.top-title h1 { font-size: 1.45rem; font-weight: 700; line-height: 1.15; letter-spacing: -.005em; }
.top-title p { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.top-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--zebra);
  border: 1px solid var(--line); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: none; }
.status-chip:empty { display: none; }
.status-chip.ok::before, .status-chip.warn::before, .status-chip.bad::before { display: inline-block; }
.status-chip.ok::before { background: var(--blue); }
.status-chip.warn::before { background: var(--orange); }
.status-chip.bad::before { background: var(--red); }
.top-user { display: none; }

.content { padding: 24px 28px 36px; display: grid; gap: 20px; max-width: 1320px; width: 100%; }
.view { display: grid; gap: 20px; min-width: 0; }
.foot { color: var(--faint); font-size: .78rem; padding: 0 28px 28px; }
.tabbar { display: none; }

/* ---------------------------------------------------------------- blocos */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font-size: 1.08rem; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.card-head h2 svg.ic { color: var(--blue); }
.card-head .acao { margin-left: auto; }
.card-sub { color: var(--muted); font-size: .86rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.grid-2.igual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.vazio { color: var(--muted); padding: 10px 0; }
.alertas { display: grid; gap: 10px; }
.alertas:empty { display: none; }
.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--red-wash);
  color: #8A2512; border-left: 4px solid var(--red); overflow-wrap: anywhere; }
.alerta.aviso { background: var(--orange-wash); color: #7A3800; border-left-color: var(--orange); }
.link { color: var(--blue-ink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; cursor: pointer; font-size: .88rem; }
.link:hover { text-decoration: underline; }
.link svg.ic { width: 16px; height: 16px; }

/* KPIs: ícone de traço, rótulo, número, complemento (padrão de dashboard do manual) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: start; min-width: 0; }
.kpi-ic { grid-row: span 3; width: 42px; height: 42px; border-radius: 11px; background: var(--blue-wash); color: var(--blue);
  display: grid; place-items: center; }
.kpi-ic svg.ic { width: 24px; height: 24px; }
.kpi-label { font-size: .84rem; color: var(--muted); font-weight: 500; }
.kpi-valor { font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.kpi-valor small { font-size: .95rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi.destaque { background: var(--navy); border-color: var(--navy); color: #fff; }
.kpi.destaque .kpi-ic { background: rgba(255,255,255,.1); color: var(--cyan); }
.kpi.destaque .kpi-label, .kpi.destaque .kpi-sub, .kpi.destaque .kpi-valor small { color: rgba(255,255,255,.75); }

/* pílulas de estado sólidas */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem;
  font-weight: 650; white-space: nowrap; line-height: 1.35; justify-self: start; }
.pill svg.ic { width: 13px; height: 13px; stroke-width: 2.4; }
.pill.concluido, .pill.entregue { background: var(--blue); color: #fff; }
.pill.trabalhando, .pill.em_desenvolvimento { background: var(--cyan); color: var(--navy); }
.pill.na_fila, .pill.aceito { background: var(--gray); color: var(--navy); }
.pill.aguardando, .pill.sugestao { background: var(--yellow); color: var(--navy); }
.pill.planejado { background: var(--navy); color: #fff; }
.pill.recusado { background: var(--red); color: #fff; }
.pill.parado { background: var(--orange); color: var(--navy); }
.pill.exemplo { background: var(--orange); color: var(--navy); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: pulsa 1.6s ease-in-out infinite; }
@keyframes pulsa { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .barra > span { transition: none; } }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface); white-space: nowrap; }
.tag.convidado { border-color: var(--cyan); color: #00606B; background: var(--cyan-wash); }
.tag.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .72rem; font-weight: 500; }
.tam { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--navy);
  font-size: .76rem; font-weight: 700; }
.tam.vazio { border-style: dashed; border-color: var(--faint); color: var(--faint); padding: 0; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.prio i { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.prio i b { width: 3px; border-radius: 1px; background: var(--gray); display: block; }
.prio i b:nth-child(1) { height: 5px; } .prio i b:nth-child(2) { height: 8px; } .prio i b:nth-child(3) { height: 12px; }
.prio.baixa i b:nth-child(1), .prio.media i b:nth-child(-n+2), .prio.alta i b { background: var(--navy); }

/* barra de progresso */
.progresso { display: grid; gap: 10px; }
.progresso-num { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.progresso-num strong { font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.barra { height: 12px; border-radius: 999px; background: var(--gray); overflow: hidden; display: flex; gap: 2px; }
.barra > span { height: 100%; transition: width .6s ease; }
.barra .seg-concluido { background: var(--blue); }
.barra .seg-trabalhando { background: var(--cyan); }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: 7px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legenda i.linha { width: 18px; height: 0; border-top: 2px solid; border-radius: 0; }
.legenda i.tracejada { width: 18px; height: 0; border-top: 2px dashed; border-radius: 0; }
.legenda i.oco { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blue); background: #fff; }
.legenda i.cheio { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }

/* listas zebradas */
.lista { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lista > li { padding: 12px 14px; border-top: 1px solid var(--line); }
.lista > li:first-child { border-top: 0; }
.lista > li:nth-child(even) { background: var(--zebra); }
.rm-linha { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; }
.rm-linha strong { font-weight: 600; }
.rm-linha p { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.rm-linha.concluido strong { color: var(--muted); font-weight: 500; }
.eta { text-align: right; font-weight: 600; white-space: nowrap; font-size: .9rem; }
.eta small { display: block; font-weight: 400; color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.nota { color: var(--muted); font-size: .82rem; margin-top: 12px; }

.agora { display: grid; gap: 10px; }
.agora-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 12px 14px;
  border-radius: 10px; background: var(--zebra); border: 1px solid var(--line); }
.agora-item .ic-box { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; background: var(--blue-wash); color: var(--blue);
  display: grid; place-items: center; }
.agora-item strong { font-weight: 600; overflow-wrap: anywhere; }
.agora-item p { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.agora-grupo { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 650; margin-top: 4px; }

/* chips de filtro */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-f { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .84rem;
  cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.chip-f:hover { border-color: var(--blue); color: var(--blue-ink); }
.chip-f[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-f b { font-weight: 700; }

/* gráficos */
.grafico { position: relative; width: 100%; min-width: 0; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.grafico text { fill: var(--muted); font-size: 12px; }
.grafico .t-forte { fill: var(--text); font-weight: 650; }
.grafico .t-claro { fill: var(--faint); }
.dica { position: fixed; z-index: 50; pointer-events: none; background: var(--navy); color: #fff; border-radius: 9px;
  padding: 9px 12px; font-size: .8rem; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,18,63,.25); max-width: 260px; }
.dica strong { display: block; font-weight: 650; margin-bottom: 2px; }
.dica .lin { display: flex; align-items: center; gap: 7px; }
.dica i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
details.tabela-dados { margin-top: 12px; }
details.tabela-dados summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; font-size: .86rem; }
.tabela { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: 10px; }
.tabela th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabela td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabela tr:nth-child(even) td { background: var(--zebra); }
.tabela .num { text-align: right; white-space: nowrap; }
.tabela-wrap { overflow-x: auto; }
.premissas { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.premissas li::marker { color: var(--blue); }
.beta-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 4px; }
.beta-nums div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.beta-nums dt { font-size: .78rem; color: var(--muted); }
.beta-nums dd { margin: 0; font-size: 1.25rem; font-weight: 700; }
.beta-nums .mais { color: var(--blue-ink); }
.beta-nums .menos { color: #B3341C; }
.vazio-grande { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 16px; color: var(--muted); }
.vazio-grande svg.ic { width: 40px; height: 40px; color: var(--blue); stroke-width: 1.5; }
.vazio-grande strong { color: var(--text); font-size: 1.1rem; font-weight: 650; }

/* ---------------------------------------------------------------- funcionalidades */
.barra-ferr { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.campo { display: grid; gap: 4px; min-width: 0; }
.campo > span { font-size: .76rem; font-weight: 600; color: var(--muted); }
.campo input, .campo select, .campo textarea { border: 1px solid #CDD3DE; border-radius: 9px; background: var(--surface);
  padding: 8px 10px; min-height: 38px; width: 100%; }
.campo textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.campo .contador { font-size: .74rem; color: var(--faint); justify-self: end; }
.campo .contador.alto { color: #B3341C; font-weight: 600; }
.barra-ferr .campo { flex: 1 1 150px; }
.barra-ferr .campo.busca { flex: 2 1 220px; }
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid transparent;
  padding: 9px 16px; font-weight: 600; cursor: pointer; min-height: 40px; white-space: nowrap; }
.btn svg.ic { width: 18px; height: 18px; }
.btn-primario { background: var(--blue); color: #fff; }
.btn-primario:hover { background: var(--blue-ink); }
.btn-primario:disabled { opacity: .55; cursor: default; }
.btn-sec { background: var(--surface); border-color: #CDD3DE; color: var(--navy); }
.btn-sec:hover { border-color: var(--navy); }
.form-nova { display: grid; gap: 14px; }
.form-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { font-size: .86rem; font-weight: 600; }
.msg.ok { color: var(--blue-ink); }
.msg.erro { color: #B3341C; }
.aviso-sugestoes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px;
  background: var(--yellow-wash); border: 1px solid #F1D700; }
.aviso-sugestoes .ic-box { width: 34px; height: 34px; border-radius: 9px; background: var(--yellow); color: var(--navy);
  display: grid; place-items: center; }
.aviso-sugestoes strong { font-weight: 650; }
.contagem-status { display: flex; flex-wrap: wrap; gap: 8px; }

.itens { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.item { border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item:nth-child(even) > .item-linha { background: var(--zebra); }
.item.novo > .item-linha { box-shadow: inset 4px 0 0 var(--yellow); }
.item-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 14px 16px; cursor: pointer;
  width: 100%; text-align: left; border: 0; background: var(--surface); }
.item-linha:hover { background: var(--blue-wash) !important; }
.item-topo { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 4px; }
.item-titulo { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
.item-desc { color: var(--muted); font-size: .86rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { color: var(--faint); font-size: .78rem; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.item-meta svg.ic { width: 14px; height: 14px; }
.item-lado { display: grid; justify-items: end; gap: 8px; align-content: start; }
.item-lado .linha2 { display: flex; gap: 10px; align-items: center; }
.item-corpo { padding: 4px 16px 18px; display: grid; gap: 16px; background: var(--surface); border-top: 1px dashed var(--line); }
.item-corpo .desc-cheia { white-space: pre-line; overflow-wrap: anywhere; padding-top: 12px; }
.controles { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)) auto; gap: 10px; align-items: end;
  padding: 12px; border-radius: 10px; background: var(--zebra); border: 1px solid var(--line); }
.controles .titulo-ctl { grid-column: 1 / -1; font-size: .78rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.comentarios { display: grid; gap: 10px; }
.comentarios h3 { font-size: .9rem; font-weight: 650; }
.coment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; }
.coment .avatar { width: 30px; height: 30px; font-size: .8rem; grid-row: span 2; }
.coment-cab { font-size: .8rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coment-cab strong { color: var(--text); font-weight: 600; }
.coment p { white-space: pre-line; overflow-wrap: anywhere; font-size: .92rem; }
.form-coment { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.form-coment textarea { min-height: 64px; }

/* ---------------------------------------------------------------- agentes */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.ag { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; min-width: 0;
  background: var(--surface); box-shadow: inset 0 3px 0 var(--blue); }
.ag.parado { box-shadow: inset 0 3px 0 var(--orange); }
.ag.aguardando { box-shadow: inset 0 3px 0 var(--yellow); }
.ag-topo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ag h3 { font-size: 1rem; font-weight: 650; line-height: 1.3; }
.ag-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.ag-meta div { background: var(--zebra); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; min-width: 0; }
.ag-meta dt { font-size: .72rem; color: var(--muted); }
.ag-meta dd { margin: 0; font-weight: 700; font-size: .96rem; }
.rot { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 3px; font-weight: 650; }
.ag .acao-atual { font-weight: 600; overflow-wrap: anywhere; }
.ag small { color: var(--faint); font-size: .78rem; }
.prosa { white-space: pre-line; overflow-wrap: anywhere; font-size: .9rem; }
.dobra:not(.aberta) .prosa { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.diz .prosa { border-left: 3px solid var(--cyan); padding-left: 10px; }
.arquivos { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.arquivos li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; }
.arquivos code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; min-width: 0; }
.teste { padding: 8px 12px; border-radius: 9px; border-left: 4px solid var(--cyan); background: var(--cyan-wash); color: #00505A; }
.teste.ruim { border-left-color: var(--red); background: var(--red-wash); color: #8A2512; }
.teste p { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }
.parado-aviso { padding: 8px 12px; border-radius: 9px; background: var(--orange-wash); color: #7A3800; border-left: 4px solid var(--orange);
  font-weight: 600; font-size: .86rem; }
.bloco { border-top: 1px solid var(--line); padding-top: 14px; }
.bloco:first-child { border-top: 0; padding-top: 0; }
.bloco summary { cursor: pointer; list-style: none; display: grid; gap: 3px; }
.bloco summary::-webkit-details-marker { display: none; }
.bloco summary h3 { font-size: 1rem; font-weight: 650; display: flex; gap: 8px; align-items: center; }
.bloco summary h3 svg.ic { width: 16px; height: 16px; transition: transform .2s; color: var(--muted); }
.bloco[open] summary h3 svg.ic { transform: rotate(90deg); }
.feitos { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.feito { border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.feito .linha { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.feito strong { font-weight: 600; }
.mais { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--blue-ink); font-size: .82rem; cursor: pointer; font-weight: 600; justify-self: start; }
.capturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.cap { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); min-width: 0; }
.cap a { display: block; aspect-ratio: 16 / 10; background: var(--zebra); }
.cap img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cap figcaption { padding: 7px 9px; display: grid; gap: 1px; font-size: .76rem; min-width: 0; }
.cap figcaption strong { font-weight: 600; overflow-wrap: anywhere; }
.cap figcaption span { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- telas médias e celular */
@media (max-width: 1180px) {
  .grid-2, .grid-2.igual { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body { font-size: 14.5px; }
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { display: none; }
  .top { background: var(--navy); color: #fff; border-bottom: 0; padding: 10px 16px; min-height: 0; flex-wrap: wrap;
    padding-top: max(10px, env(safe-area-inset-top)); }
  .top-logo { display: inline-flex; order: 1; }
  .top-logo img { height: 26px; width: auto; display: block; }
  .top-status { order: 2; margin-left: auto; flex-wrap: nowrap; }
  .top-title { order: 3; flex-basis: 100%; padding-top: 4px; }
  .top-title h1 { font-size: 1.25rem; }
  .top-title p { color: rgba(255,255,255,.72); font-size: .8rem; }
  .status-chip { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.9); padding: 4px 9px; font-size: .74rem; }
  #relogio { display: none; }
  .top-user { display: inline-flex; }
  .top-user .avatar { width: 30px; height: 30px; font-size: .82rem; }
  .content { padding: 16px 16px 96px; gap: 16px; }
  .view { gap: 16px; }
  .foot { padding: 0 16px 96px; margin-top: -76px; }
  .card { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 2px; }
  .kpi-ic { grid-row: auto; width: 32px; height: 32px; border-radius: 9px; margin-bottom: 6px; }
  .kpi-ic svg.ic { width: 18px; height: 18px; }
  .kpi-valor { font-size: 1.35rem; }
  .kpi-label { font-size: .76rem; }
  .kpi-sub { font-size: .74rem; }
  .progresso-num strong { font-size: 2.1rem; }
  .rm-linha { grid-template-columns: minmax(0, 1fr) auto; }
  .rm-linha .pill { grid-column: 1; grid-row: 1; }
  .rm-linha .eta { grid-column: 2; grid-row: 1; }
  .rm-linha .rm-corpo { grid-column: 1 / -1; }
  .eta small { display: none; }
  .item-linha { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .item-lado { justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
  .controles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controles label:first-of-type { grid-column: 1 / -1; }
  .controles .btn { grid-column: 1 / -1; }
  .form-coment { grid-template-columns: minmax(0, 1fr); }
  .ag-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 20; background: var(--navy); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; color: rgba(255,255,255,.7); text-decoration: none;
    font-size: .68rem; font-weight: 500; border-radius: 10px; position: relative; min-width: 0; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar a[aria-current="page"] { color: #fff; background: var(--blue); }
  .tabbar .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; border-radius: 999px;
    background: var(--yellow); color: var(--navy); font-size: .62rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
}

@media (min-width: 861px) and (max-width: 1500px) {
  .kpis.cinco .kpi { gap: 2px 12px; padding: 16px; }
  .kpis.cinco .kpi-ic { width: 36px; height: 36px; border-radius: 10px; }
  .kpis.cinco .kpi-ic svg.ic { width: 21px; height: 21px; }
  .kpis.cinco .kpi-valor { font-size: 1.5rem; }
}

.nome-card { display: grid; gap: 12px; max-width: 560px; }
.campo > span.small { font-weight: 400; font-size: .76rem; }
