/* InforAds — painel do gestor e portal do cliente */
:root {
  --ink: #0d2b31;          /* petróleo: menu e títulos */
  --ink-2: #16444d;
  --paper: #f3f6f4;
  --surface: #ffffff;
  --line: #d9e1de;
  --text: #15262a;
  --muted: #5a6c70;
  --mark: #f4c430;         /* amarelo de sinalização: item ativo e marcas */
  --go: #14804a;  --go-bg: #e2f4ea;
  --warn: #8a5a00; --warn-bg: #fff1c9;
  --stop: #b3261e; --stop-bg: #fde4e1;
  --chart: #1f7a86;
  --brand: #0e6b74;        /* trocado pela cor do gestor no portal */
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 15px/1.5 var(--body); }
a { color: var(--ink-2); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.15; margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 700; margin: 34px 0 12px; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; max-width: 72ch; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 9; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #cfe0dd; padding: 20px 12px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font: 700 23px/1 var(--display); letter-spacing: -0.03em; color: #fff; text-decoration: none; padding: 4px 10px 14px; }
.brand::after { content: ""; display: block; width: 26px; height: 4px; background: var(--mark); margin-top: 7px; }
.nav-group { font-size: 12px; color: #86a5a3; padding: 16px 10px 5px; }
.side a:not(.brand) { color: #dbe8e5; text-decoration: none; padding: 7px 10px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; border-left: 3px solid transparent; }
.side a:not(.brand):hover { background: rgba(255,255,255,.07); }
.side a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; border-left-color: var(--mark); border-radius: 0 6px 6px 0; }
.count { background: var(--mark); color: var(--ink); font: 600 12px/1 var(--body); padding: 3px 7px; border-radius: 10px; }
.side-foot { margin-top: auto; padding: 16px 10px 0; display: flex; justify-content: space-between; align-items: end; gap: 8px; font-size: 13px; color: #fff; }
.side-foot small { color: #86a5a3; }
.side-foot .link { color: #cfe0dd; }
.main { padding: 30px 36px 70px; max-width: 1180px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin: 6px 0 0; color: var(--muted); }
.crumb { font-size: 13px; margin-bottom: 6px; display: block; }

/* Superfícies */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.panel + .panel { margin-top: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.cols > .panel + .panel { margin-top: 0; }
.figures { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.figures div { padding: 14px 22px; border-right: 1px solid var(--line); flex: 1 1 150px; }
.figures div:last-child { border-right: 0; }
.figures dt { font-size: 13px; color: var(--muted); }
.figures dd { margin: 2px 0 0; font: 700 24px/1.2 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.figures dd small { font: 500 13px var(--body); color: var(--muted); }
dl.figures { margin: 0; }
.up { color: var(--stop); } .down { color: var(--go); }

/* Tabelas */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font: 500 13px var(--body); color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #ebf0ee; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td a.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
td a.strong:hover { text-decoration: underline; }
.empty { padding: 28px 20px; color: var(--muted); }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }

/* Etiquetas */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #e6eeec; color: var(--ink-2); white-space: nowrap; }
.tag-critical { background: var(--stop-bg); color: var(--stop); }
.tag-warning { background: var(--warn-bg); color: var(--warn); }
.tag-info { background: #e3eef6; color: #1d4f73; }
.tag-ok { background: var(--go-bg); color: var(--go); }
.tag-google { background: #eaf0fb; color: #1a4b9c; } .tag-meta { background: #ece9fb; color: #46329a; }
.health { display: inline-grid; place-items: center; width: 38px; height: 26px; border-radius: 5px; font: 700 14px var(--display); font-variant-numeric: tabular-nums; }
.health-good { background: var(--go-bg); color: var(--go); } .health-mid { background: var(--warn-bg); color: var(--warn); } .health-bad { background: var(--stop-bg); color: var(--stop); }

/* Ritmo do orçamento — a peça central do painel */
.pace { min-width: 215px; }
.pace-track { position: relative; height: 10px; background: #e4eae8; border-radius: 5px; }
.pace-track i { position: absolute; top: 0; height: 100%; display: block; }
.pace-proj { left: 0; border-radius: 5px; background: repeating-linear-gradient(135deg, #b9c9c6 0 3px, #d3dedb 3px 6px); }
.pace-fill { left: 0; border-radius: 5px; background: var(--go); }
.pace-over .pace-fill { background: var(--stop); } .pace-under .pace-fill { background: #5f8f9a; }
.pace-today { width: 2px; top: -4px !important; height: 18px !important; background: var(--ink); }
.pace-limit { width: 0; top: -4px !important; height: 18px !important; border-left: 2px dotted var(--stop); }
.pace-cap { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; font-size: 12.5px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.pace-cap b { font-weight: 600; color: var(--go); } .pace-over .pace-cap b { color: var(--stop); } .pace-under .pace-cap b { color: #3d6c78; }
.pace-note { font-size: 12.5px; color: var(--muted); }
.pace-key { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; max-width: none; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pace-key span { white-space: nowrap; }
.pace-key i { display: inline-block; vertical-align: middle; margin-right: 5px; }

/* Lista "precisa de você" */
.todo { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.todo li { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 14px; padding: 13px 18px; border-bottom: 1px solid #ebf0ee; align-items: start; }
.todo li:last-child { border-bottom: 0; }
.todo b { display: block; color: var(--ink); }
.todo span { color: var(--muted); font-size: 14px; }
.todo .who { font-size: 13px; color: var(--text); }
.todo .tag { justify-self: start; }

/* Formulários */
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 12px; }
label span.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: var(--text); background: #fff; border: 1px solid #b9c6c3; border-radius: 6px; }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { margin-top: 4px; width: 60px; height: 36px; padding: 2px; border: 1px solid #b9c6c3; border-radius: 6px; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.btn { display: inline-block; font: 600 14px var(--body); padding: 9px 16px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: #9fb0ad; } .btn-ghost:hover { background: #e9efed; }
.btn-danger { background: #fff; color: var(--stop); border-color: #e3b1ad; } .btn-danger:hover { background: var(--stop-bg); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-wa { background: #128c4b; border-color: #128c4b; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
.flash { padding: 11px 15px; border-radius: 8px; margin: 0 0 16px; max-width: none; font-weight: 500; }
.flash-ok { background: var(--go-bg); color: #0c5a33; } .flash-err { background: var(--stop-bg); color: #8c1d18; } .flash-info { background: var(--warn-bg); color: #6b4500; }
code, .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #e8eeec; padding: 2px 6px; border-radius: 4px; word-break: break-all; }
pre.code { padding: 12px; white-space: pre-wrap; margin: 0 0 12px; }

/* Gráficos */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { font: 13px var(--body); fill: var(--muted); }
.chart .bar:hover path { opacity: .65; }
.chart-title { font-size: 13px; color: var(--muted); margin: 0 0 4px; }

/* Sugestões */
.sug { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.sug h3 { margin-bottom: 4px; font-size: 16px; }
.sug .where { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sug p { margin: 0; }
.sug .impact { color: var(--go); font-weight: 500; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid #ebf0ee; }
.checks li:last-child { border: 0; }
.checks .y { color: var(--go); font-weight: 700; } .checks .n { color: var(--stop); font-weight: 700; }

/* Conversa com a IA */
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.msg { max-width: 78ch; padding: 11px 15px; border-radius: 10px; white-space: pre-wrap; }
.msg-user { background: var(--ink); color: #fff; align-self: flex-end; }
.msg-assistant { background: var(--surface); border: 1px solid var(--line); }

/* Telas sem menu (login, instalação) */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--ink); }
.auth { background: var(--surface); border-radius: 12px; padding: 34px 34px 28px; width: 100%; max-width: 420px; }
.auth h1 { font-size: 24px; margin-bottom: 18px; }
.auth .btn { width: 100%; text-align: center; padding: 11px; }
.brand-auth { color: var(--ink); padding: 0 0 22px; }

/* Portal do cliente */
body.portal { background: var(--paper); }
.portal-top { background: var(--brand); color: #fff; padding: 26px 20px 30px; }
.portal-top .in, .portal-body { max-width: 860px; margin: 0 auto; }
.portal-top h1 { color: #fff; font-size: 27px; }
.portal-top p { margin: 4px 0 0; opacity: .85; }
.portal-body { padding: 22px 20px 60px; }
.portal-say { font-size: 17px; line-height: 1.55; border-left: 4px solid var(--brand); padding: 4px 0 4px 16px; margin: 22px 0; max-width: 68ch; }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; overflow: hidden; margin-top: 14px; }
.seg a { color: #fff; text-decoration: none; padding: 5px 13px; font-size: 14px; }
.seg a.on { background: #fff; color: var(--brand); font-weight: 600; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; gap: 2px; }
  .brand { width: 100%; padding-bottom: 8px; } .brand::after { display: none; }
  .nav-group { display: none; }
  .side a.on { border-left-color: transparent; border-radius: 6px; box-shadow: inset 0 -3px 0 var(--mark); }
  .side-foot { width: 100%; margin-top: 6px; padding-top: 8px; }
  .main { padding: 20px 16px 50px; }
  h1 { font-size: 25px; }
  .todo li, .sug { grid-template-columns: 1fr; gap: 6px; }
  .figures div { border-right: 0; border-bottom: 1px solid var(--line); flex-basis: 45%; }
}
@media print {
  .side, .no-print, .flash { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  body { background: #fff; }
}
