:root {
  --bg: #f5f6f4; --card: #ffffff; --ink: #141a18; --muted: #5f6b66; --faint: #8a958f; --line: #e5e8e5; --line-2: #d6dbd7;
  --brand: #0f6e56; --brand-ink: #ffffff; --brand-soft: #e3f3ec; --brand-text: #0b5a46;
  --in: #12805c; --in-soft: #e4f4ec; --out: #b42318; --out-soft: #fdecea; --warn: #a15c07; --warn-soft: #fdf1dc;
  --info: #1d5fa8; --info-soft: #e6f0fb;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(16 24 20 / .04), 0 1px 1px rgb(16 24 20 / .03);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1211; --card: #151b19; --ink: #e9efec; --muted: #9ba7a2; --faint: #74807b; --line: #232b28; --line-2: #2f3935;
    --brand: #23a07f; --brand-ink: #06140f; --brand-soft: #14302a; --brand-text: #7fd8bd;
    --in: #4cc79a; --in-soft: #12291f; --out: #f08a80; --out-soft: #31171a; --warn: #f0b45c; --warn-soft: #2e2312;
    --info: #7db4ee; --info-soft: #14243a;
    --shadow: none; }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 var(--font); background: var(--bg); color: var(--ink); letter-spacing: -.005em;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.anon { padding-bottom: 0; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ícones */
.ic { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* topo */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand, .nav-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: .02em; color: var(--ink); }
.brand:hover, .nav-brand:hover { text-decoration: none; }
.brand img, .nav-brand img { border-radius: 8px; }
.me { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { color: var(--muted); font-size: 14px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-text); }
.avatar:empty { display: none; }
.icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; border-radius: 10px;
  background: transparent; color: var(--muted); border: 1px solid transparent; }
.icon-btn:hover { background: var(--card); border-color: var(--line); color: var(--ink); }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; outline: none; }

/* tipografia */
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 26px 0 10px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 4px 0 18px; }
.page-head .grow { flex: 1; min-width: 0; }
.eyebrow { color: var(--muted); font-size: 13px; margin: 0 0 2px; }
.sub { color: var(--muted); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.in { color: var(--in); } .out { color: var(--out); }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* cartões e listas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.flush { padding: 4px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 8px; font-weight: 600; font-size: 14px; }
.card-head a { font-weight: 500; font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.card > .row:first-child, .card-head + .row, .day + .row { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lead { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--muted); }
.lead .ic { width: 18px; height: 18px; }
.lead.in { background: var(--in-soft); color: var(--in); } .lead.out { background: var(--out-soft); color: var(--out); }
.lead.warn { background: var(--warn-soft); color: var(--warn); } .lead.info { background: var(--info-soft); color: var(--info); }
.lead.time { width: auto; min-width: 52px; padding: 0 8px; font-size: 13px; font-weight: 600; background: var(--info-soft); color: var(--info); font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--out-soft); color: var(--out); }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 14px; }
.empty .ic { display: block; margin: 0 auto 6px; width: 26px; height: 26px; color: var(--faint); }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--out); }
.day { font-weight: 600; margin: 14px 0 2px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.note { display: flex; gap: 10px; align-items: flex-start; }
.note .ic { color: var(--warn); margin-top: 1px; }

/* painel de hoje */
.hero { background: var(--brand); color: #fff; border: 0; padding: 20px; }
@media (prefers-color-scheme: dark) { .hero { background: #0f5a47; } }
.hero .sub { color: rgb(255 255 255 / .72); }
.hero .big { color: #fff; font-size: 34px; margin: 2px 0 14px; }
.hero .flows { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.hero .flows span { display: inline-flex; align-items: center; gap: 6px; color: rgb(255 255 255 / .85); }
.hero .flows b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero .flows .ic { width: 16px; height: 16px; }
.hero a { color: #fff; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; opacity: .9; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--line-2); }
.stat .ic { width: 20px; height: 20px; }
.stat .n { display: block; font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .l { display: block; font-size: 12px; color: var(--muted); }
.stat.warn .ic { color: var(--warn); } .stat.info .ic { color: var(--info); } .stat.ok .ic { color: var(--in); }

/* formulários */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 9px; text-align: center; color: var(--muted); cursor: pointer; border-radius: 9px; font-size: 14px; font-weight: 600; }
.seg label:has(input:checked) { background: var(--card); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
button { font: inherit; font-size: 15px; font-weight: 600; border: 0; border-radius: var(--radius-sm); padding: 11px 18px; min-height: 44px;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; transition: filter .15s, transform .05s; }
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
a.btn { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border-radius: 12px; padding: 13px 18px;
  background: var(--brand); color: var(--brand-ink); font-size: 15px; }
a.btn:hover { text-decoration: none; filter: brightness(1.06); }
button.ghost { background: transparent; color: var(--brand-text); padding: 8px 10px; min-height: 36px; }
button.small { padding: 6px 12px; min-height: 32px; font-size: 13px; }
button.soft { background: var(--brand-soft); color: var(--brand-text); }
button:disabled { opacity: .5; cursor: default; }
.check { width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; }
.check:hover { border-color: var(--brand); filter: none; }
.check[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); }

/* menu "Mais" */
.links { padding: 4px 16px; }
.links a { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); border-top: 1px solid var(--line); font-weight: 500; }
.links a:first-child { border-top: 0; }
.links a:hover { text-decoration: none; color: var(--brand-text); }
.links a .grow { flex: 1; }
.links a .chev { color: var(--faint); width: 18px; height: 18px; }

/* barra de baixo (celular) */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
.tabs a { display: grid; justify-items: center; gap: 3px; padding: 7px 0 8px; font-size: 11px; font-weight: 500; color: var(--faint); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--brand-text); }
.tabs a .ic { width: 22px; height: 22px; }
.tabs .plus { align-content: center; }
.tabs .plus .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); padding: 11px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); }
.desk-only, .nav-brand { display: none !important; }

/* computador: menu lateral */
@media (min-width: 960px) {
  body { padding-bottom: 0; padding-left: 248px; }
  body.anon { padding-left: 0; }
  .tabs { top: 0; right: auto; width: 248px; display: flex; flex-direction: column; gap: 2px; padding: 18px 14px;
    border-top: 0; border-right: 1px solid var(--line); background: var(--card); backdrop-filter: none; overflow-y: auto; }
  .tabs .nav-brand { display: flex !important; padding: 4px 10px 18px; }
  .tabs a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); }
  .tabs a:hover { background: var(--bg); }
  .tabs a.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
  .tabs a .ic { width: 19px; height: 19px; }
  .tabs .plus { order: -1; margin: 0 0 14px; justify-content: center; background: var(--brand); color: var(--brand-ink) !important; font-weight: 600; }
  .tabs .plus:hover { background: var(--brand); filter: brightness(1.06); }
  .tabs .plus .ic { width: 19px; height: 19px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
  .tabs .nav-brand { order: -2; }
  .tabs a.desk-only { display: flex !important; }
  .tabs .nav-group.desk-only { display: block !important; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 18px 12px 6px; }
  .mob-only { display: none !important; }
  .top .brand { visibility: hidden; }
  .top { padding: 12px 28px; }
  main { max-width: 960px; padding: 28px 28px 40px; }
  .page-hoje { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
  .page-hoje > .page-head, .page-hoje > .full { grid-column: 1 / -1; }
}

/* entrada */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; }
.auth-box { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 32px 22px; }
.auth-logo { width: 52px; height: 52px; border-radius: 14px; }
.auth h1 { font-size: 26px; margin: 22px 0 8px; }
.auth p.lead-text { color: var(--muted); font-size: 15px; margin: 0 0 26px; }
.auth .fine { color: var(--faint); font-size: 12px; text-align: center; margin: 12px 0 0; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); }
.auth-foot span { display: inline-flex; align-items: center; gap: 5px; }
.auth-foot .ic { width: 14px; height: 14px; }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .auth-side { grid-row: 1 / -1; background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; }
  .auth-side h2 { color: #fff; text-transform: none; letter-spacing: -.02em; font-size: 30px; line-height: 1.2; margin: 0 0 18px; max-width: 16ch; }
  .auth-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: rgb(255 255 255 / .85); }
  .auth-side li { display: flex; align-items: center; gap: 10px; }
  .auth-side .ic { width: 18px; height: 18px; }
}
@media (max-width: 959px) { .auth-side { display: none; } }

/* avisos rápidos */
.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; max-width: 90vw; z-index: 10; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.toast.err { background: var(--out); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 124px); } }

/* gráfico */
.chart { width: 100%; height: 170px; display: block; margin-bottom: 12px; }
.chart .zero { stroke: var(--line-2); stroke-dasharray: 4 4; } .chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.chart .neg { fill: color-mix(in srgb, var(--out) 12%, transparent); }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.month-nav a:hover { text-decoration: none; border-color: var(--line-2); }
.month-nav .ic { width: 18px; height: 18px; }

/* Copiloto */
.chat { display: grid; gap: 10px; margin-bottom: 12px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
.msg.me { justify-self: end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 5px; }
.msg.bot { justify-self: start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.proposal { border: 1.5px solid var(--brand) !important; }
.proposal .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions { margin-top: 8px; }
.actions button.no { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.composer { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 6px 20px rgb(16 24 20 / .08); }
.composer input { border: 0; min-height: 40px; box-shadow: none !important; background: transparent; }
.composer button { min-height: 40px; width: 44px; padding: 0; display: grid; place-items: center; border-radius: 12px; }
@media (min-width: 960px) { .composer { bottom: 16px; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips button { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 500; padding: 6px 12px; min-height: 32px; font-size: 13px; border-radius: 99px; }
.chips button:hover { border-color: var(--brand); color: var(--brand-text); filter: none; }

/* assinatura */
.plan-opt { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 500; }
.plan-opt input { width: auto; min-height: 0; }
body.anon main { max-width: none; padding: 0; }
@media (min-width: 960px) { .tabs .plus .desk-only { display: inline !important; } }

.grid2 .big { font-size: clamp(16px, 4.6vw, 26px); white-space: nowrap; }
@media (min-width: 960px) { .tabs a.nav-brand { color: var(--ink); font-weight: 700; font-size: 17px; background: none; } }
