/* ===== Pago na Hora — App shell ===== */

html, body { height: 100%; }
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 { position: fixed; inset: 0; display: grid; grid-template-columns: 252px 1fr; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

/* ---------- SIDEBAR ---------- */
.sb { background: var(--navy-900); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; grid-column: 1; height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sb::-webkit-scrollbar { width: 8px; }
.sb::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }
.sb::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); }
.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; }
.pj-menu-acct { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; padding: 8px 9px 11px; }
.pj-menu-acct > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; font-weight: 700; color: var(--ink); font-size: 13.5px; }
.pj-menu-acct > span small { color: var(--ink-3); font-weight: 600; font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-menu-logout { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--line); margin-top: 2px; padding: 11px 10px 7px; background: #fff; color: var(--red); font-family: var(--font); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.pj-menu-logout:hover { color: #9A2E29; }

.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; min-height: 0; overflow-y: auto; }
.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; }
.verify-banner { display: flex; align-items: center; gap: 12px; padding: 11px 28px; background: #FFF8EC; border-bottom: 1px solid #F3E2BD; color: #8A5A00; font-size: 13.5px; font-weight: 600; }
.verify-banner .vb-ic { display: inline-flex; flex: none; }
.verify-banner .vb-txt { flex: 1; min-width: 0; }
.verify-banner .vb-txt b { font-weight: 800; }
.verify-banner .vb-btn { flex: none; border: 0; background: var(--amber); color: #3D2900; font-weight: 800; font-size: 12.5px; padding: 7px 13px; border-radius: 9px; cursor: pointer; transition: filter .15s; }
.verify-banner .vb-btn:hover:not(:disabled) { filter: brightness(.95); }
.verify-banner .vb-link { flex: none; border: 0; background: transparent; color: #8A5A00; font-weight: 700; font-size: 12.5px; padding: 7px 4px; cursor: pointer; text-decoration: underline; }
.verify-banner button:disabled { opacity: .55; cursor: default; }
.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 } }

.entity-form { max-width: 680px; }
.entity-form-body { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 22px 22px; box-shadow: var(--sh-xs); }
.entity-form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.entity-modal-error { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #FDF1F0; border: 1px solid #C8453F; color: #9A2E29; font-size: 13px; font-weight: 600; }
.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; }

/* ---------- NEW CONTRACT LAB ---------- */
.contract-content { max-width: 1240px; }
.contract-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.contract-stagebar { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; box-shadow: var(--sh-xs); }
.contract-stagebar span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; border-radius: 10px; color: var(--ink-3); font-size: 12.5px; font-weight: 800; }
.contract-stagebar b { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--bg-soft2); font-family: var(--mono); font-size: 10.5px; }
.contract-stagebar span.on { background: var(--blue-50); color: var(--blue-700); }
.contract-stagebar span.on b { background: var(--blue-600); color: #fff; }
.contract-scrim { justify-content: center; align-items: center; padding: 22px; }
.contract-lab { width: min(1180px, 100%); max-height: calc(100vh - 44px); background: #F6F7F9; border-radius: 20px; box-shadow: 0 34px 90px rgba(6,15,38,.34); display: grid; grid-template-columns: 210px 1fr; overflow: hidden; animation: contractIn .22s cubic-bezier(.2,.8,.2,1); }
.contract-screen { width: 100%; max-height: none; min-height: 0; box-shadow: none; border: 0; background: transparent; border-radius: 0; display: block; overflow: visible; }
.contract-screen .contract-rail { display: none; }
.contract-screen .contract-builder { overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.contract-screen .contract-workbench { padding: 0; }
.contract-screen .contract-preview { border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: sticky; top: 86px; }
@keyframes contractIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.contract-rail { background: #071225; color: #fff; padding: 18px; display: flex; flex-direction: column; gap: 22px; min-height: 0; position: relative; }
.contract-brand { display: flex; gap: 11px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.contract-brand > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--green), var(--blue-600)); box-shadow: 0 10px 26px rgba(7,150,90,.25); }
.contract-brand b { display: block; font-size: 14px; line-height: 1.15; }
.contract-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.54); font-size: 11.5px; font-weight: 650; }
.contract-steps { display: grid; gap: 8px; }
.contract-step { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.54); font-size: 13px; font-weight: 750; padding: 9px 0; }
.contract-step span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: rgba(255,255,255,.64); font-size: 11px; font-family: var(--mono); }
.contract-step.done { color: #fff; }
.contract-step.done span { background: rgba(7,150,90,.18); color: #C9F4DA; }
.contract-close { margin-top: auto; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; display: grid; place-items: center; cursor: pointer; }
.contract-close:hover { background: rgba(255,255,255,.12); }
.contract-builder { min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) 380px; gap: 0; }
.contract-workbench { padding: 26px; display: grid; gap: 14px; align-content: start; }
.contract-hero { padding: 2px 4px 8px; max-width: 720px; }
.contract-hero .dot { background: var(--blue-600); }
.contract-hero h2 { font-family: var(--font-display); font-size: 34px; font-weight: 500; letter-spacing: -.025em; margin-top: 12px; line-height: 1.04; }
.contract-hero p { color: var(--ink-2); font-size: 15px; line-height: 1.48; margin-top: 10px; max-width: 620px; }
.contract-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--sh-xs); }
.contract-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.contract-block-head h3 { font-size: 15.5px; }
.contract-block-head p { margin-top: 3px; color: var(--ink-3); font-size: 12.8px; font-weight: 650; }
.party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.party-card { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 34px 1fr 16px; align-items: center; gap: 10px; cursor: pointer; text-align: left; font-family: var(--font); color: var(--ink); transition: .15s; min-width: 0; }
.party-card:hover { border-color: var(--blue-300); background: var(--blue-50); }
.party-card.on { border-color: var(--green); background: linear-gradient(0deg, rgba(7,150,90,.08), rgba(7,150,90,.08)), #fff; box-shadow: 0 0 0 3px rgba(7,150,90,.1); }
.party-card span { min-width: 0; font-size: 13.5px; font-weight: 800; line-height: 1.2; }
.party-card small { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 650; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-combo { position: relative; display: grid; gap: 10px; }
.party-search { height: 46px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; display: grid; grid-template-columns: 18px 1fr 34px; align-items: center; gap: 9px; padding: 0 8px 0 13px; transition: .15s; }
.party-search:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(26,71,214,.1); }
.party-search input { border: 0; outline: 0; background: transparent; font-family: var(--font); color: var(--ink); font-size: 14px; min-width: 0; }
.party-search button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--bg-soft); color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.party-menu { position: absolute; left: 0; right: 0; top: 52px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 22px 48px rgba(6,15,38,.18); padding: 8px; display: grid; gap: 2px; }
.party-menu-title { padding: 6px 9px 7px; color: var(--ink-3); font-size: 10.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.party-menu button { width: 100%; min-height: 48px; border: 0; background: #fff; border-radius: 11px; padding: 9px; display: grid; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 10px; text-align: left; font-family: var(--font); cursor: pointer; color: var(--ink); }
.party-menu button:hover { background: var(--bg-soft); }
.party-menu button span { min-width: 0; font-size: 13.2px; font-weight: 800; line-height: 1.2; }
.party-menu button small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 11.3px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-menu .create-party { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 12px; color: var(--blue-700); }
.party-selected { border: 1px solid var(--green); background: linear-gradient(0deg, rgba(7,150,90,.07), rgba(7,150,90,.07)), #fff; border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 11px; }
.party-selected b { display: block; font-size: 13.8px; }
.party-selected small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; font-weight: 650; }
.party-selected > span { color: var(--green-600); background: var(--green-tint); border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 850; }
.template-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.template-strip button { min-height: 106px; border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; font-family: var(--font); position: relative; transition: .15s; }
.template-strip button:hover { transform: translateY(-1px); border-color: var(--blue-300); background: #fff; }
.template-strip button.on { background: #071225; color: #fff; border-color: #071225; box-shadow: 0 14px 28px rgba(6,15,38,.18); }
.template-strip b { display: block; font-size: 13px; line-height: 1.2; }
.template-strip span { display: block; margin-top: 7px; color: var(--ink-3); font-size: 11.7px; line-height: 1.3; font-weight: 650; }
.template-strip button.on span { color: rgba(255,255,255,.62); }
.template-strip em { position: absolute; right: 9px; bottom: 9px; font-style: normal; font-size: 10px; color: #C9F4DA; font-weight: 850; }
.source-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.source-switch button { border: 1.5px solid var(--line); background: var(--bg-soft); border-radius: 13px; padding: 14px; min-height: 118px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--ink); transition: .15s; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; row-gap: 5px; align-content: start; }
.source-switch button:hover { border-color: var(--blue-300); background: #fff; transform: translateY(-1px); }
.source-switch button.on { border-color: var(--blue-600); background: #fff; box-shadow: 0 0 0 3px rgba(26,71,214,.09); }
.source-switch button > span { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; grid-row: span 2; }
.source-switch button.on > span { background: var(--blue-600); color: #fff; }
.source-switch b { font-size: 14px; line-height: 1.2; }
.source-switch small { color: var(--ink-3); font-size: 12.2px; line-height: 1.35; font-weight: 650; }
.import-panel { margin-top: 12px; display: grid; gap: 10px; }
.dropzone { border: 1.5px dashed var(--blue-300); background: linear-gradient(0deg, rgba(26,71,214,.045), rgba(26,71,214,.045)), #fff; border-radius: 13px; padding: 13px; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.dropzone b { display: block; font-size: 13.5px; }
.dropzone small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; font-weight: 650; }
.dropzone .dot { background: var(--blue-600); }
.extracted-fields, .confirm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.extracted-fields button { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; padding: 11px; display: grid; grid-template-columns: 20px 1fr; column-gap: 9px; row-gap: 3px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--ink); }
.extracted-fields button.on { background: #fff; border-color: var(--green); box-shadow: 0 0 0 3px rgba(7,150,90,.08); }
.extracted-fields b { font-size: 12.6px; line-height: 1.2; }
.extracted-fields small { grid-column: 2; color: var(--ink-3); font-size: 11.4px; line-height: 1.3; font-weight: 650; }
.blank-start { margin-top: 12px; border: 1px solid #BCE9D2; background: var(--green-tint); border-radius: 13px; padding: 14px; display: flex; gap: 11px; align-items: flex-start; color: #075C3A; }
.blank-start b { display: block; font-size: 13.5px; }
.blank-start small { display: block; margin-top: 3px; font-size: 12.4px; line-height: 1.35; font-weight: 650; }
.suggestion-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.suggestion-strip button { min-height: 116px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--ink); transition: .15s; display: flex; flex-direction: column; gap: 7px; }
.suggestion-strip button:hover { border-color: var(--green); background: linear-gradient(0deg, rgba(7,150,90,.06), rgba(7,150,90,.06)), #fff; transform: translateY(-1px); }
.suggestion-strip b { font-size: 13px; line-height: 1.2; }
.suggestion-strip span { color: var(--ink-3); font-size: 11.7px; line-height: 1.35; font-weight: 650; }
.suggestion-strip small { margin-top: auto; color: var(--green-600); font-size: 11.5px; font-weight: 850; }
.confirm-grid button { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; padding: 12px; text-align: left; font-family: var(--font); color: var(--ink); cursor: pointer; }
.confirm-grid button.on { border-color: var(--green); background: #fff; }
.confirm-grid span { display: inline-flex; margin-bottom: 8px; background: var(--bg-soft2); color: var(--ink-3); border-radius: 999px; padding: 4px 8px; font-size: 10.5px; font-weight: 850; }
.confirm-grid button.on span { background: var(--green-tint); color: var(--green-600); }
.confirm-grid b { display: block; font-size: 12.8px; }
.confirm-grid small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11.5px; line-height: 1.3; font-weight: 650; }
.clause-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.clause-grid button { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 20px 1fr; column-gap: 9px; row-gap: 4px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--ink); transition: .15s; min-height: 92px; }
.clause-grid button:hover { background: #fff; border-color: var(--blue-300); }
.clause-grid button.on { background: #fff; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(26,71,214,.09); }
.clause-grid b { font-size: 12.8px; line-height: 1.2; }
.clause-grid small { grid-column: 2; color: var(--ink-3); font-size: 11.5px; line-height: 1.28; font-weight: 650; }
.cbx-mini { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; }
.clause-grid button.on .cbx-mini { background: var(--blue-600); border-color: var(--blue-600); }
.contract-preview { background: #EEF2F7; border-left: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.preview-paper { background: #fff; border: 1px solid #DEE5EF; border-radius: 16px; box-shadow: 0 20px 50px rgba(32,48,76,.12); padding: 20px; display: grid; gap: 16px; position: sticky; top: 22px; }
.contract-screen .preview-paper { position: static; top: auto; }
.preview-empty { min-height: 260px; align-content: center; justify-items: start; background: linear-gradient(180deg, #fff, #F8FAFC); }
.preview-empty h3 { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.12; max-width: 250px; }
.preview-empty p { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; max-width: 270px; }
.paper-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.paper-top span, .paper-line small, .money-stack small, .paper-parties small { color: var(--ink-3); font-size: 10.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.paper-top h3 { margin-top: 5px; font-size: 20px; line-height: 1.15; font-family: var(--font-display); font-weight: 500; }
.paper-ai { display: flex; align-items: flex-start; gap: 8px; background: var(--blue-50); color: var(--blue-700); border-radius: 12px; padding: 10px 11px; font-size: 12.4px; line-height: 1.35; font-weight: 750; }
.score-ring { width: 62px; height: 62px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--mono); font-weight: 800; color: var(--green-600); background: radial-gradient(circle, #fff 0 52%, transparent 53%), conic-gradient(var(--green) var(--score), #E6ECF3 0); position: relative; }
.score-ring small { font-size: 10px; margin-left: 1px; }
.paper-parties { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 10px; }
.paper-parties div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.paper-parties b { display: block; margin-top: 4px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-line p { margin-top: 6px; font-size: 13.5px; line-height: 1.48; color: var(--ink-2); }
.money-stack { display: grid; gap: 8px; }
.money-stack div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.money-stack div:last-child { border-bottom: 0; }
.money-stack b { text-align: right; font-size: 13.2px; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.paper-tags span { background: var(--blue-50); color: var(--blue-700); border-radius: 999px; padding: 6px 9px; font-size: 11.5px; font-weight: 800; }
.paper-checks { display: grid; gap: 8px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.paper-checks div { display: flex; align-items: center; gap: 8px; font-size: 12.8px; font-weight: 750; color: var(--ink-2); }
.contract-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: auto; }
.btn:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; transform: none; }

/* 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; }
  .contract-scrim { padding: 10px; align-items: stretch; }
  .contract-lab { max-height: calc(100vh - 20px); grid-template-columns: 1fr; border-radius: 16px; }
  .contract-rail { min-height: auto; padding: 12px; flex-direction: row; align-items: center; gap: 12px; }
  .contract-brand { padding-bottom: 0; border-bottom: 0; flex: 1; min-width: 0; }
  .contract-brand b, .contract-brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .contract-steps { display: none; }
  .contract-close { margin-top: 0; }
  .contract-builder { grid-template-columns: 1fr; }
  .contract-workbench { padding: 18px; }
  .contract-hero h2 { font-size: 27px; }
  .party-grid, .template-strip, .source-switch, .extracted-fields, .suggestion-strip, .confirm-grid, .clause-grid, .field-row { grid-template-columns: 1fr; }
  .dropzone { grid-template-columns: 34px 1fr; }
  .dropzone .badge { grid-column: 2; width: fit-content; }
  .contract-preview { border-left: 0; border-top: 1px solid var(--line); padding: 18px; }
  .preview-paper { position: static; }
  .contract-actions { position: sticky; bottom: 0; background: #EEF2F7; padding-top: 10px; }
}
