/* ===== Pago na Hora — App shell ===== */

body { background: var(--bg-soft); }

#root { min-height: 100vh; }

/* App UI stays grotesque for density; serif reserved for page/onboarding titles */
h1, h2, h3 { font-family: var(--font); font-weight: 700; letter-spacing: -.01em; line-height: 1.22; }
.topbar h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.012em; line-height: 1.1; }
.ob h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.018em; line-height: 1.12; }

.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sb { background: var(--navy-900); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sb .logo { color: #fff; font-size: 18px; margin: 4px 8px 18px; }
.sb .logo span.thin { color: rgba(255,255,255,.6); }
.sb .logo .mark { background: var(--blue-600); box-shadow: none; }

.entity-label { margin: 0 8px 7px; color: rgba(255,255,255,.46); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.role-switch { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1); border-radius: 15px; padding: 6px; display: flex; flex-direction: column; gap: 5px; margin: 0 4px 16px; position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.role-switch button { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.62); font-family: var(--font); font-weight: 700; font-size: 13px; padding: 8px; border-radius: 11px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s, transform .15s; display: grid; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 9px; text-align: left; min-height: 48px; }
.role-switch button:hover { background: rgba(255,255,255,.075); color: #fff; }
.role-switch button.on { background: #fff; color: var(--ink); box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.role-switch button.on:hover { transform: translateY(-1px); }
.switch-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-600), var(--violet)); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .02em; }
.switch-avatar.pf { background: linear-gradient(135deg, var(--green), var(--green-600)); }
.switch-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-copy small { display: block; width: fit-content; margin-top: 3px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.62); font-size: 10px; font-weight: 850; line-height: 1; letter-spacing: .04em; }
.role-switch button.on .switch-copy small { background: var(--blue-50); color: var(--blue-700); }
.role-switch button.on .switch-avatar.pf + .switch-copy small { background: var(--green-tint); color: var(--green-600); }
.role-switch .chev { display: grid; place-items: center; opacity: .6; }

.pj-menu { position: absolute; left: -4px; right: -4px; top: calc(100% + 9px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 22px 60px rgba(6,15,38,.32); padding: 8px; color: var(--ink); animation: menuPop .16s ease-out; }
@keyframes menuPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pj-menu-title { padding: 6px 9px 8px; color: var(--ink-3); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.pj-menu button { width: 100%; grid-template-columns: 28px 1fr 18px; min-height: 44px; gap: 10px; padding: 9px; color: var(--ink-2); background: #fff; border-radius: 11px; text-align: left; box-shadow: none; }
.pj-menu button:hover, .pj-menu button.sel { background: var(--bg-soft); color: var(--ink); transform: none; }
.pj-menu button span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.pj-menu button small { color: var(--ink-3); opacity: 1; margin-top: 3px; font-size: 10.5px; font-weight: 750; }
.pj-menu .new { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 13px; color: var(--blue-700); }
.pj-menu .mini-plus { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-700); flex: none; }

.sb nav { display: flex; flex-direction: column; gap: 3px; }
.sb nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.66); cursor: pointer; transition: .14s; }
.sb nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb nav a.on { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(16,44,134,.3); }
.sb nav a svg { width: 18px; height: 18px; flex: none; }
.sb nav a .ct { margin-left: auto; background: rgba(255,255,255,.16); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 8px; }
.sb nav a.on .ct { background: rgba(255,255,255,.25); }

.sb .navlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.4); font-weight: 700; padding: 0 12px; margin: 18px 0 8px; }

.sb .userbox { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.sb .userbox .nm { font-size: 13px; font-weight: 700; line-height: 1.2; }
.sb .userbox .nm small { display: block; font-weight: 500; color: rgba(255,255,255,.55); font-size: 11.5px; }
.sb .userbox .gear { margin-left: auto; opacity: .6; cursor: pointer; }

/* ---------- MAIN ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 66px; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 21px; letter-spacing: -.02em; }
.topbar .sub { color: var(--ink-3); font-size: 13.5px; font-weight: 600; margin-top: 1px; }
.searchbar { margin-left: 18px; flex: 1; max-width: 320px; height: 38px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); display: flex; align-items: center; gap: 9px; padding: 0 13px; color: var(--ink-3); font-size: 14px; }
.searchbar svg { width: 16px; height: 16px; }
.searchbar input { border: 0; background: transparent; outline: none; font-family: var(--font); font-size: 14px; color: var(--ink); width: 100%; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: var(--bg-soft); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .nd { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

.content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* KPI cards */
.kgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 18px 19px; box-shadow: var(--sh-xs); }
.kcard .top { display: flex; align-items: center; justify-content: space-between; }
.kcard .lbl { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.kcard .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.kcard .ic svg { width: 17px; height: 17px; }
.kcard .val { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; }
.kcard .val small { font-size: 15px; color: var(--ink-3); font-weight: 700; }
.kcard .chg { font-size: 12.5px; font-weight: 700; margin-top: 5px; display: flex; align-items: center; gap: 5px; }

/* generic panel */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-xs); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16.5px; }
.panel-head .sub { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.section-title { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; }
.section-title h2 { font-size: 18px; }
.section-title .right { margin-left: auto; display: flex; gap: 8px; }

/* segmented filter */
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font-family: var(--font); font-weight: 700; font-size: 13px; color: var(--ink-3); padding: 7px 13px; border-radius: 8px; cursor: pointer; transition: .14s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh-xs); }

/* table */
.dt { width: 100%; }
.dt .row { display: grid; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dt .row:last-child { border-bottom: 0; }
.dt .head { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; }
.dt .row.click { cursor: pointer; transition: background .12s; }
.dt .row.click:hover { background: var(--bg-soft); }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who .nm { font-weight: 700; line-height: 1.25; min-width: 0; }
.who .nm small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

.kindtag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--bg-soft2); color: var(--ink-2); }

/* empty / misc */
.linkbtn { color: var(--blue-600); font-weight: 700; font-size: 13.5px; cursor: pointer; background: none; border: 0; font-family: var(--font); }

/* progress bar */
.pbar { height: 7px; border-radius: 999px; background: var(--bg-soft2); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--blue-600); border-radius: 999px; }

/* ---------- ONBOARDING ---------- */
.ob { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg-soft); }
.ob-top { height: 66px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); background: #fff; }
.ob-top .steps { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.ob-body { display: grid; place-items: start center; padding: 48px 24px 80px; }
.ob-card { width: 100%; max-width: 560px; }
.ob-prog { display: flex; gap: 6px; margin-bottom: 26px; }
.ob-prog i { flex: 1; height: 5px; border-radius: 999px; background: var(--line-2); transition: .3s; }
.ob-prog i.on { background: var(--blue-600); }
.ob h2 { font-size: 32px; letter-spacing: -.03em; }
.ob .lead { color: var(--ink-2); font-size: 16px; margin-top: 10px; line-height: 1.5; }

.choice { display: grid; gap: 12px; margin-top: 26px; }
.choice .opt { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1.5px solid var(--line-2); border-radius: 15px; background: #fff; cursor: pointer; transition: .15s; text-align: left; font-family: var(--font); }
.choice .opt:hover { border-color: var(--blue-400); background: var(--blue-50); }
.choice .opt.sel { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(26,71,214,.14); }
.choice .opt .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.choice .opt .ic svg { width: 22px; height: 22px; }
.choice .opt .t { font-weight: 800; font-size: 16.5px; }
.choice .opt .d { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; font-weight: 500; }
.choice .opt .rd { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.choice .opt.sel .rd { border-color: var(--blue-600); background: var(--blue-600); }
.choice .opt.sel .rd::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.field { margin-top: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; font-family: var(--font); font-size: 15px; padding: 13px 14px; border: 1.5px solid var(--line-2); border-radius: 11px; outline: none; background: #fff; color: var(--ink); transition: .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(26,71,214,.14); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.ob-actions { display: flex; gap: 12px; margin-top: 30px; align-items: center; }
.ob-actions .btn { flex: none; }
.ob-actions .grow { flex: 1; }

/* success check */
.bigcheck { width: 84px; height: 84px; border-radius: 50%; background: var(--green-tint); display: grid; place-items: center; margin: 0 auto 6px; }
.bigcheck svg { width: 40px; height: 40px; color: var(--green); }

/* ---------- MODAL / DRAWER ---------- */
.scrim { position: fixed; inset: 0; background: rgba(6,15,38,.5); backdrop-filter: blur(2px); z-index: 80; display: flex; justify-content: flex-end; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0 } }
.drawer { width: 460px; max-width: 94vw; background: #fff; height: 100%; box-shadow: var(--sh-lg); overflow-y: auto; animation: slideIn .26s cubic-bezier(.2,.8,.2,1); }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6 } }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; background: #fff; z-index: 2; }
.drawer-body { padding: 22px; }
.closex { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.closex:hover { background: var(--bg-soft); }

.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); font-weight: 600; }
.kv .v { font-weight: 700; }

/* new payment wizard summary */
.summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 18px; position: sticky; top: 90px; }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy-900); color: #fff; padding: 14px 20px; border-radius: 13px; box-shadow: var(--sh-lg); display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 14.5px; z-index: 120; animation: toastIn .3s cubic-bezier(.2,.8,.2,1); }
.toast .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(7,150,90,.18); display: grid; place-items: center; }
.toast .ic svg { width: 16px; height: 16px; color: var(--green); }
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0 } }

/* checkbox row (batch) */
.cbx { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: .12s; background: #fff; }
.cbx.on { background: var(--blue-600); border-color: var(--blue-600); }
.cbx svg { width: 12px; height: 12px; color: #fff; }

.paybar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 -8px 24px rgba(11,27,59,.06); border-radius: 0 0 16px 16px; }

/* pix qr placeholder */
.qr { width: 180px; height: 180px; border-radius: 14px; background:
  repeating-conic-gradient(var(--ink) 0% 25%, #fff 0% 50%) 0 0 / 22px 22px; margin: 0 auto; border: 6px solid #fff; box-shadow: var(--sh-sm); }

/* ---------- ASSISTANT (chat IA) ---------- */
.asst { height: calc(100vh - 66px); display: flex; flex-direction: column; background: var(--bg-soft); }
.asst-stream { flex: 1; overflow-y: auto; padding: 28px 0; }
.asst-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 16px; }
.amsg { display: flex; gap: 12px; align-items: flex-start; max-width: 92%; animation: amPop .28s ease; }
@keyframes amPop { from { opacity: 0; transform: translateY(8px); } }
.amsg.me { align-self: flex-end; flex-direction: row-reverse; }
.aav { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.aav.bot { background: linear-gradient(135deg, var(--violet), var(--blue-600)); box-shadow: 0 4px 12px rgba(91,75,179,.28); }
.aav.me { background: var(--blue-500); color: #fff; font-weight: 800; font-size: 12px; }
.abubble { background: #fff; border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; padding: 13px 16px; font-size: 14.5px; line-height: 1.5; box-shadow: var(--sh-xs); white-space: pre-line; }
.amsg.me .abubble { background: var(--blue-600); color: #fff; border-color: var(--blue-600); border-top-left-radius: 16px; border-top-right-radius: 5px; }

.a-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; padding: 18px; box-shadow: var(--sh-xs); min-width: 280px; }
.a-stat .lbl { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.a-stat .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.a-stat .sub { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 5px; }
.a-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.a-chips span { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }

.a-cards { background: #fff; border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; overflow: hidden; box-shadow: var(--sh-xs); min-width: 360px; }
.a-cards .acard { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.a-cards .acard:last-child { border-bottom: 0; }

.a-action { background: #fff; border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; padding: 16px; box-shadow: var(--sh-xs); min-width: 340px; }
.a-action .row1 { display: flex; align-items: center; gap: 12px; }
.a-action .lines { margin: 13px 0 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.a-action .btns { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }

.a-success { background: var(--green-tint); border: 1px solid #BCE9D2; border-radius: 16px; border-top-left-radius: 5px; padding: 14px 16px; font-size: 14.5px; font-weight: 600; color: #075C3A; box-shadow: var(--sh-xs); line-height: 1.45; }
.a-doc { display: inline-flex; align-items: center; gap: 8px; margin-top: 11px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }

.aquick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.aquick button { background: #fff; border: 1.5px solid var(--blue-200); color: var(--blue-700); border-radius: 999px; padding: 8px 14px; font-family: var(--font); font-weight: 700; font-size: 13px; cursor: pointer; transition: .14s; }
.aquick button:hover { background: var(--blue-50); }

.atyping { display: flex; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; padding: 15px 16px; width: fit-content; box-shadow: var(--sh-xs); }
.atyping i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.atyping i:nth-child(2) { animation-delay: .2s; } .atyping i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.asst-foot { border-top: 1px solid var(--line); background: #fff; padding: 16px 0; }
.asst-foot .inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.asst-suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.asst-suggest button { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-family: var(--font); font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .14s; }
.asst-suggest button:hover { border-color: var(--blue-400); color: var(--blue-700); background: var(--blue-50); }
.asst-input { display: flex; gap: 10px; align-items: center; background: var(--bg-soft); border: 1.5px solid var(--line-2); border-radius: 14px; padding: 7px 7px 7px 16px; }
.asst-input input { flex: 1; border: 0; background: transparent; outline: none; font-family: var(--font); font-size: 15px; color: var(--ink); }
.asst-input .snd { width: 42px; height: 42px; border-radius: 11px; background: var(--blue-600); border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.asst-input .snd:disabled { opacity: .4; cursor: not-allowed; }

.sb nav a .ct.ia { background: linear-gradient(135deg, var(--violet), var(--blue-600)); color: #fff; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .a-cards, .a-action, .a-stat { min-width: 0; }
  .sb { display: none; }
  .kgrid { grid-template-columns: 1fr 1fr; }
  .content { padding: 18px; }
}
