* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f6f0e7; color: #221c15; line-height: 1.55; }
header { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
         padding: .8rem 1rem; background: #221c15; color: #f6f0e7; position: sticky; top: 0; }
header a { color: #e8b04b; text-decoration: none; margin-left: .9rem; font-size: .95rem; }
main { max-width: 860px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; margin: .6rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
section { margin-bottom: 1.6rem; }
.nota { background: #fdf3d8; border-left: 3px solid #e8b04b; padding: .5rem .7rem; margin: .5rem 0; border-radius: 0 6px 6px 0; }
.erro { background: #fbdcdc; border-left: 3px solid #c0392b; padding: .5rem .7rem; margin: .5rem 0; border-radius: 0 6px 6px 0; }
.botao { display: inline-block; background: #221c15; color: #f6f0e7; border: 0; border-radius: 8px;
         padding: .5rem 1rem; font-size: .95rem; cursor: pointer; text-decoration: none; }
.botao.grande { width: 100%; padding: .9rem; font-size: 1.05rem; margin-top: 1rem; }
.lista { list-style: none; }
.lista li { padding: .45rem 0; border-bottom: 1px solid #e3d9c8; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid #e3d9c8; vertical-align: top; }
code { background: #ece4d4; padding: .1rem .35rem; border-radius: 4px; font-size: .88em; }
.estado { padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; }
.estado.fila { background: #e3d9c8; }
.estado.rodando { background: #fdf3d8; color: #8a6d1a; }
.estado.concluido { background: #d9efd9; color: #1e6b1e; }
.estado.erro { background: #fbdcdc; color: #c0392b; }
form.ficha fieldset { border: 1px solid #d8ccb8; border-radius: 10px; padding: .9rem; margin-bottom: 1rem; background: #fff; }
form.ficha legend { font-weight: 600; padding: 0 .4rem; }
form.ficha label { display: block; margin: .55rem 0 .2rem; font-size: .9rem; font-weight: 600; }
form.ficha input[type=text], form.ficha input:not([type]), form.ficha textarea, form.ficha select {
  width: 100%; padding: .5rem; border: 1px solid #cbbfa9; border-radius: 7px; font-size: .95rem; background: #fffdf8; }
form.ficha textarea { min-height: 3.2rem; }
form.ficha input[type=checkbox], form.ficha input[type=radio] { width: auto; margin-right: .45rem; }
form.ficha label:has(input[type=checkbox]), form.ficha label:has(input[type=radio]) { font-weight: 500; }
.grelha { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
@media (min-width: 640px) { .grelha { grid-template-columns: 1fr 1fr 1fr 1fr; } }
form.etapa { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
             background: #fff; border: 1px solid #d8ccb8; border-radius: 10px; padding: .8rem .9rem; margin-bottom: .6rem; }
form.etapa small { display: block; color: #6d6152; }
article.brief { background: #fff; border: 1px solid #d8ccb8; border-radius: 10px; padding: 1rem 1.1rem; font-size: .95rem; }
article.brief h3, article.brief h4, article.brief h5 { margin: 1rem 0 .35rem; }
article.brief ul { padding-left: 1.3rem; }
pre.log { background: #221c15; color: #d8ccb8; padding: .9rem; border-radius: 10px;
          overflow-x: auto; font-size: .8rem; max-height: 480px; overflow-y: auto; white-space: pre-wrap; }

/* Homefy operational cockpit */
:root{--green:#1f6a4a;--lime:#c9f269;--line:#dfe5dc;--muted:#667069}
body{background:#f4f6f1;color:#18211d}header{background:#10231a;padding:.85rem 1.4rem;z-index:20}header nav{display:flex;flex:1;overflow:auto}.marca{color:#fff!important;font-weight:800;font-size:1.05rem;margin:0 1rem 0 0!important}.marca span{color:var(--lime)}button.link{background:none;color:#d7e3da;border:0;cursor:pointer}main{max-width:1120px;padding:2rem 1.25rem 4rem}h1{font-size:clamp(1.7rem,3vw,2.5rem);letter-spacing:-.035em}.eyebrow{color:var(--green);font-size:.73rem;font-weight:800;letter-spacing:.14em}.muted,.empty{color:var(--muted)}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.8rem}.resumo{margin:1.2rem 0 2.2rem}.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:1.1rem;box-shadow:0 6px 24px rgba(21,40,30,.04)}.card span,.card small{display:block;color:var(--muted)}.card strong{display:block;font-size:2rem;margin:.25rem 0}.cabecalho-pagina,.secao-titulo{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.botao{background:var(--green)}input,select,textarea{width:100%;padding:.7rem .8rem;border:1px solid #cbd5cb;border-radius:9px;background:#fff;font:inherit}.stack{display:grid;gap:.85rem;margin-top:1.2rem}.stack.compact{gap:.5rem;margin:.1rem 0 1rem}.stack label{font-size:.87rem;font-weight:650}.stack label input{margin-top:.3rem}.auth{min-height:100vh;display:grid;place-items:center;padding:1rem;background:radial-gradient(circle at top,#e9f4de,#f4f6f1 48%)}.auth-card{width:min(440px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:2rem;box-shadow:0 20px 60px rgba(20,50,30,.1)}.narrow{max-width:640px;margin:auto}.secret{padding:1rem;margin:1rem 0;background:#eef4ea;border-radius:10px;word-break:break-all;text-align:center}.sucesso{background:#ecf8ee;padding:1rem;border-radius:12px}.sucesso pre{columns:2;margin:1rem 0}.wrap{overflow-wrap:anywhere;white-space:normal}
.chat-layout{display:grid;grid-template-columns:260px 1fr;min-height:650px;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff}.chat-sidebar{padding:1rem;background:#f0f4ee;border-right:1px solid var(--line)}.chat-sidebar small{display:block}.chat-main{margin:0;display:flex;flex-direction:column;min-width:0}.chat-head{padding:1rem 1.2rem;border-bottom:1px solid var(--line)}.chat-head h2{margin:0}.mensagens{flex:1;padding:1.2rem;overflow:auto}.mensagem{max-width:80%;padding:.8rem 1rem;border-radius:12px;margin-bottom:.8rem;white-space:pre-wrap}.mensagem.user{margin-left:auto;background:#e8f4dd}.mensagem.assistant{background:#f2f3f1}.mensagem.system{background:#fff2da}.mensagem small{display:block;text-transform:uppercase;color:var(--muted);font-size:.65rem;font-weight:800}.composer{display:flex;gap:.6rem;padding:1rem;border-top:1px solid var(--line)}.composer textarea{min-height:72px}.empty-state{margin:auto;padding:3rem;text-align:center}.approval{background:#fff;border:1px solid var(--line);border-radius:12px;padding:1rem;margin:.75rem 0}.approval textarea{margin:.7rem 0}.danger{background:#a63c3c;margin-left:.4rem}.estado.approved{background:#d9efd9;color:#1e6b1e}.estado.rejected{background:#fbdcdc;color:#c0392b}
@media(max-width:760px){header{align-items:flex-start}header nav{order:3;width:100%}.cabecalho-pagina{align-items:flex-start;flex-direction:column}.chat-layout{grid-template-columns:1fr}.chat-sidebar{border-right:0;border-bottom:1px solid var(--line)}.mensagem{max-width:92%}}
