/* ==========================================================================
   Bússola Financeira — mobile-first prototype
   ========================================================================== */
:root {
  --ink: #12151b;
  --ink-2: #23262f;
  --brand: #a6791d;         /* dourado de bússola — o acento da marca */
  --brand-ink: #855f13;
  --brand-soft: #f4ecd6;
  --bg: #f2f1ec;            /* off-white morno, não o cinza-azulado de template */
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --border: #e9e6dc;
  --text: #1c1d22;
  --text-2: #6a6a64;
  --text-3: #a1a097;
  --green: #2f7d54;
  --green-soft: #e6f1e7;
  --amber: #b7791f;
  --amber-soft: #f7ecd6;
  --red: #c14444;
  --red-soft: #f8e7e4;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 8px 26px rgba(20,18,10,.10);
  --shadow-sm: 0 2px 8px rgba(20,18,10,.06);
  --tab-h: 66px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", var(--font);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font); background: #d9dee8; color: var(--text);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; }
.ico svg, [data-ico] svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ri svg { width: 20px; height: 20px; }
.ab-icon svg { width: 20px; height: 20px; }

/* Phone frame */
.phone {
  width: 100%; max-width: 440px; background: var(--bg); min-height: 100vh;
  position: relative; display: flex; flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.12); overflow: hidden;
}

/* App bar */
.appbar {
  background: var(--ink); color: #fff; padding: 16px 18px 14px;
  position: sticky; top: 0; z-index: 20;
}
.appbar.brand-bar { padding-bottom: 18px; }
.appbar .ab-top { display: flex; align-items: center; gap: 12px; }
.appbar .ab-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; font-family: var(--font-display); }
.appbar .ab-sub { font-size: 12.5px; color: #9fb0d6; margin-top: 1px; }
.appbar .ab-back { color: #cdd6ea; margin-left: -6px; }
.appbar .ab-actions { margin-left: auto; display: flex; gap: 6px; }
.appbar .ab-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #cdd6ea; background: rgba(255,255,255,.08); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(140deg, #c99a2e, #8a6215); display: grid; place-items: center; }
.brand-mark svg { width: 17px; height: 17px; stroke: #fff; }

/* Screen scroll area */
.screen { flex: 1; overflow-y: auto; padding: 16px 16px calc(var(--tab-h) + 24px); -webkit-overflow-scrolling: touch; }
.screen::-webkit-scrollbar { width: 0; }

/* Tab bar */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--tab-h);
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 600; }
.tab .ico svg { width: 23px; height: 23px; }
.tab.active { color: var(--brand); }
.tab.slot { visibility: hidden; }

/* FAB */
.fab {
  position: absolute; bottom: calc(var(--tab-h) - 26px); left: 50%; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; z-index: 40; box-shadow: 0 8px 20px rgba(20,18,10,.4);
  border: 4px solid var(--bg);
}
.fab:active { transform: translateX(-50%) scale(.94); }
.fab .ico svg { width: 26px; height: 26px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }
.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin: 22px 4px 10px; }
.sec-title:first-child { margin-top: 6px; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.row-link + .row-link { border-top: 1px solid var(--border); }
.row-link .ri { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.row-link .rt { flex: 1; min-width: 0; }
.row-link .rt strong { display: block; font-size: 15px; font-weight: 600; }
.row-link .rt small { font-size: 12.5px; color: var(--text-3); }
.row-link .chev { color: var(--text-3); }
.row-link .chev svg { width: 18px; height: 18px; }

.tint-blue { background: var(--brand-soft); color: var(--brand); }
.tint-green { background: var(--green-soft); color: var(--green); }
.tint-amber { background: var(--amber-soft); color: var(--amber); }
.tint-red { background: var(--red-soft); color: var(--red); }
.tint-gray { background: var(--surface-2); color: var(--text-2); }

/* Bússola home */
.hero { padding: 4px 4px 2px; }
.hero h1 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; font-family: var(--font-display); }
.hero p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.pulse-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pulse { background: var(--surface); border-radius: var(--radius-sm); padding: 13px 12px; box-shadow: var(--shadow-sm); }
.pulse .pl { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.pulse .pv { font-size: 17px; font-weight: 750; letter-spacing: -.4px; margin-top: 3px; }
.pulse .pv.green { color: var(--green); } .pulse .pv.red { color: var(--red); }
.pdelta { font-size: 10.5px; font-weight: 700; margin-top: 5px; }
.pdelta.green { color: var(--green); } .pdelta.red { color: var(--red); } .pdelta.gray, .pdelta.blue { color: var(--text-3); }

/* Action / bússola nudge */
.nudge {
  background: linear-gradient(135deg, var(--ink), var(--ink-2)); color: #fff;
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
}
.nudge .nk { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #e0b552; display: flex; align-items: center; gap: 6px; }
.nudge .nk svg { stroke: #e0b552; }
.nudge .nk svg { width: 15px; height: 15px; }
.nudge .nt { font-size: 17px; font-weight: 650; margin: 8px 0 3px; position: relative; }
.nudge .nd { font-size: 13px; color: #b9c4dd; margin-bottom: 14px; position: relative; }
.nudge .nbtn { background: #d3a53a; color: var(--ink); padding: 11px 16px; border-radius: 11px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; position: relative; }
.nudge .nbtn svg { stroke: var(--ink); }
.nudge .nbtn svg { width: 17px; height: 17px; }

/* Agenda / list items */
.mini-appt { display: flex; align-items: center; gap: 13px; padding: 13px 16px; }
.mini-appt + .mini-appt { border-top: 1px solid var(--border); }
.mini-appt .time { font-size: 14px; font-weight: 700; color: var(--brand); width: 46px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mini-appt .who { flex: 1; min-width: 0; }
.mini-appt .who strong { display: block; font-size: 14.5px; font-weight: 600; }
.mini-appt .who small { font-size: 12.5px; color: var(--text-3); }
.mini-appt .val { font-size: 14px; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.done { background: var(--green); } .dot.next { background: var(--brand); } .dot.wait { background: var(--text-3); }

.day-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; }
.day-head strong { font-size: 16px; font-weight: 700; text-transform: capitalize; }
.day-nav { margin-left: auto; display: flex; gap: 6px; }
.day-nav button { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; color: var(--text-2); box-shadow: var(--shadow-sm); }
.day-nav button svg { width: 18px; height: 18px; }

/* Client list */
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0; }
.search { display: flex; align-items: center; gap: 9px; background: var(--surface); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.search input { border: none; outline: none; flex: 1; background: none; font-size: 15px; }
.search .ico svg { width: 19px; height: 19px; color: var(--text-3); }
.chips { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.chips::-webkit-scrollbar { height: 0; }
.chip { white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); }
.chip.active { background: var(--ink); color: #fff; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: var(--surface-2); color: var(--text-2); }
.pill.blue { background: var(--brand-soft); color: var(--brand); }

/* Ficha / detail */
.profile-hd { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 18px; }
.profile-hd .avatar { width: 68px; height: 68px; font-size: 24px; margin-bottom: 10px; }
.profile-hd h2 { font-size: 20px; font-weight: 700; font-family: var(--font-display); }
.profile-hd .meta { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.action-row { display: flex; gap: 10px; margin: 16px 0; }
.action-row .ab { flex: 1; background: var(--surface); border-radius: 13px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 600; color: var(--text-2); }
.action-row .ab .ico svg { width: 21px; height: 21px; color: var(--brand); }
.action-row .ab.wa .ico svg { color: var(--green); }

.stat-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); }
.stat .sl { font-size: 12px; color: var(--text-3); font-weight: 600; }
.stat .sv { font-size: 20px; font-weight: 750; letter-spacing: -.4px; margin-top: 3px; }

/* timeline */
.tl-item { display: flex; gap: 12px; padding: 12px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--border); }
.tl-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.tl-dot svg { width: 16px; height: 16px; }

/* Growth bars */
.gbar-row { margin: 12px 0; }
.gbar-row .gl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.gbar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.gbar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bars6 { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars6 .bc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars6 .bb { width: 100%; background: linear-gradient(180deg, #c99a2e, var(--brand)); border-radius: 5px 5px 0 0; min-height: 4px; }
.bars6 .bl { font-size: 10.5px; color: var(--text-3); }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 15.5px; font-weight: 700; }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.btn.dark { background: var(--ink); }
.btn.green { background: var(--green); }
.btn .ico svg { width: 19px; height: 19px; }
.btn-row { display: flex; gap: 10px; }

/* Sheet (bottom modal) */
.sheet-overlay { position: fixed; inset: 0; background: rgba(15,24,48,.45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-overlay[hidden] { display: none; }
.sheet { background: var(--surface); width: 100%; max-width: 440px; border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .24s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grip { width: 40px; height: 4px; border-radius: 999px; background: #d7dce6; margin: 8px auto 14px; }
.sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; font-family: var(--font-display); }
.sheet .sub { color: var(--text-3); font-size: 13.5px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); outline: none; font-size: 15px; }
.field input:focus, .field select:focus { border-color: var(--brand); }
.opt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 13px; background: var(--surface-2); font-weight: 600; }
.opt .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.opt small { display: block; font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.opt .ico svg { width: 20px; height: 20px; }

/* Empty */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty .eic { width: 60px; height: 60px; border-radius: 50%; background: var(--surface); display: inline-grid; place-items: center; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.empty .eic svg { width: 26px; height: 26px; color: var(--text-3); }
.empty strong { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 3px; }
.empty .ebtn { margin-top: 14px; display: inline-flex; }

/* Toasts */
.toasts { position: fixed; bottom: 90px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); display: flex; align-items: center; gap: 9px; animation: pop .2s; }
.toast.green { background: var(--green); }
.toast svg { width: 17px; height: 17px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }

/* Login */
.phone.auth .appbar, .phone.auth .tabbar, .phone.auth .fab { display: none; }
.phone.auth .screen { padding: 0; }
.login { min-height: 100vh; background: var(--ink); display: flex; flex-direction: column; justify-content: center; padding: 30px 26px; }
.login .lbrand { display: flex; flex-direction: column; align-items: center; margin-bottom: 30px; }
.login .lbrand .brand-mark { width: 58px; height: 58px; border-radius: 17px; margin-bottom: 15px; }
.login .lbrand .brand-mark svg { width: 30px; height: 30px; }
.login h1 { color: #fff; font-size: 24px; font-weight: 750; letter-spacing: -.4px; }
.login .ls { color: #9fb0d6; font-size: 14px; margin-top: 4px; }
.login .lcard { background: var(--surface); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.login .demo { text-align: center; color: #8090b0; font-size: 12px; margin-top: 20px; line-height: 1.7; }
.login .demo b { color: #b9c4dd; }

/* Onboarding */
.onbo{min-height:100vh;background:var(--ink);padding:20px 22px 30px;display:flex;flex-direction:column}
.ob-top{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.ob-back{width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.08);color:#cdd6ea;display:grid;place-items:center}
.ob-back svg{width:20px;height:20px}
.ob-steps{display:flex;gap:7px}
.ob-dot{width:26px;height:5px;border-radius:9px;background:rgba(255,255,255,.16)}
.ob-dot.on{background:var(--brand)}
.ob-card{background:var(--surface);border-radius:20px;padding:22px;box-shadow:var(--shadow)}
.ob-h{font-size:22px;font-weight:700;letter-spacing:-.4px;font-family:var(--font-display)}
.ob-s{color:var(--text-2);font-size:14px;margin:4px 0 18px}
.ob-serv{display:flex;gap:8px;align-items:center;margin-bottom:9px}
.ob-serv .ob-sn{flex:1;padding:11px 12px;border:1.5px solid var(--border);border-radius:10px;outline:none;font-size:14px;min-width:0}
.ob-serv .ob-sp{display:flex;align-items:center;gap:4px;border:1.5px solid var(--border);border-radius:10px;padding:0 10px}
.ob-serv .ob-sp span{color:var(--text-3);font-size:13px}
.ob-serv .ob-spv{width:64px;border:none;outline:none;padding:11px 0;font-size:14px;font-weight:600}
.ob-serv .ob-del{width:34px;height:34px;border-radius:9px;background:var(--surface-2);color:var(--text-3);display:grid;place-items:center;flex-shrink:0}
.ob-serv .ob-del svg{width:16px;height:16px}

/* Pix copia e cola */
.pix-copy{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:12px 14px;max-height:76px;overflow-y:auto}
.pix-copy code{font-family:"SF Mono",Consolas,monospace;font-size:11px;color:var(--text-2);word-break:break-all;line-height:1.5}
#qrbox img{width:210px;height:210px;image-rendering:pixelated}

.muted { color: var(--text-3); }
.spacer-lg { height: 8px; }
.list-card { overflow: hidden; }
