/* BUYPLAN — interface. Cores e tipografia vêm de tokens.css (manual da marca). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--bp-fonte); font-weight: var(--bp-peso-texto); color: var(--bp-grafite); background: #F3F4F1; font-size: 14px; line-height: 1.5; }
a { color: var(--bp-petroleo-medio); text-decoration: none; }
h1, h2, h3 { font-weight: var(--bp-peso-titulo); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 17px; font-weight: var(--bp-peso-subtitulo); } h3 { font-size: 15px; font-weight: 700; }

.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.lateral { background: #fff; border-right: 1px solid #E4E7E2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 16px; gap: 18px; }
.lateral-logo { display: block; padding: 0 6px; }
.lateral-logo img { width: 140px; display: block; }
.menu { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--bp-grafite); font-weight: 600; font-size: 13px; position: relative; white-space: nowrap; }
.menu a:hover { background: var(--bp-off-white); }
.menu a.ativo { background: var(--bp-verde-menta); color: var(--bp-verde-noite); font-weight: 700; }
.menu a svg { flex: none; color: var(--bp-verde-petroleo); }
.menu-grupo { font-size: 11.5px; color: #6B7681; font-weight: 700; padding: 14px 12px 4px; }
.badge { margin-left: auto; background: var(--bp-verde-petroleo); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.lateral-rodape { margin-top: auto; background: var(--bp-degrade-escuro); color: #fff; border-radius: 14px; padding: 14px; font-size: 12.5px; }
.lateral-rodape b { display: block; font-size: 13.5px; margin-bottom: 4px; } .lateral-rodape span { color: var(--bp-verde-menta); }

.conteudo { padding: 22px 28px 36px; min-width: 0; }
.topo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topo > div:first-child { margin-right: auto; }
.busca { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E4E7E2; border-radius: 99px; padding: 6px 14px; width: 270px; color: #6B7681; }
.busca input { border: 0; padding: 2px 0; width: 100%; background: transparent; font-size: 13px; } .busca input:focus { outline: 0; }
.icone-btn { width: 38px; height: 38px; border-radius: 99px; background: #fff; border: 1px solid #E4E7E2; display: grid; place-items: center; color: var(--bp-verde-petroleo); position: relative; }
.icone-btn i { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 99px; background: #D64530; }
.avatar-wrap { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.avatar { width: 38px; height: 38px; border-radius: 99px; background: var(--bp-verde-menta); color: var(--bp-verde-noite); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.topo .sub { margin: 2px 0 0; color: #6B7681; max-width: 70ch; }
.topo-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.rodape { margin-top: 40px; color: #8a949e; font-size: 12px; }

.cartao { background: #fff; border: 1px solid #E4E7E2; border-radius: 14px; padding: 18px 20px; }
.cartao .sub { font-size: 12.5px; color: #6B7681; margin: -8px 0 14px; }
.cartao h2 { margin-bottom: 12px; }
.cartao.escuro { background: var(--bp-verde-petroleo); color: #fff; border-color: transparent; position: relative; overflow: hidden; }
.cartao.escuro::after { content: ""; position: absolute; inset: 0; background: url(/static/marca/padrao-fluxo.svg) right/cover no-repeat; opacity: .35; pointer-events: none; }
.cartao.escuro > * { position: relative; z-index: 1; }
.cartao.menta { background: var(--bp-verde-menta); border-color: transparent; }
.grade { display: grid; gap: 16px; }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-21 { grid-template-columns: 2fr 1fr; }
.bloco { margin-bottom: 18px; }

.indicador .rotulo { font-size: 13px; color: #5b6673; }
.cartao.escuro .indicador .rotulo, .cartao.escuro .nota { color: var(--bp-verde-menta); }
.indicador .valor { font-size: 24px; white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; }
.indicador .nota { font-size: 12.5px; color: #6b7681; margin-top: 4px; }

table.tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tab th { text-align: left; font-weight: 700; color: #5b6673; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid #e6e3da; white-space: nowrap; }
.tab td { padding: 9px 10px; border-bottom: 1px solid #f0ede5; vertical-align: middle; }
.tab tr:last-child td { border-bottom: 0; }
.tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab tr.urgente td { background: #fff7f0; }
.tab-rolagem { overflow-x: auto; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.verde { background: var(--bp-verde-menta); color: var(--bp-verde-noite); }
.tag.ambar { background: #fde9c8; color: #7a4b00; }
.tag.vermelho { background: #fbd9d4; color: #8a1f12; }
.tag.azul { background: #d6e6fb; color: #123f7a; }
.tag.cinza { background: #e9e9e6; color: #555; }
.tag.petroleo { background: var(--bp-verde-petroleo); color: #fff; }
.abc { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12px; }
.abc.A { background: var(--bp-verde-petroleo); color: #fff; } .abc.B { background: var(--bp-verde-salvia); color: var(--bp-verde-noite); } .abc.C { background: #e9e9e6; color: #666; }

.botao { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; background: var(--bp-verde-petroleo); color: #fff; font-weight: 700; font-size: 13.5px; border: 0; cursor: pointer; font-family: inherit; }
.botao:hover { background: var(--bp-petroleo-medio); }
.botao.leve { background: #fff; color: var(--bp-verde-petroleo); border: 1px solid #d9d6cc; }
.botao.leve:hover { background: #f1efe8; }
.botao.mini { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.botao.salvia { background: var(--bp-verde-salvia); color: var(--bp-verde-noite); }

form.linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
label.campo { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #5b6673; font-weight: 600; }
input, select, textarea { font-family: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid #d9d6cc; border-radius: 9px; background: #fff; color: var(--bp-grafite); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bp-verde-salvia); outline-offset: 1px; border-color: var(--bp-verde-salvia); }
input[type=checkbox] { width: 16px; height: 16px; }

.barra { height: 8px; background: #ecebe5; border-radius: 99px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--bp-verde-salvia), var(--bp-verde-plan)); border-radius: 99px; }
.barra.cheia > i { background: var(--bp-verde-petroleo); }
.serie { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.serie > div { flex: 1; background: var(--bp-verde-salvia); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.serie > div.estouro { background: #e9a23b; }
.serie > div.promo { background: var(--bp-petroleo-medio); }
.serie > div span { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 10px; color: #7b8590; margin-top: 4px; }

.tarefa { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0ede5; align-items: flex-start; }
.tarefa:last-child { border-bottom: 0; }
.tarefa .prio { width: 8px; height: 8px; border-radius: 99px; margin-top: 7px; flex: none; }
.prio.alta { background: #d64530; } .prio.media { background: #e9a23b; } .prio.baixa { background: var(--bp-verde-salvia); }
.tarefa b { display: block; }
.tarefa small { color: #6b7681; display: block; margin-top: 2px; }
.tarefa.feita b { text-decoration: line-through; color: #8a949e; }
.etapas { display: flex; gap: 6px; flex-wrap: wrap; }
.etapa { flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e6e3da; font-size: 12.5px; }
.etapa.feita { background: var(--bp-verde-menta); border-color: transparent; }
.etapa.atual { background: var(--bp-verde-petroleo); color: #fff; border-color: transparent; }
.etapa small { display: block; opacity: .8; }
.vazio { padding: 26px; text-align: center; color: #7b8590; }
.aviso { padding: 12px 16px; border-radius: 10px; background: var(--bp-verde-menta); color: var(--bp-verde-noite); margin-bottom: 16px; font-weight: 600; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filtros a { padding: 6px 12px; border-radius: 99px; border: 1px solid #d9d6cc; background: #fff; font-size: 13px; font-weight: 600; color: var(--bp-grafite); }
.filtros a.ativo { background: var(--bp-verde-petroleo); color: #fff; border-color: transparent; }
.lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-simples li { padding: 8px 0; border-bottom: 1px solid #f0ede5; display: flex; justify-content: space-between; gap: 10px; }
.lista-simples li:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--bp-verde-petroleo); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-lado { background: var(--bp-degrade-escuro); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-lado::after { content: ""; position: absolute; inset: 0; background: url(/static/marca/padrao-fluxo.svg) center/cover no-repeat; opacity: .4; }
.login-lado > * { position: relative; z-index: 1; }
.login-lado h2 { font-size: 34px; font-weight: 800; line-height: 1.15; max-width: 14ch; }
.login-lado p { color: var(--bp-verde-menta); max-width: 40ch; }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-form img { width: 200px; margin-bottom: 20px; }
.erro { color: #8a1f12; background: #fbd9d4; padding: 10px 12px; border-radius: 9px; font-weight: 600; }

@media (max-width: 1100px) { .grade-4 { grid-template-columns: repeat(2, 1fr); } .grade-3, .grade-21 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; } .lateral { position: static; height: auto; }
  .menu { flex-direction: row; flex-wrap: wrap; } .menu a span { display: none; } .menu-grupo { display: none; } .lateral-rodape { display: none; }
  .conteudo { padding: 18px; } .grade-4, .grade-2 { grid-template-columns: 1fr; } .login { grid-template-columns: 1fr; } .login-lado { display: none; }
}

/* KPIs com sparkline e gráfico da visão geral */
.kpi { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.kpi .rotulo { grid-column: 1 / -1; }
.kpi svg.spark { width: 84px; height: 34px; }
.tendencia { font-size: 12px; font-weight: 700; margin-top: 6px; } .tendencia.up { color: #2E8B62; } .tendencia.down { color: #D64530; }
.legenda { display: flex; gap: 16px; font-size: 12px; color: #6B7681; margin-top: 8px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cat { display: grid; grid-template-columns: 20px 1fr 90px 44px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.cat svg { color: var(--bp-verde-petroleo); } .cat .pct { text-align: right; font-weight: 700; font-size: 12.5px; }
.cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.grade-16 { grid-template-columns: 1.6fr 1fr; }
.cartao.escuro .lista-simples li { border-color: rgba(255,255,255,.12); color: var(--bp-verde-menta); } .cartao.escuro .lista-simples b { color: #fff; }
.cartao.escuro::after { display: none; }
@media (max-width: 1100px) { .grade-16 { grid-template-columns: 1fr; } .busca { display: none; } }

/* ---- 1.3: quadro de tarefas, tarefa, conversa, modais ---- */
.quadro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.coluna { background: #ECEEEA; border-radius: 14px; padding: 10px; min-height: 240px; transition: background var(--bp-rapido, .18s) ease, box-shadow .2s ease; }
.coluna.sobre { background: var(--bp-verde-menta); box-shadow: inset 0 0 0 2px var(--bp-verde-salvia); }
.coluna header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; }
.coluna h2 { font-size: 13.5px; margin: 0; } .coluna .contagem { background: #fff; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; color: #5b6673; }
.coluna-corpo { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.coluna-vazia { color: #9aa3ab; font-size: 12.5px; text-align: center; padding: 18px 0; }
.tcard { display: block; background: #fff; border-radius: 11px; padding: 10px 12px; border: 1px solid #E4E7E2; border-left-width: 4px; color: var(--bp-grafite); cursor: grab; transition: transform .15s ease, box-shadow .15s ease; }
.tcard:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -12px rgba(15,77,74,.4); }
.tcard.arrastando { opacity: .5; transform: rotate(2deg); }
.tcard.prio-alta { border-left-color: #D64530; } .tcard.prio-media { border-left-color: #E9A23B; } .tcard.prio-baixa { border-left-color: var(--bp-verde-salvia); }
.tcard b { display: block; font-size: 13.5px; line-height: 1.3; margin: 6px 0 2px; } .tcard small { display: block; color: #6b7681; font-size: 12px; }
.tcard-topo { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tcard-prazo { font-size: 11.5px; font-weight: 700; color: #6b7681; } .tcard-prazo.hoje { color: #7A4B00; } .tcard-prazo.atrasada { color: #8A1F12; }
.tcard-rodape { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: #6b7681; }
.tcard-check.ok { color: var(--bp-salvia-profundo); font-weight: 700; }
.mini-avatar { width: 24px; height: 24px; border-radius: 99px; background: var(--bp-verde-menta); color: var(--bp-verde-noite); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 800; flex: none; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid #f0ede5; font-size: 13.5px; }
.checklist li:last-child { border-bottom: 0; } .checklist li.feito span { text-decoration: line-through; color: #8a949e; }
.checklist .check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--bp-verde-salvia); background: #fff; color: #fff; font-weight: 800; font-size: 12px; cursor: pointer; flex: none; display: grid; place-items: center; transition: background .15s ease, transform .15s ease; padding: 0; }
.checklist li.feito .check { background: var(--bp-verde-petroleo); border-color: var(--bp-verde-petroleo); transform: scale(1.05); }
.historico { display: flex; flex-direction: column; gap: 10px; }
.historico .evento { font-size: 12.5px; color: #6b7681; display: flex; align-items: center; gap: 8px; }
.historico .evento > span { width: 6px; height: 6px; border-radius: 99px; background: var(--bp-verde-salvia); flex: none; }
.historico .comentario { display: flex; gap: 10px; align-items: flex-start; background: var(--bp-off-white); border-radius: 10px; padding: 10px 12px; }
.historico .comentario p { margin: 4px 0 0; white-space: pre-line; } .historico .comentario small { color: #8a949e; }
.modal { border: 0; border-radius: 16px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 30px 80px -30px rgba(5,34,31,.5); background: #fff; color: var(--bp-grafite); font-family: inherit; }
.modal::backdrop { background: rgba(5,34,31,.45); backdrop-filter: blur(3px); }
.modal-corpo { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; }
.seu-dia .modal-corpo { gap: 14px; }
.seu-dia-topo { display: flex; gap: 14px; align-items: center; } .seu-dia-topo img { width: 44px; height: 44px; }
.seu-dia-topo p { margin: 2px 0 0; color: #6b7681; font-size: 13px; }
.seu-dia-lista { display: flex; flex-direction: column; gap: 8px; }
.seu-dia-lista a { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bp-off-white); color: var(--bp-grafite); transition: background .15s ease, transform .15s ease; }
.seu-dia-lista a:hover { background: var(--bp-verde-menta); transform: translateX(2px); }
.seu-dia-lista b { font-size: 20px; font-weight: 800; color: var(--bp-verde-petroleo); text-align: center; } .seu-dia-lista em { font-style: normal; color: #8A1F12; font-weight: 700; }
@media (max-width: 1100px) { .quadro { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .quadro { grid-template-columns: 1fr; } }

/* ---- 1.4: Importar do ERP ---- */
.solta { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 38px 20px; border: 2px dashed #C9D3CB; border-radius: 14px; background: var(--bp-off-white); cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.solta:hover, .solta.sobre { background: var(--bp-verde-menta); border-color: var(--bp-verde-salvia); transform: scale(1.005); }
.solta input { display: none; } .solta img { width: 44px; margin-bottom: 4px; } .solta b { font-size: 15px; } .solta span { color: #6b7681; font-size: 12.5px; max-width: 46ch; }
.fila { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fila li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #E4E7E2; border-radius: 10px; background: #fff; animation: bp-subir .3s var(--bp-ease, ease) both; }
.fila .ico { font-size: 10.5px; font-weight: 800; background: var(--bp-verde-petroleo); color: #fff; border-radius: 6px; padding: 3px 6px; }
.fila .nome { flex: 1; font-weight: 600; } .fila small { color: #8a949e; } .fila button { border: 0; background: transparent; font-size: 18px; color: #8a949e; cursor: pointer; }
.mapa-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.mapa-grade .campo.chave { color: var(--bp-verde-petroleo); }
.mapa-grade .campo.chave select { border-color: var(--bp-verde-salvia); }
.previa th, .previa td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
