:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #131a26;
  --muted: #5a6577;
  --line: #e2e7ef;
  --accent: #3454d1;
  --accent-soft: #e8edfd;
  --teal: #0f9d82;
  --warn: #e08a00;
  --bad: #d63b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 26, 38, 0.05), 0 6px 20px rgba(19, 26, 38, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: #101827;
  color: #cbd5e6;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #5b7cff, #14c3a2);
  display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: -0.02em;
}
.brand b { display: block; color: #fff; font-size: 15px; line-height: 1.2; }
.brand small { color: #8b99b3; font-size: 12px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6f7d97; padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #cbd5e6; text-decoration: none;
  padding: 9px 10px; border-radius: 10px; font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); }
.nav a.on { background: rgba(91, 124, 255, 0.22); color: #fff; }
.nav a.soon { opacity: 0.55; pointer-events: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5b7cff; flex: none; }
.dot.t { background: #14c3a2; }
.dot.o { background: #f2a93b; }
.tag { margin-left: auto; font-size: 10px; background: rgba(255,255,255,0.12); padding: 2px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; font-size: 12px; color: #7b89a4; padding: 10px; }

.main { padding: 30px 34px 60px; max-width: 1240px; width: 100%; min-width: 0; }
h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 14px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Cartões */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.tool-card { text-decoration: none; color: inherit; display: block; transition: transform .12s, box-shadow .12s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(19, 26, 38, 0.1); }
.tool-card.soon { opacity: .6; pointer-events: none; }
.tool-card h2 { display: flex; align-items: center; gap: 8px; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill.g { background: #e1f6f1; color: #0b7a66; }
.pill.w { background: #fdf0d9; color: #99600a; }

/* Controles */
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
select, input[type=text], input[type=date], textarea {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px;
}
textarea { width: 100%; resize: vertical; }
label.ck { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }

/* Tabelas */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { background: #f8fafd; font-weight: 600; color: #334057; cursor: pointer; user-select: none; position: sticky; top: 0; }
th.nosort { cursor: default; }
tr:last-child td { border-bottom: 0; }
td.left, th.left { text-align: left; }
td.wrap { white-space: normal; min-width: 220px; }

/* Abas */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 22px 0 18px; }
.tab {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; font-weight: 550; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }

/* Área de envio */
.drop {
  border: 2px dashed #b9c4dd; border-radius: 16px; background: #fff;
  padding: 36px 24px; text-align: center; transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.privacy {
  display: inline-flex; gap: 8px; align-items: center; background: #e1f6f1; color: #0b6e5c;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 550; margin-bottom: 14px;
}
details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
details summary { cursor: pointer; font-weight: 600; }
details ol { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }

/* Nuvem de palavras e barras */
.cloud { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; line-height: 1.15; }
.cloud button {
  background: none; border: 0; cursor: pointer; color: var(--accent); padding: 2px 0; font-weight: 600;
}
.cloud button:hover { text-decoration: underline; }
.bars .b { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.bars .t { background: #edf0f6; border-radius: 6px; height: 12px; overflow: hidden; }
.bars .f { background: var(--accent); height: 100%; border-radius: 6px; }
.bars .n { text-align: right; color: var(--muted); }

.heat { border-collapse: separate; border-spacing: 2px; font-size: 11px; width: auto; }
.heat th, .heat td { padding: 0; border: 0; text-align: center; background: none; cursor: default; position: static; }
.heat td.c { width: 22px; height: 22px; border-radius: 4px; }
.heat th { font-weight: 500; color: var(--muted); padding-right: 8px; }

.chart-box { position: relative; height: 280px; }
.msg { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.msg:last-child { border-bottom: 0; }
.msg .who { font-weight: 600; font-size: 13px; }
.msg .when { color: var(--muted); font-size: 12px; margin-left: 8px; }
.msg .tx { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.msg mark { background: #fff1a8; padding: 0 2px; border-radius: 3px; }
.bad { color: var(--bad); font-weight: 600; }
.ok { color: var(--teal); font-weight: 600; }
.hidden { display: none !important; }
.notice { background: #fff7e6; border: 1px solid #f3d9a4; color: #7a4f0a; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.error { background: #fdeaea; border: 1px solid #f3b9b9; color: #8c1f1f; padding: 10px 14px; border-radius: 10px; }

@media (max-width: 900px) {
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; }
  .brand { padding: 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 10px; }
  .tag { display: none; }
  .side-foot, .nav-label { display: none; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr) !important; }
  .main { padding: 22px 16px 50px; }
  .bars .b { grid-template-columns: 110px 1fr 56px; }
}
@media print {
  .side, .tabs, .row, .drop, details { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
}
@media (min-width: 901px) { .g-perg { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
