@font-face { font-family: "Figtree"; src: url("fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
:root {
  --bg: #f1f4f9; --card: #fff; --ink: #0d1b33; --muted: #6a7890; --line: #e6ebf3; --track: #edf0f6;
  --blue: #1f5eff; --blue-2: #0b45e8; --blue-soft: #e8f0ff;
  --ok: #109a62; --bad: #d8402f; --warn: #a86400;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: "Figtree", -apple-system, "SF Pro Display", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #08111f; --card: #101c30; --ink: #eef2f9; --muted: #8fa0ba; --line: #1f3050; --track: #1a2a45; --blue: #4d82ff; --blue-soft: #14274d; --ok: #3ccf8e; --bad: #ff7b6b; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
#app { max-width: 680px; margin: 0 auto; padding-bottom: calc(80px + var(--safe-b)); }

header.top { padding: calc(20px + var(--safe-t)) 18px 4px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
header.top h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
header.top .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
header.top .sub::first-letter { text-transform: uppercase; }
header.top button { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 500; }
main { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > * { min-width: 0; }

.card { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: 0 1px 2px rgba(13, 27, 51, .05), 0 0 0 1px var(--line); }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }

/* painel */
.dash { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.hero-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.hero-card .tip { margin-top: auto; }
.hero-card .hc { padding: 20px 20px 8px; }
.hero-card .l { font-size: 14px; color: var(--muted); }
.hero-card .v { font-size: 38px; font-weight: 700; letter-spacing: -.04em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero-card .v small { display: block; margin-top: 2px; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.chart { display: block; width: 100%; height: auto; margin-top: 10px; color: var(--ink); }
.tip { background: linear-gradient(180deg, #2a6bff 0%, #0b45e8 100%); color: #fff; padding: 16px 20px 18px; font-size: 15px; line-height: 1.45; }
.tip .tt { font-size: 13px; font-weight: 600; opacity: .85; margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis > * { min-width: 0; }
.donut { display: grid; gap: 14px; justify-items: center; }
.donut svg { width: 190px; height: 190px; }
.donut .dl { font: 500 8px var(--font); fill: var(--muted); } .donut .dv { font: 700 13px var(--font); fill: var(--ink); }
.legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; } .legend b { font-weight: 600; color: var(--muted); }

.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; padding-bottom: 2px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13px; color: var(--muted); }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -.01em; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--track); color: var(--muted); display: inline-block; margin-top: 2px; }
.pill.ok { background: #d9f4e7; color: #0d6b43; } .pill.bad { background: #fde3df; color: #a62b1d; }
.pill.warn { background: #fdecc9; color: #8a5600; } .pill.info { background: var(--blue-soft); color: var(--blue); }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b); z-index: 5; max-width: 680px; margin: 0 auto; }
nav.tabs .brand, nav.tabs .grp { display: none; }
nav.tabs button { flex: 1; background: none; border: 0; padding: 10px 0 8px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; display: grid; gap: 2px; justify-items: center; }
nav.tabs button.on { color: var(--blue); font-weight: 700; }
nav.tabs svg { width: 22px; height: 22px; stroke-width: 1.75; }
.fab { position: fixed; right: 18px; bottom: calc(82px + var(--safe-b)); width: 54px; height: 54px; border-radius: 18px; border: 0; background: var(--blue); color: #fff; font-size: 28px; box-shadow: 0 10px 24px rgba(31, 94, 255, .35); z-index: 6; }

.sheet-bg { position: fixed; inset: 0; background: rgba(8, 17, 31, .45); backdrop-filter: blur(3px); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; max-height: 92dvh; overflow: auto; border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + var(--safe-b)); }
.sheet h3 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.sheet .card { box-shadow: 0 0 0 1px var(--line); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
textarea { min-height: 100px; resize: vertical; }
.btns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn { flex: 1; border: 0; border-radius: 12px; padding: 14px 16px; font: inherit; font-size: 16px; font-weight: 600; background: var(--blue); color: #fff; text-align: center; text-decoration: none; cursor: pointer; }
.btn.sec { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.wa { background: #12a15a; }
.hist { font-size: 12px; color: var(--muted); margin: 4px 0; }
.search { margin: 0; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.note { font-size: 13px; color: var(--muted); }

/* ---------- computador / tela larga ---------- */
@media (min-width: 900px) {
  #app { max-width: none; padding: 0 0 0 260px; }
  nav.tabs { top: 0; bottom: auto; right: auto; width: 260px; height: 100dvh; max-width: none; margin: 0; flex-direction: column; justify-content: flex-start; gap: 3px; padding: 26px 16px 16px; background: var(--card); backdrop-filter: none; border: 0; border-right: 1px solid var(--line); }
  nav.tabs .brand { display: block; font: 700 28px var(--font); letter-spacing: -.04em; padding: 0 12px 22px; color: var(--ink); }
  nav.tabs .grp { display: block; font-size: 13px; color: var(--muted); padding: 14px 12px 6px; }
  nav.tabs button { display: flex; flex: none; align-items: center; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; color: var(--muted); }
  nav.tabs button:hover { background: var(--bg); }
  nav.tabs button.on { background: var(--blue-soft); color: var(--blue); }
  header.top { padding: 30px 36px 4px; }
  header.top h1 { font-size: 26px; }
  main { max-width: 1240px; margin: 0 auto; padding: 18px 36px 44px; gap: 18px; }
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
  .hero-card { grid-column: span 7; }
  .donut-card { grid-column: span 5; }
  .kpis { grid-column: span 12; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .att, .next { grid-column: span 6; }
  .cond { grid-column: span 12; }
  .hero-card .v { font-size: 44px; }
  .donut svg { width: 200px; height: 200px; }
  .fab { right: 36px; bottom: 36px; }
  .sheet-bg { align-items: center; }
  .sheet { max-width: 600px; border-radius: 26px; padding: 28px 28px 24px; }
  .row:hover { background: var(--bg); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 12px; }
}

@media (min-width: 1280px) {
  .donut { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: stretch; gap: 22px; }
}
