:root {
  --navy: #0a2a5e;
  --blue: #1565e0;
  --blue-600: #0f55c4;
  --blue-50: #eef4fd;
  --blue-100: #dde9fc;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e3e7ee;
  --border-strong: #cfd6e1;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --green: #0f8a4a;
  --green-bg: #e5f6ec;
  --red: #c62828;
  --red-bg: #fdecec;
  --amber: #a15c00;
  --amber-bg: #fff3dc;
  --in: #1d6fe0;
  --out: #e8710a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .6em; }
svg { fill: currentColor; }
.boot, .loading-view { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in { color: var(--green); }
.out { color: var(--red); }
.hidden, [hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; padding: 22px 20px 18px; }
.brand img { max-width: 170px; max-height: 46px; object-fit: contain; }
.sidebar nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.sidebar nav a svg { width: 19px; height: 19px; opacity: .75; }
.sidebar nav a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.sidebar nav a.active { background: var(--navy); color: #fff; }
.sidebar nav a.active svg { opacity: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
main { min-width: 0; }
.page { padding: 28px 32px 60px; max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; color: var(--navy); }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.loading { cursor: progress; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: #07204a; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a61f1f; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 15px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-100); border-color: var(--blue); }
input[type=checkbox] { width: auto; accent-color: var(--blue); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input[readonly] { background: var(--bg); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; font-weight: 500; }
.grid-form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.grid-form > * { grid-column: span 12; }
.c2 { grid-column: span 2 !important; } .c3 { grid-column: span 3 !important; } .c4 { grid-column: span 4 !important; }
.c5 { grid-column: span 5 !important; } .c6 { grid-column: span 6 !important; } .c8 { grid-column: span 8 !important; } .c9 { grid-column: span 9 !important; }

/* ---------- cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card + .card { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #f8fafd; }
.table .actions-cell { white-space: nowrap; text-align: right; width: 1%; }
.table tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--border); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .btn { margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-gray { background: #eef0f3; color: #4b5563; }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.badge-navy { background: #e3e9f4; color: var(--navy); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select, .toolbar input[type=date] { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi .foot b { color: var(--text-2); }
.kpi.alert .value { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.dash-grid > .card + .card { margin-top: 0; }
.chart-box { position: relative; height: 290px; padding: 12px 18px 16px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.hatch { background-image: repeating-linear-gradient(135deg, currentColor 0 2px, transparent 2px 5px) !important; border: 1.5px solid currentColor; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: 12px; color: var(--muted); }
.funnel { padding: 14px 20px 18px; display: grid; gap: 10px; }
.funnel .row { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--in); min-width: 2px; }
.funnel .track { background: #f0f2f6; border-radius: 4px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 40, .45); display: grid; place-items: center; padding: 20px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-wide { max-width: 780px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal header h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-weight: 500; max-width: 380px; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- login (mesmo visual do site) ---------- */
.login { --l-navy: #0b1a3a; --l-navy-2: #0b2a6b; --l-blue: #1e6ff0; --l-blue-d: #1557d1; --l-sky: #8db4ff; --l-on: #c8d3ea; --l-on-2: #9fb0d3;
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #fff;
  font-family: 'Plus Jakarta Sans', var(--font); background: linear-gradient(155deg, var(--l-navy) 0%, #0c2050 55%, var(--l-navy-2) 100%); }
.login::after { content: ''; position: absolute; right: -10%; top: 20%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(30, 111, 240, .28), transparent); filter: blur(40px); pointer-events: none; }
.login-mark { position: absolute; left: -380px; top: 50%; width: 1080px; transform: translateY(-50%); opacity: .14; pointer-events: none; user-select: none; }
.login-top, .login-main, .login-foot { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.login-top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.login-logo { height: 32px; width: auto; }
.login-back { display: inline-flex; align-items: center; gap: 8px; color: var(--l-on); font-size: 14.5px; font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); transition: background .2s, color .2s; }
.login-back:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }
.login-back svg, .login-submit svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.login-back:hover svg { transform: translateX(-3px); }

.login-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(48px, 8vw, 120px); align-items: center; padding-top: 32px; padding-bottom: 48px; }
.login-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--l-sky); margin: 0; }
.login-kicker::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.login-copy h1 { text-wrap: balance; margin-top: 16px; font-size: clamp(36px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; color: #fff; }
.login-lead { margin: 20px 0 0; font-size: 18px; line-height: 1.6; color: var(--l-on); max-width: 44ch; }
.login-points { list-style: none; margin: 36px 0 0; padding: 26px 0 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 14px; font-size: 15.5px; color: var(--l-on); }
.login-points span { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--l-sky); background: rgba(30, 111, 240, .16); border: 1px solid rgba(141, 180, 255, .18); }
.login-points svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-card { position: relative; display: grid; gap: 18px; padding: 34px 32px 28px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 40px 80px -30px rgba(0, 0, 0, .7); }
@supports (backdrop-filter: blur(8px)) { .login-card { backdrop-filter: blur(16px) saturate(140%); } }
.login-card-head h2 { font-size: 24px; letter-spacing: -.02em; color: #fff; }
.login-card-head p { margin: 6px 0 0; font-size: 14.5px; color: var(--l-on-2); }
.login-field { display: grid; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--l-on); }
.login-input { position: relative; display: flex; align-items: center; }
.login-input > svg { position: absolute; left: 14px; width: 18px; height: 18px; fill: none; stroke: var(--l-on-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .2s; }
.login-input input { width: 100%; height: 50px; padding: 0 46px 0 44px; font: 500 15.5px 'Plus Jakarta Sans', var(--font); color: #fff; background: rgba(5, 12, 30, .4); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.login-input input::placeholder { color: rgba(200, 211, 234, .45); }
.login-input input:hover { border-color: rgba(255, 255, 255, .24); }
.login-input input:focus { border-color: var(--l-blue); background: rgba(5, 12, 30, .55); box-shadow: 0 0 0 4px rgba(30, 111, 240, .25); }
.login-input:focus-within > svg { stroke: var(--l-sky); }
.login-input input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 40px #0f2148 inset; caret-color: #fff; }
.login-eye { position: absolute; right: 6px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--l-on-2); cursor: pointer; transition: background .2s, color .2s; }
.login-eye:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.login-eye[aria-pressed="true"] { color: var(--l-sky); }
.login-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-caps { font-size: 12.5px; font-weight: 600; color: #fcd581; }
.login-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--l-on); cursor: pointer; user-select: none; }
.login-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--l-blue); }
.login .login-error { color: #ffb4ab; font-weight: 600; min-height: 0; margin: -4px 0; }
.login .login-error:empty { display: none; }
.login-submit { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border: 0; border-radius: 12px; cursor: pointer;
  font: 700 16px 'Plus Jakarta Sans', var(--font); color: #fff; background: var(--l-blue); box-shadow: 0 10px 24px -10px rgba(30, 111, 240, .9); transition: background .2s, transform .15s, box-shadow .2s; }
.login-submit:hover { background: var(--l-blue-d); }
.login-submit:hover svg { transform: translateX(3px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { cursor: default; opacity: .8; }
.login-submit.loading span::after { content: '…'; }
.login-submit.loading svg { animation: lgSpin 1s linear infinite; }
.login-note { margin: 0; text-align: center; font-size: 13px; color: var(--l-on-2); }
.login-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 22px; font-size: 13px; color: var(--l-on-2); }
.login-foot::before { content: ''; position: absolute; top: 0; left: 32px; right: 32px; height: 1px; background: rgba(255, 255, 255, .08); }
.login-foot a { color: var(--l-on); }
.login-foot a:hover { color: #fff; }

/* entrada e erro */
@keyframes lgRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lgShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes lgSpin { to { transform: rotate(360deg); } }
.login-copy > * { animation: lgRise .7s cubic-bezier(.2, .7, .2, 1) both; }
.login-copy > :nth-child(2) { animation-delay: .08s; }
.login-copy > :nth-child(3) { animation-delay: .16s; }
.login-copy > :nth-child(4) { animation-delay: .24s; }
.login-card { animation: lgRise .8s .15s cubic-bezier(.2, .7, .2, 1) both; }
.login-card.shake { animation: lgShake .45s cubic-bezier(.36, .07, .19, .97) both; }
@media (prefers-reduced-motion: reduce) { .login-copy > *, .login-card, .login-card.shake, .login-submit.loading svg { animation: none; } }

@media (max-width: 960px) {
  .login-main { grid-template-columns: 1fr; gap: 32px; padding-top: 16px; }
  .login-copy { text-align: left; }
  .login-points { display: none; }
  .login-lead { font-size: 16.5px; }
  .login-mark { width: 620px; left: -260px; top: 30%; }
}
@media (max-width: 560px) {
  .login-top, .login-main, .login-foot { padding-left: 20px; padding-right: 20px; }
  .login-foot::before { left: 20px; right: 20px; }
  .login-top { height: 64px; }
  .login-logo { height: 28px; }
  .login-back { padding: 7px 10px; font-size: 13.5px; }
  .login-copy h1 { font-size: 32px; }
  .login-lead { display: none; }
  .login-card { padding: 26px 20px 22px; }
  .login-foot { flex-direction: column; gap: 6px; }
}
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- quote editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 80px; display: grid; gap: 14px; }
.summary .opt { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.summary .opt:last-child { border-bottom: 0; }
.summary .opt b { display: block; }
.summary .opt .price { font-size: 20px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.summary .opt .meta { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--blue); }
.tabs button .star { color: var(--blue); }
.section-box { border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; }
.section-box > header { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.section-box > header input { font-weight: 600; color: var(--blue-600); }
.section-box .sec-total { font-size: 12px; color: var(--muted); white-space: nowrap; }
.add-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 4px 12px 12px; }

/* editor em passos */
.qe-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.savestate { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.savestate.ss-saved { color: var(--green); }
.savestate.ss-notitle, .savestate.ss-error { color: var(--red); }
.stepper { display: flex; align-items: center; gap: 6px; margin: -6px 0 18px; overflow-x: auto; padding-bottom: 2px; }
.stepper button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 14px 6px 6px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.stepper button .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: 12.5px; }
.stepper button.done .n { background: var(--green-bg); color: var(--green); }
.stepper button.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.stepper button.on .n { background: #fff; color: var(--navy); }
.stepper .sep { flex: 0 0 18px; height: 2px; background: var(--border); }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
input.big { font-size: 17px; font-weight: 600; padding: 10px 12px; }
.quick-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--blue-50); border-color: var(--blue-100); }
details.more > summary, .more-inline > summary { cursor: pointer; font-weight: 600; list-style: none; }
details.more > summary { padding: 14px 20px; }
details.more > summary::-webkit-details-marker, .more-inline > summary::-webkit-details-marker { display: none; }
details.more > summary::before, .more-inline > summary::before { content: "\25B8"; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
details[open].more > summary::before, details[open].more-inline > summary::before { transform: rotate(90deg); }
details[open].more > summary { border-bottom: 1px solid var(--border); }
.more-inline { margin-top: 16px; }
.more-inline > summary { font-size: 13.5px; padding: 6px 0; }
.rec-row { padding: 10px 20px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.inherit-check { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 8px; padding: 10px 12px; align-items: flex-start; }
.its { padding: 6px 0 2px; }
.it { display: grid; grid-template-columns: minmax(0, 1fr) 92px 92px 34px; gap: 8px; align-items: start; padding: 6px 12px; }
.it + .it { border-top: 1px dashed var(--border); }
.it-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.it-main .it-title { font-weight: 500; }
.it-main .it-desc { border-color: transparent; background: transparent; font-size: 12.5px; color: var(--text-2); padding: 3px 10px; }
.it-main .it-desc:hover, .it-main .it-desc:focus { border-color: var(--border-strong); background: var(--surface); }
.it-hours { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); padding-right: 8px; }
.it-hours input { border: 0; padding: 8px 4px 8px 10px; text-align: right; outline: none !important; }
.it-hours:focus-within { outline: 2px solid var(--blue-100); border-color: var(--blue); }
.it-hours span { color: var(--muted); font-size: 13px; }
.it-val { text-align: right; padding-top: 9px; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; font-size: 13px; }
.pay-box { margin-top: 18px; display: grid; gap: 8px; }
.pay-box .field { font-size: 13px; font-weight: 500; color: var(--text-2); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.presets .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.opt-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.cmp-preview { max-height: 420px; overflow: auto; }
.checklist { list-style: none; margin: 0; padding: 8px 20px 14px; }
.checklist li { display: flex; gap: 10px; padding: 7px 0; align-items: baseline; }
.checklist li > span { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.checklist li.ok > span { background: var(--green-bg); color: var(--green); }
.checklist li.warn > span { background: var(--amber-bg); color: var(--amber); }
.pdf-frame { background: #e9ecf1; padding: 16px; border-radius: 0 0 var(--radius) var(--radius); }
.pdf-frame iframe { width: 100%; height: 760px; border: 0; background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.send-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.send-box > div { flex: 1; min-width: 220px; }
.side-actions { display: grid; gap: 8px; }
.paste-preview { margin-top: 12px; max-height: 260px; overflow: auto; }
.paste-preview .pp-sec { font-weight: 700; color: var(--blue-600); margin: 10px 0 4px; }
.pp-it { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cmp { width: 100%; border-collapse: collapse; }
.cmp th { font-size: 12px; text-align: left; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--border); }
.cmp td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.cmp td select, .cmp td input.val { width: 130px; }
.cmp .valcell { display: flex; gap: 4px; }
.inline-note { background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--navy); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* ---------- order detail ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.stats > div { padding: 14px 20px; }
.stats > div + div { border-left: 1px solid var(--border); }
.stats small { color: var(--muted); font-size: 12px; display: block; }
.stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; margin: 0 20px 18px; }
.progress div { height: 100%; background: var(--green); border-radius: 4px; }
dl.info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding: 18px 20px; }
dl.info dt { font-size: 12px; color: var(--muted); }
dl.info dd { margin: 2px 0 0; font-weight: 500; }

/* ---------- settings ---------- */
.logo-box { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- cargos ---------- */
.role-mods { display: flex; flex-wrap: wrap; gap: 4px; }
.callout-info { background: var(--blue-50); color: var(--navy); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 0 0 10px; }
.perm-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: auto; }
.perm-matrix { width: 100%; border-collapse: collapse; }
.perm-matrix th, .perm-matrix td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.perm-matrix thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; white-space: nowrap; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; width: 100%; }
.perm-matrix tr.grp th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); background: var(--bg); padding: 6px 10px; }
.perm-matrix tbody tr:not(.grp):hover td { background: #f8fafd; }
.perm-matrix tbody:last-child tr:last-child td { border-bottom: 0; }
.perm-matrix input[type="checkbox"] { width: 17px; height: 17px; margin: 0; padding: 0; cursor: pointer; accent-color: var(--blue); }
.perm-matrix input[type="checkbox"]:disabled { cursor: not-allowed; }
.logo-preview { width: 240px; height: 90px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; background: #fff; padding: 12px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }
.rate-example { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .editor, .settings-grid { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  dl.info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* grids de cards não herdam o espaçamento vertical entre cards empilhados */
.kpis > .card + .card, .dash-grid > .card + .card, .settings-grid > .card + .card { margin-top: 0; }
.card-head { flex-wrap: wrap; }
.cmp td:first-child { width: 45%; min-width: 220px; }

/* ---------- barra superior (sino + usuário) ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; justify-content: flex-end; padding: 0 32px;
  background: rgba(244, 246, 250, .88); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .bell { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); }
.topbar .bell svg { width: 20px; height: 20px; }
.topbar .bell .bell-count { border-color: var(--bg); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 10px 3px 3px; font: inherit; cursor: pointer; color: var(--text); text-align: left; }
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.user-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
.user-txt { display: flex; flex-direction: column; line-height: 1.2; max-width: 180px; }
.user-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-txt small { font-size: 11.5px; color: var(--muted); }
.user-btn .chev { width: 18px; height: 18px; color: var(--muted); }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16); padding: 6px; z-index: 40; }
.user-drop[hidden] { display: none; }
.user-drop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.user-drop-head small { color: var(--muted); font-size: 12px; }
.user-drop a, .user-drop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-decoration: none !important; }
.user-drop a:hover, .user-drop button:hover { background: var(--bg); }
.user-drop svg { width: 18px; height: 18px; color: var(--muted); }
.user-drop #logout { color: var(--red); }
.user-drop #logout svg { color: var(--red); }

/* ---------- menu: grupos, contadores e sino de avisos ---------- */
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 4px; }
.sidebar nav a .nav-count { margin-left: auto; }
.nav-count, .bell-count { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.nav-count.late, .bell-count.late { background: var(--red); }
.nav-count[hidden], .bell-count[hidden] { display: none; }
.bell { position: relative; }
.bell .bell-count { position: absolute; top: -2px; right: -4px; border: 2px solid var(--surface); height: 20px; }

/* ---------- avisos (contas a receber / a pagar) ---------- */
.alert-banner { background: var(--red-bg); color: var(--red); border: 1px solid #f6c9c9; border-radius: var(--radius); padding: 11px 16px; margin-bottom: 14px; font-size: 13.5px; }
.alert-banner b { color: var(--red); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; margin-left: 4px; }
.alert-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.alert-card { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tone); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 15px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: transform .1s, box-shadow .15s; }
.alert-card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .1); }
.alert-card.on { outline: 2px solid var(--tone); outline-offset: -1px; background: var(--tone-bg); }
.alert-card .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.alert-card .value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tone-text, var(--text)); }
.alert-card .foot { font-size: 12px; color: var(--muted); }
.alert-card.zero .value { color: var(--muted); }
.tone-red { --tone: var(--red); --tone-bg: var(--red-bg); --tone-text: var(--red); }
.tone-amber { --tone: #e39a17; --tone-bg: var(--amber-bg); --tone-text: var(--amber); }
.tone-blue { --tone: var(--blue); --tone-bg: var(--blue-50); }
.tone-gray { --tone: var(--border-strong); --tone-bg: var(--bg); }
.tone-green { --tone: var(--green); --tone-bg: var(--green-bg); --tone-text: var(--green); }
.due { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.due-late { color: var(--red); }
.due-today { color: var(--amber); }
.due-soon { color: var(--blue-600); }
.table tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.num.in { color: var(--green); }

/* detalhe de um lançamento */
.tx-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.tx-detail-head h3 { font-size: 17px; margin-top: 2px; }
.tx-detail-amount { font-size: 20px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-detail-status { display: flex; gap: 10px; align-items: center; margin: 10px 0 4px; }
.tx-detail dl.info { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 0 0; }

/* ---------- calendário (estilo Teams) ---------- */
.page-cal { max-width: 1480px; }
.cal-summary { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cs { flex: 1 1 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 15px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--shadow); }
.cs span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cs b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cs small { font-size: 12px; color: var(--muted); }
.cs.in-box { border-top: 3px solid var(--in); }
.cs.out-box { border-top: 3px solid var(--out); }
.cs.late-box { border-top: 3px solid var(--red); }
.cs.late-box b { color: var(--red); }
.cal { overflow: hidden; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav h2 { font-size: 18px; font-weight: 600; margin-left: 8px; }
.cal-nav .icon-btn { font-size: 22px; }
.cal-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--c); }
.chip.on i { background: var(--c); }
.chip:not(.on) { color: var(--muted); }
.chip-in { --c: var(--in); }
.chip-out { --c: var(--out); }
.chip-paid { --c: var(--green); }

.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-head div { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 6px 8px; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-cell:hover { background: #f8fafd; }
.cal-cell.weekend { background: #fbfbfd; }
.cal-cell.other .num { color: #b3b9c4; }
.cal-day { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; }
.cal-day .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.cal-cell.today .num { background: var(--blue); color: #fff; }
.cal-cell.today { background: var(--blue-50); }
.cal-tot { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; }
.cal-tot .in, .wk-tot .in { color: var(--in); }
.cal-tot .out, .wk-tot .out { color: var(--out); }
.cal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-more { font-size: 12px; font-weight: 600; color: var(--blue-600); padding-left: 4px; }

/* evento: barra colorida à esquerda, como no Teams (azul = receber, laranja = pagar) */
.ev { --c: var(--in); --bg: #e9f1fd; display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; text-align: left; border: 0; border-left: 3px solid var(--c); background: var(--bg); color: var(--text); border-radius: 4px; padding: 3px 6px; font: inherit; font-size: 12px; cursor: pointer; }
.ev:hover { filter: brightness(.96); }
.ev-out { --c: var(--out); --bg: #fdf0e5; }
.ev-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); min-width: 0; }
.ev.late { box-shadow: inset 0 0 0 1px #f2b8b8; background: var(--red-bg); }
.ev.late .ev-amt, .ev.late .ev-title { color: var(--red); }
.ev.paid { opacity: .55; }
.ev.paid .ev-txt, .ev.paid .ev-title { text-decoration: line-through; }
.ev-big { flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 9px; font-size: 12.5px; }
.ev-title { font-weight: 600; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: 11.5px; color: var(--muted); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 460px; }
.wk-col { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.wk-col:last-child { border-right: 0; }
.wk-col.weekend { background: #fbfbfd; }
.wk-head { display: flex; flex-direction: column; padding: 10px 10px 4px; border-bottom: 3px solid transparent; }
.wk-num { font-size: 24px; font-weight: 600; line-height: 1.1; }
.wk-name { font-size: 12px; color: var(--muted); }
.wk-col.today .wk-head { border-bottom-color: var(--blue); }
.wk-col.today .wk-num, .wk-col.today .wk-name { color: var(--blue); }
.wk-col.today { background: #f7faff; }
.wk-tot { font-size: 11.5px; font-weight: 600; padding: 4px 10px 6px; display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.wk-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.wk-empty { color: #c3c8d1; text-align: center; padding-top: 12px; }

.cal-list { padding: 4px 0; }
.ag-day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ag-day:last-child { border-bottom: 0; }
.ag-date { display: flex; flex-direction: column; align-items: flex-start; background: none; border: 0; font: inherit; cursor: pointer; padding: 4px 0; color: var(--text); }
.ag-num { font-size: 24px; font-weight: 600; line-height: 1; }
.ag-wd { font-size: 12px; color: var(--muted); }
.ag-day.today .ag-num, .ag-day.today .ag-wd { color: var(--blue); }
.ag-items { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-item, .al-item { --c: var(--in); display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 6px; padding: 9px 12px; cursor: pointer; }
.ag-item:hover, .al-item:hover { background: #f8fafd; }
.ag-item.ev-out, .al-item.ev-out { --c: var(--out); }
.ag-item.late { background: #fff8f8; border-color: #f6d4d4; border-left-color: var(--red); }
.ag-item.paid { opacity: .6; }
.ag-main { display: flex; flex-direction: column; min-width: 0; }
.ag-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.day-panel { padding: 0; }

/* painel de avisos */
.al-group + .al-group { margin-top: 16px; }
.al-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.al-title span { background: currentColor; color: inherit; border-radius: 999px; padding: 0 7px; font-size: 11px; }
.al-title span { color: #fff; }
.al-late .al-title { color: var(--red); }
.al-late .al-title span { background: var(--red); }
.al-today .al-title { color: var(--amber); }
.al-today .al-title span { background: #e39a17; }
.al-soon .al-title { color: var(--blue-600); }
.al-soon .al-title span { background: var(--blue); }
.al-group .al-item + .al-item { margin-top: 6px; }

@media (max-width: 1100px) {
  .alert-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-cells { grid-auto-rows: minmax(96px, auto); }
}

/* ---------- app mobile (barra superior + abas inferiores) ---------- */
.appbar, .tabbar { display: none; }
.sheet-nav { display: grid; gap: 2px; margin: -8px -8px 0; }
.sheet-nav a, .sheet-nav button { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 10px; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none !important; }
.sheet-nav a:active, .sheet-nav button:active { background: var(--bg); }
.sheet-nav svg { width: 22px; height: 22px; color: var(--muted); }
.sheet-nav .avatar { width: 24px; height: 24px; font-size: 10px; }
.sheet-nav [data-logout] { color: var(--red); border-top: 1px solid var(--border); border-radius: 0; margin-top: 6px; padding-top: 16px; }
.sheet-nav [data-logout] svg { color: var(--red); }

@media (max-width: 780px) {
  .perm-matrix th, .perm-matrix td { padding: 8px 5px; }
  .perm-matrix thead th { font-size: 11px; }
  .alert-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .alert-card .value { font-size: 16px; }
  .cal-bar { padding: 10px 12px; }
  .cal-nav { width: 100%; }
  .cal-nav h2 { font-size: 16px; flex: 1; }
  .cal-tools { width: 100%; }
  .cal-tools .seg { width: 100%; }
  .cs { flex: 1 1 140px; padding: 9px 12px; }
  .cs b { font-size: 15px; }
  /* mês no celular: bolinhas coloridas no dia; toque no dia abre a lista */
  .cal-cells { grid-auto-rows: 58px; }
  .cal-cell { padding: 4px 2px; align-items: center; gap: 2px; }
  .cal-day { justify-content: center; }
  .cal-tot, .cal-more { display: none; }
  .cal-evs { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
  .cal-month .ev { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--c); font-size: 0; }
  .cal-month .ev.late { background: var(--red); box-shadow: none; }
  .cal-month .ev > * { display: none; }
  .cal-head div { text-align: center; padding: 6px 0; }
  .cal-week { grid-template-columns: 1fr; min-height: 0; }
  .wk-col { border-right: 0; border-bottom: 1px solid var(--border); }
  .wk-head { flex-direction: row; align-items: baseline; gap: 8px; border-bottom: 0; }
  .wk-num { font-size: 18px; }
  .wk-tot { border-bottom: 0; padding-top: 0; }
  .wk-empty { display: none; }
  .ag-day { grid-template-columns: 56px minmax(0, 1fr); padding: 10px 12px; gap: 8px; }
  .ag-item, .al-item { padding: 9px 10px; }
  .tx-detail-head { flex-direction: column; gap: 4px; }
  :root { --appbar-h: 56px; --tabbar-h: 62px; }
  html { scroll-padding-top: calc(var(--appbar-h) + env(safe-area-inset-top) + 12px); scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  body { -webkit-tap-highlight-color: transparent; }
  /* nas listas o título já aparece na barra superior */
  .page-head:not(.keep) h1, .page-head:not(.keep) .sub { display: none; }
  .page-head:not(.keep) .actions:empty { display: none; }
  .layout { display: block; }
  .sidebar { display: none; }
  .topbar { display: none; }

  .appbar { display: flex; align-items: center; gap: 12px; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: calc(var(--appbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
    background: rgba(255, 255, 255, .94); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
  .appbar-logo { height: 28px; max-width: 96px; object-fit: contain; }
  .appbar-title { flex: 1; font-size: 16px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar .avatar { width: 32px; height: 32px; font-size: 12px; text-decoration: none; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; background: none; border: 0; cursor: pointer; text-decoration: none !important; min-width: 0; }
  .tabbar svg { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 14px; transition: background .15s; }
  .tabbar .active { color: var(--navy); font-weight: 600; }
  .tabbar .active svg { background: var(--blue-50); color: var(--blue); }

  main { padding-top: calc(var(--appbar-h) + env(safe-area-inset-top)); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .page { padding: 16px 16px 24px; }
  .page-head { margin-bottom: 16px; align-items: stretch; }
  .page-head h1 { font-size: 20px; }
  .page-head > div:first-child { width: 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1; }
  .btn { height: 42px; }
  .btn-sm { height: 34px; }
  input, select, textarea { font-size: 16px; padding: 10px 12px; } /* 16px evita o zoom automático do iOS */
  .icon-btn { width: 38px; height: 38px; }

  .card { border-radius: 14px; }
  .card-head { padding: 14px 16px; }
  .card-head > div { flex-wrap: wrap; min-width: 0; }
  .card-pad { padding: 16px; }
  .grid-form > * { grid-column: span 12 !important; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 18px; }
  .kpi .foot { font-size: 11px; }
  .chart-box { height: 230px; padding: 8px 10px 12px; }
  .list li { padding: 12px 16px; }

  .toolbar { gap: 8px; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; order: -1; }
  .toolbar select { flex: 1; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 10px 8px; }

  /* tabelas viram cartões */
  .table thead { display: none; }
  .table, .table tbody, .table tfoot, .table tr { display: block; width: 100%; }
  .table tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .table td[data-label=""]::before { content: none; }
  .table td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  .table td:first-child::before { content: none; }
  .table td.actions-cell { width: auto; justify-content: flex-end; padding-top: 8px; }
  .table td.actions-cell::before { content: none; }
  .table tbody tr.clickable:hover td { background: none; }
  .table tbody tr.clickable:active { background: #f3f6fb; }
  .table tfoot tr { display: flex; justify-content: space-between; padding: 12px 16px; background: #fafbfc; border-top: 1px solid var(--border); }
  .table tfoot td { background: none; border: 0; padding: 0; }
  .table tfoot td:empty { display: none; }
  .table td input { max-width: 60%; }

  /* editor de orçamento */
  main { overflow-x: clip; }
  .editor { display: flex; flex-direction: column; align-items: stretch; }
  .editor > * { min-width: 0; }
  .editor-side { order: -1; position: static; }
  .summary #summary { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .summary .opt { flex: 0 0 78%; scroll-snap-align: start; border-bottom: 0; border-right: 1px solid var(--border); }
  .add-row { padding: 8px 12px 12px; }
  .hide-m { display: none; }
  .side-actions { display: none; }
  .stepper { margin: 0 -16px 14px; padding: 0 16px 2px; }
  .stepper .sep { flex-basis: 10px; }
  .stepper button:not(.on) .l { display: none; }
  .stepper button:not(.on) { padding-right: 6px; }
  .it { grid-template-columns: minmax(0, 1fr) 84px 30px; padding: 10px 12px; }
  .it-main { grid-column: 1 / -1; }
  .it-val { text-align: left; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .btn { width: 100%; }
  .pdf-frame { padding: 8px; }
  .pdf-frame iframe { height: 520px; }
  .cmp thead { display: none; }
  .cmp, .cmp tbody, .cmp tr { display: block; }
  .cmp tr { padding: 12px 16px; border-bottom: 1px solid var(--border); position: relative; }
  .cmp td { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; padding: 3px 0; }
  .cmp td:first-child { width: auto; min-width: 0; padding-right: 44px; }
  .cmp td[data-label]:not(:first-child)::before { content: attr(data-label); font-size: 13px; color: var(--muted); }
  .cmp td.x { position: absolute; top: 12px; right: 12px; padding: 0; }
  .cmp td select, .cmp td input.val { width: 150px; }

  dl.info { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { padding: 12px 16px; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stats b { font-size: 16px; }

  /* modais viram painéis que sobem da parte de baixo */
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal-wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; animation: sheet-up .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .modal header { padding: 10px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal footer { padding: 12px 16px; }
  .modal footer .btn { flex: 1; }

  #toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); align-items: center; }
  .toast { max-width: 100%; }

  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-form { align-items: start; padding-top: calc(48px + env(safe-area-inset-top)); }
  .login-form img { margin: 0 auto 18px; display: block; }
  .logo-preview { width: 100%; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.rate-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rate-add select { flex: 1 1 220px; width: auto; }
.rate-add input { flex: 0 1 180px; width: auto; }
.table tr.row-off td { opacity: .6; }

/* ---------- funcionalidades prontas no orçamento ---------- */
.ac { position: fixed; z-index: 60; max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 14px 34px rgba(16, 24, 40, .18); padding: 4px; }
.ac[hidden] { display: none; }
.ac-it { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--text); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.ac-it:hover, .ac-it.on { background: var(--blue-50); }
.ac-it.used { opacity: .55; }
.ac-main, .pick-main { display: flex; flex-direction: column; min-width: 0; }
.ac-main b, .pick-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-main small, .pick-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-side, .pick-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-variant-numeric: tabular-nums; }
.ac-side small, .pick-side small { color: var(--muted); font-size: 12px; }
.ac-foot { font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px; border-top: 1px solid var(--border); margin-top: 2px; }
.pick-list { margin-top: 12px; max-height: 55vh; overflow-y: auto; }
.pick-cat { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); padding: 12px 4px 6px; }
.pick-it { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.pick-it + .pick-it { margin-top: 6px; }
.pick-it:hover { background: #f8fafd; }
.pick-it:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.pick-it input { width: 17px; height: 17px; flex: none; }
.pick-main { flex: 1; }
.pick-it.used .used-tag { color: var(--amber); }

/* painel de funcionalidades prontas no passo "Escopo e preço" */
.cat-panel { margin-top: 18px; border: 1px solid var(--blue-100); background: var(--blue-50); border-radius: 10px; padding: 14px; }
.cat-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.cat-head b { color: var(--navy); }
.cat-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat-tools input[type=search] { width: 260px; background: var(--surface); }
.cat-target { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cat-target select { width: auto; max-width: 200px; }
.cat-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 10px; }
.cat-cats .chip { white-space: nowrap; background: var(--surface); }
.cat-cats .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-items { display: flex; flex-wrap: wrap; gap: 6px; max-height: 196px; overflow-y: auto; }
.cat-it { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 6px 10px 6px 7px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.cat-it:hover { border-color: var(--blue); }
.cat-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); font-weight: 700; font-size: 13px; }
.cat-h { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-it.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-it.on .cat-ico { background: #fff; color: var(--navy); }
.cat-it.on .cat-h { color: rgba(255, 255, 255, .75); }
@media (max-width: 780px) {
  .cat-tools, .cat-tools input[type=search] { width: 100%; }
  .cat-items { max-height: 240px; }
}

/* ---------- orçamento: passo "Escopo" (montador estilo carrinho) ---------- */
.editor.no-side { grid-template-columns: minmax(0, 1fr); }
.editor.no-side .editor-side { display: none; }
.opt-hint { font-size: 13px; color: var(--text-2); margin: -4px 0 14px; }
.opt-bar .tabs { padding: 0 12px; }
.opt-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 12px 20px 14px; }
.opt-row .field { width: 220px; }
.opt-row .check { padding-bottom: 9px; }
.opt-inherit { background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 8px; padding: 8px 12px !important; align-self: center; }
.opt-acts { margin-left: auto; display: flex; gap: 6px; padding-bottom: 4px; }
.scope-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.scope-layout.ro { grid-template-columns: minmax(0, 1fr); }
.scope-layout > .card + .card { margin-top: 0; }

.adder { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.ad-head { padding: 16px 16px 10px; }
.ad-head h3 { font-size: 15px; margin-bottom: 10px; }
.ad-head input { font-size: 15px; padding: 10px 12px; }
.ad-cats { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 16px 10px; }
.ad-cats .chip { font-size: 12px; padding: 3px 9px; }
.ad-cats .chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ad-list { overflow-y: auto; padding: 0 10px 8px; flex: 1; min-height: 120px; border-top: 1px solid var(--border); padding-top: 8px; }
.ad-it { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid transparent; background: none; font: inherit; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; }
.ad-it:hover, .ad-it.hl { background: var(--blue-50); border-color: var(--blue-100); }
.ad-ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; background: var(--blue-50); color: var(--blue); border: 1px solid var(--blue-100); }
.ad-it.on .ad-ico { background: var(--green); color: #fff; border-color: var(--green); }
.ad-it.on .ad-main b { color: var(--green); }
.ad-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ad-main b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-h { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.ad-h small { color: var(--muted); font-size: 11.5px; }
.ad-custom { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--blue); border-radius: 8px; background: #fff; margin-bottom: 6px; }
.ad-crow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ad-custom.hl { background: var(--blue-50); }
.ad-custom .ad-main b { color: var(--blue-600); white-space: normal; }
.ad-ch { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.ad-ch input { width: 62px; padding: 6px 6px; text-align: right; }
.ad-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.ad-foot .link { font-size: 12px; margin: 0; }

.scope { overflow: visible; }
.sc-head { position: sticky; top: 60px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.sc-head h3 { font-size: 15px; }
.sc-total { display: flex; flex-direction: column; align-items: flex-end; }
.sc-total b { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sc-total small { font-size: 12px; color: var(--muted); }
.sc-inherit { margin: 12px 20px 0; padding: 9px 12px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 8px; font-size: 13px; color: var(--navy); }
.sc-empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.sc-empty b { color: var(--text); font-size: 15px; }
.sc-empty p { max-width: 380px; margin: 6px auto 0; }
.sg { padding: 6px 0; }
.sg + .sg { border-top: 1px solid var(--border); }
.sg-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px 2px 20px; }
.sg-title { border: 1px solid transparent !important; background: transparent; padding: 4px 6px !important; margin-left: -7px; font-size: 12px !important; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); }
.sg-title:hover, .sg-title:focus { border-color: var(--border-strong) !important; background: var(--surface); }
.sg-tot { font-size: 12px; color: var(--muted); white-space: nowrap; }
.si { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px 32px; gap: 10px; align-items: center; padding: 6px 14px 6px 20px; }
.si:hover { background: #fafbfd; }
.si-main { display: flex; flex-direction: column; min-width: 0; }
.si-main input { border: 1px solid transparent; background: transparent; padding: 3px 6px; margin-left: -7px; }
.si-main input:hover, .si-main input:focus { border-color: var(--border-strong); background: var(--surface); }
.si-title { font-weight: 600; font-size: 14px; }
.si-desc { font-size: 12.5px; color: var(--text-2); }
.si-desc::placeholder { color: #b6bcc7; }
.si-hours { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); overflow: hidden; }
.si-hours button { border: 0; background: var(--bg); width: 28px; height: 32px; font-size: 16px; color: var(--text-2); cursor: pointer; }
.si-hours button:hover { background: var(--blue-50); color: var(--blue); }
.si-hours input { width: 46px; border: 0; padding: 6px 2px; text-align: right; outline: none !important; -moz-appearance: textfield; }
.si-hours input::-webkit-outer-spin-button, .si-hours input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.si-hours span { color: var(--muted); font-size: 12.5px; padding: 0 6px 0 2px; }
.si-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.si-x { opacity: .5; }
.si:hover .si-x { opacity: 1; }

@media (max-width: 1100px) {
  .scope-layout { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .scope-layout { grid-template-columns: minmax(0, 1fr); }
  .sc-head { flex-wrap: wrap; padding: 12px 14px; }
  .sc-total { align-items: flex-start; }
  .sg-head { padding: 8px 12px 2px; }
  .si-hours { justify-self: start; }
  .adder { position: static; max-height: none; }
  .ad-list { max-height: 45vh; }
  .sc-head { top: calc(var(--appbar-h) + env(safe-area-inset-top)); }
  .si { grid-template-columns: minmax(0, 1fr) auto 30px; padding: 8px 12px; }
  .si-main { grid-column: 1 / -1; }
  .si-val { text-align: left; }
  .opt-row .field { width: 100%; }
  .opt-acts { margin-left: 0; }
}

/* ---------- contratos ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl-card { display: flex; flex-direction: column; gap: 6px; text-align: left; border: 1.5px solid var(--border); background: var(--surface); border-radius: 10px; padding: 14px; font: inherit; color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: var(--blue); }
.tpl-card.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); background: var(--blue-50); }
.tpl-card b { font-size: 14px; }
.tpl-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.tpl-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; }
.tpl-ico svg { width: 20px; height: 20px; }
.tpl-card.on .tpl-ico { background: var(--blue); color: #fff; }
.tpl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row.off { opacity: .6; }
.tpl-acts { display: flex; gap: 6px; align-items: center; flex: none; }

.ce-page { max-width: 1480px; }
.ce { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ce-form > .card + .card, .ce-form > * + * { margin-top: 14px; }
.ce-form .card-head { padding: 12px 18px; }
.ce-form .card-pad { padding: 16px 18px; }
.ce-links { display: flex; gap: 8px; flex-wrap: wrap; }
.ce-progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.ce-progress .progress { margin: 0; }
.ce-progress .btn { justify-self: start; }
.field.is-empty input, .field.is-empty textarea { border-color: #f0c36d; background: #fffbf2; }
.field.flash input, .field.flash textarea { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(21, 101, 224, .45); } 100% { box-shadow: 0 0 0 0 rgba(21, 101, 224, 0); } }
.ce-preview { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; background: #e6e9ee; border-radius: var(--radius); padding: 22px; }
.paper { background: #fff; max-width: 210mm; margin: 0 auto; padding: 18mm 20mm 22mm; box-shadow: 0 2px 14px rgba(0, 0, 0, .14); border-radius: 2px; }
.paper-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10mm; font-family: Arial, sans-serif; font-size: 8pt; color: #6b7280; }
.paper-head img { height: 9mm; max-width: 45mm; object-fit: contain; }
.paper .ct { font-size: 10.5pt; }
.ct .ct-miss { background: #fff1c7; color: #8a5a00; border-radius: 3px; padding: 0 4px; font-family: Arial, sans-serif; font-size: .82em; font-weight: 600; cursor: pointer; border: 1px dashed #e0a52a; }
.ct .ct-miss:hover { background: #ffe39a; }
.ct .ct-val { cursor: pointer; border-radius: 2px; }
.ct .ct-val:hover { background: var(--blue-50); box-shadow: 0 0 0 2px var(--blue-50); }

.modal.modal-xl { max-width: 1180px; }
.ct-editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; height: min(70vh, 720px); }
.ct-editor textarea { height: 100%; resize: none; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 13px; line-height: 1.55; }
.ct-help { overflow-y: auto; font-size: 13px; border-left: 1px solid var(--border); padding-left: 14px; }
.ct-help ul { margin: 6px 0 14px; padding-left: 16px; color: var(--text-2); }
.ct-help li { margin-bottom: 4px; }
.ct-help code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.ct-help-g { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); margin: 12px 0 6px; }
.ct-chip { display: inline-block; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 9px; margin: 0 4px 5px 0; font: inherit; font-size: 12px; cursor: pointer; color: var(--text-2); }
.ct-chip:hover { border-color: var(--blue); color: var(--blue); }

@media (max-width: 1100px) {
  .ce { grid-template-columns: minmax(0, 1fr); }
  .ce-preview { position: static; max-height: none; }
}
@media (max-width: 780px) {
  .ce-preview { padding: 8px; margin: 0 -8px; }
  .paper { padding: 10mm 8mm; }
  .ct-editor { grid-template-columns: 1fr; height: auto; }
  .ct-editor textarea { height: 50vh; }
  .ct-help { border-left: 0; padding-left: 0; max-height: 30vh; }
  .tpl-acts { flex-wrap: wrap; }
}

/* ---------- privacidade (LGPD) ---------- */
.lgpd-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lgpd-sum div { padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); display: flex; flex-direction: column; min-width: 96px; }
.lgpd-sum b { font-size: 20px; }
.lgpd-sum small { color: var(--muted); font-size: 12px; }
.lgpd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lgpd-act { border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: grid; gap: 8px; align-content: start; justify-items: start; }
.lgpd-act.danger-zone { border-color: #f3c6c6; background: #fffafa; }
.lgpd-check { display: grid; gap: 12px; }
.lgpd-check .lc { display: flex; gap: 12px; align-items: flex-start; }
.lgpd-check .lc > span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.lgpd-check .ok > span { background: var(--green-bg); color: var(--green); }
.lgpd-check .warn > span { background: var(--amber-bg); color: var(--amber); }
.lgpd-check b { display: block; font-size: 14px; }
.lgpd-check small { color: var(--muted); font-size: 12.5px; }
.nav-count[data-count="leads"] { background: var(--blue); }
@media (max-width: 780px) { .lgpd-actions { grid-template-columns: 1fr; } }

/* ---------- celular com cara de app (vale só até 780px) ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fabPop { from { transform: scale(.6); } to { transform: scale(1); } }

@media (max-width: 780px) {
  :root { --appbar-h: 58px; --tabbar-h: 66px; --app-navy: #0b1a3a; --app-navy-2: #0b2a6b; }
  body { background: #f2f4f8; }

  /* barra superior azul-marinho, como o site */
  .appbar { background: linear-gradient(120deg, var(--app-navy), #0c2050); border-bottom: 0; backdrop-filter: none; color: #fff; gap: 10px; }
  .appbar-home { display: flex; flex: none; }
  .appbar-logo { height: 26px; max-width: 110px; }
  .appbar-title { color: #fff; font-size: 15.5px; text-align: right; opacity: .9; }
  .appbar .icon-btn { color: #fff; background: rgba(255, 255, 255, .08); border-radius: 12px; }
  .appbar .icon-btn:active { background: rgba(255, 255, 255, .18); }
  .appbar .avatar { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
  .appbar .bell-count { box-shadow: 0 0 0 2px var(--app-navy); }

  /* abas inferiores com botão central "Criar" */
  .tabbar { background: rgba(255, 255, 255, .97); border-top: 1px solid rgba(16, 24, 40, .06); box-shadow: 0 -8px 24px -12px rgba(16, 24, 40, .18); align-items: stretch; }
  .tabbar a, .tabbar button { font-size: 10.5px; gap: 4px; transition: color .2s; }
  .tabbar svg { padding: 3px 16px; border-radius: 16px; transition: background .2s, color .2s, transform .2s; }
  .tabbar a:active svg, .tabbar button:active svg { transform: scale(.9); }
  .tabbar .active svg { background: #e3ecfd; color: var(--blue); }
  .tab-fab { position: relative; flex: 0 0 72px !important; }
  .tab-fab > span { position: absolute; top: -18px; left: 50%; margin-left: -28px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
    background: linear-gradient(145deg, #1e6ff0, #0b2a6b); color: #fff; box-shadow: 0 10px 22px -8px rgba(30, 111, 240, .8), 0 0 0 5px #fff; transition: transform .2s; animation: fabPop .35s cubic-bezier(.2, .9, .3, 1.3) both; }
  .tab-fab:active > span { transform: scale(.92); }
  .tab-fab svg { width: 28px; height: 28px; padding: 0; background: none !important; color: #fff !important; }

  /* painéis "Mais" e "Criar" */
  .sheet-apps .modal-body { padding: 8px 16px 20px; }
  .sheet-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f2f4f8; color: var(--text); text-decoration: none !important; }
  .sheet-profile .avatar { width: 42px; height: 42px; font-size: 14px; }
  .sheet-profile > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .sheet-profile small { color: var(--muted); }
  .sheet-profile > svg { width: 22px; height: 22px; color: var(--muted); }
  .apps-group { margin: 18px 4px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .apps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
  .apps-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11.5px; font-weight: 500; line-height: 1.25; color: var(--text); text-decoration: none !important; }
  .app-ic { position: relative; width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; color: var(--blue); background: linear-gradient(160deg, #eef4ff, #dfe9fc); transition: transform .15s; }
  .apps-grid a:active .app-ic, .create-list button:active .app-ic { transform: scale(.92); }
  .app-ic svg { width: 25px; height: 25px; }
  .app-ic.in { color: #0f8a4a; background: linear-gradient(160deg, #eafaf1, #d6f3e3); }
  .app-ic.out { color: #c2410c; background: linear-gradient(160deg, #fff4ea, #fde4cf); }
  .app-ic .nav-count { position: absolute; top: -4px; right: -4px; margin: 0; }
  .sheet-logout { width: 100%; margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border: 1px solid #f3c7c7; border-radius: 14px; background: #fff5f5; color: var(--red); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
  .sheet-logout svg { width: 20px; height: 20px; }
  .create-list { display: grid; gap: 8px; }
  .create-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 16px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
  .create-list .app-ic { width: 46px; height: 46px; border-radius: 14px; flex: none; }
  .create-list b { display: block; font-size: 15px; color: var(--text); }
  .create-list small { color: var(--muted); font-size: 13px; }

  /* indicadores deslizam para o lado */
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px 16px; padding: 4px 16px 6px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpis > .kpi { flex: 0 0 62%; scroll-snap-align: start; border-radius: 16px; padding: 14px 16px; margin: 0; }
  .kpis > .kpi .value { font-size: 20px; }

  /* listas compactas */
  .card .table-wrap:has(+ .m-list) { display: none; }
  .m-list { display: block; list-style: none; margin: 0; padding: 0; }
  .m-list li + li { border-top: 1px solid var(--border); }
  .m-list a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--text); text-decoration: none !important; }
  .m-list a:active { background: #f6f8fb; }
  .ml-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .ml-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ml-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ml-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; font-variant-numeric: tabular-nums; }
  .ml-side b { font-size: 13.5px; }

  /* toque mais confortável em botões de página */
  .page-head .actions .btn { border-radius: 12px; height: 46px; }
  .card { border-radius: 16px; }
}
@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  #view.view-in > *, .tab-fab > span { animation: none; }
}

/* =====================================================================
   Tema Vetra — mesmo padrão do site: azul-marinho, Plus Jakarta Sans,
   cartões com cantos suaves e micro-animações discretas.
   ===================================================================== */
:root {
  --navy: #0b1a3a;
  --navy-2: #0b2a6b;
  --blue: #1e6ff0;
  --blue-600: #1557d1;
  --blue-50: #eaf1fe;
  --blue-100: #d3e2fd;
  --sky: #8db4ff;
  --bg: #f3f5f9;
  --border: #e4e8ef;
  --border-strong: #d0d7e2;
  --text: #101828;
  --text-2: #475467;
  --muted: #667085;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px -8px rgba(16, 24, 40, .1);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(16, 24, 40, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
body { font-family: var(--font); background: var(--bg); letter-spacing: -.003em; }
h1, h2, h3, h4 { letter-spacing: -.015em; }

@keyframes vtRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vtFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vtPop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes vtToast { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- entrada das telas: blocos em cascata ---------- */
#view.view-in > .page > * { animation: vtRise .45s var(--ease) both; }
#view.view-in > .page > :nth-child(2) { animation-delay: .05s; }
#view.view-in > .page > :nth-child(3) { animation-delay: .1s; }
#view.view-in > .page > :nth-child(4) { animation-delay: .15s; }
#view.view-in > .page > :nth-child(n+5) { animation-delay: .2s; }
.loading-view { display: flex; align-items: center; gap: 10px; }
.loading-view::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--blue-100); border-top-color: var(--blue); animation: lgSpin .8s linear infinite; }

/* ---------- menu lateral azul-marinho ---------- */
.sidebar { position: sticky; overflow: hidden; border-right: 0; color: #c8d3ea;
  background: linear-gradient(175deg, var(--navy) 0%, #0c2050 70%, var(--navy-2) 100%); }
.sidebar::after { content: ''; position: absolute; right: -90px; top: 30%; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(30, 111, 240, .28), transparent); pointer-events: none; }
.sidebar-mark { position: absolute; left: -70px; bottom: -40px; width: 300px; opacity: .035; pointer-events: none; user-select: none; }
.brand { position: relative; z-index: 1; padding: 24px 22px 20px; }
.brand img { max-width: 150px; max-height: 34px; }
.sidebar nav { position: relative; z-index: 1; padding: 6px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nav-group { color: #7d8db0; padding: 18px 12px 6px; font-size: 10.5px; letter-spacing: .08em; }
.sidebar nav a { position: relative; color: #c8d3ea; padding: 9px 12px; border-radius: 10px; font-weight: 500; transition: background .2s, color .2s; }
.sidebar nav a svg { opacity: .7; transition: transform .25s var(--ease), opacity .2s; }
.sidebar nav a span { transition: transform .25s var(--ease); }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a:hover svg { opacity: 1; }
.sidebar nav a:hover span { transform: translateX(2px); }
.sidebar nav a.active { color: #fff; background: linear-gradient(135deg, var(--blue), #1557d1); box-shadow: 0 8px 20px -10px rgba(30, 111, 240, .9), inset 0 1px 0 rgba(255, 255, 255, .15); }
.sidebar nav a.active svg { opacity: 1; }
.sidebar .nav-count { box-shadow: 0 0 0 2px var(--navy); }

/* ---------- barra superior ---------- */
.topbar { background: rgba(243, 245, 249, .82); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar .bell { transition: border-color .2s, box-shadow .2s, transform .2s; }
.topbar .bell:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.topbar .bell:hover svg { animation: bellRing .5s var(--ease); }
@keyframes bellRing { 20% { transform: rotate(14deg); } 45% { transform: rotate(-10deg); } 70% { transform: rotate(5deg); } }
.user-btn { transition: border-color .2s, box-shadow .2s; }
.user-btn .avatar, .avatar { background: linear-gradient(145deg, var(--blue), var(--navy-2)); color: #fff; }
.user-btn .chev { transition: transform .25s var(--ease); }
.user-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.user-drop { border-radius: 14px; box-shadow: var(--shadow-lg); animation: vtPop .2s var(--ease) both; }

/* ---------- títulos das páginas ---------- */
.page-head h1 { font-size: 26px; color: var(--navy); letter-spacing: -.025em; }

/* ---------- botões e campos ---------- */
.btn { height: 38px; padding: 0 16px; border-radius: 10px; transition: background .2s, border-color .2s, box-shadow .2s, transform .15s, color .2s; }
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 6px 16px -8px rgba(30, 111, 240, .75); }
.btn-primary:hover { background: var(--blue-600); border-color: var(--blue-600); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 10px 20px -8px rgba(30, 111, 240, .85); }
.btn-navy { background: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { box-shadow: none; background: var(--blue-50); }
.btn-sm { height: 32px; border-radius: 9px; }
.icon-btn { border-radius: 9px; transition: background .2s, color .2s; }
input, select, textarea { border-radius: 10px; padding: 9px 12px; transition: border-color .2s, box-shadow .2s; }
input:hover, select:hover, textarea:hover { border-color: #b9c3d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30, 111, 240, .14); }
.seg { border-radius: 10px; padding: 3px; gap: 2px; border-color: var(--border); background: #eef1f6; }
.seg button { border-radius: 8px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button + button { border-left: 0; }
.seg button.on { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* ---------- cartões, tabelas, selos ---------- */
.card { border-color: var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.card-head { padding: 16px 22px; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 700; color: var(--navy); }
.table th { background: #f8f9fc; font-size: 11.5px; letter-spacing: .05em; color: #7a8599; }
.table td { transition: background .15s; }
.table tbody tr:hover td { background: #f8fafd; }
.table tbody tr.clickable:hover td { background: #f2f6fe; }
.badge { padding: 3px 10px; }
.list li { transition: background .15s; }
.list li:hover { background: #f8fafd; }

/* indicadores: sobem um pouco e ganham um filete azul ao passar o mouse */
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpis > .kpi.m-dup { display: none; }
.kpi { position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.kpi::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--sky)); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cdd9ef; }
.kpi:hover::before { transform: scaleX(1); }
.kpi .value { font-size: 25px; letter-spacing: -.02em; color: var(--navy); }
.kpi .value .in, .kpi .value .out { color: inherit; }
.funnel .bar { background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 0 6px 6px 0; animation: vtGrow .9s var(--ease) both; transform-origin: left; }
@keyframes vtGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.alert-card { border-radius: 14px; transition: transform .25s var(--ease), box-shadow .25s; }
.alert-card:hover { transform: translateY(-2px); }

/* ---------- janelas (modais) e avisos ---------- */
.modal-backdrop { background: rgba(8, 17, 38, .5); backdrop-filter: blur(4px); animation: vtFade .2s ease both; }
.modal { border-radius: 18px; box-shadow: 0 30px 70px -20px rgba(8, 17, 38, .45); animation: vtPop .28s var(--ease) both; }
.modal header h3 { color: var(--navy); font-size: 17px; }
.toast { border-radius: 12px; background: var(--navy); box-shadow: 0 16px 34px -12px rgba(8, 17, 38, .5); animation: vtToast .3s var(--ease) both; }
.toast-error { background: #b42318; }

/* ---------- dashboard: faixa azul-marinho no topo (computador) ---------- */
.dash-top { position: relative; margin-bottom: 18px; }
.dash-head { display: none; }
.m-hero { display: block; position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 30px 34px 32px;
  background: linear-gradient(140deg, var(--navy) 0%, #0c2050 55%, var(--navy-2) 100%); box-shadow: 0 24px 50px -28px rgba(8, 17, 38, .7); }
.m-hero::after { content: ''; position: absolute; right: 8%; top: -30%; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, rgba(30, 111, 240, .38), transparent); pointer-events: none; }
.m-mark { position: absolute; left: -120px; top: 50%; width: 520px; transform: translateY(-50%); opacity: .1; pointer-events: none; user-select: none; }
.m-hero > *:not(.m-mark) { position: relative; z-index: 1; }
.m-hello { margin: 0; font-size: 22px; font-weight: 600; color: #c8d3ea; letter-spacing: -.015em; }
.m-hello b { color: #fff; }
.m-date { margin: 4px 0 0; font-size: 13.5px; color: #9fb0d3; }
.m-label { margin: 22px 0 2px; font-size: 13px; font-weight: 600; color: #9fb0d3; }
.m-value { margin: 0; font-size: 40px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.m-value.neg { color: #ffb4ab; }
.m-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.m-pills span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #c8d3ea; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); }
.m-pills b { color: #fff; font-variant-numeric: tabular-nums; }
.m-pills i { width: 7px; height: 7px; border-radius: 50%; }
.m-pills i.in { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
.m-pills i.out { background: #fb923c; box-shadow: 0 0 0 3px rgba(251, 146, 60, .2); }
.m-quick { position: absolute; right: 30px; bottom: 30px; z-index: 2; display: flex; gap: 10px; }
.m-quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; padding: 14px 8px 12px; border-radius: 16px; font-size: 12.5px; font-weight: 600; color: #fff; text-decoration: none !important;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); transition: background .2s, transform .25s var(--ease), border-color .2s; }
.m-quick a:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .22); transform: translateY(-3px); }
.m-quick a > span { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--sky); background: rgba(30, 111, 240, .2); transition: transform .25s var(--ease); }
.m-quick a:hover > span { transform: scale(1.06); }
.m-quick a > span.primary { color: #fff; background: linear-gradient(145deg, #1e6ff0, #1557d1); box-shadow: 0 8px 18px -8px rgba(30, 111, 240, .9); }
.m-quick a > span.in { color: #6ee7b7; background: rgba(52, 211, 153, .14); }
.m-quick a > span.out { color: #fdba74; background: rgba(251, 146, 60, .14); }
.m-quick svg { width: 22px; height: 22px; }
.m-list { display: none; }
@media (max-width: 1100px) {
  .m-quick { position: static; margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #view.view-in > .page > *, .modal, .modal-backdrop, .toast, .user-drop, .funnel .bar { animation: none !important; }
  .kpi:hover, .alert-card:hover, .m-quick a:hover { transform: none; }
}

/* ---------- celular: o topo do dashboard ocupa a largura toda ---------- */
@media (max-width: 780px) {
  .dash-top { margin: -16px -16px 16px; }
  .m-hero { border-radius: 0; padding: 18px 20px 58px; box-shadow: none; }
  .m-mark { width: 360px; left: -110px; opacity: .08; }
  .m-hello { font-size: 15px; font-weight: 500; }
  .m-date { display: none; }
  .m-label { margin-top: 18px; }
  .m-value { font-size: 34px; }
  .m-quick { position: relative; right: auto; bottom: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: -38px 16px 0; padding: 14px 8px;
    background: #fff; border-radius: 18px; box-shadow: 0 14px 30px -18px rgba(16, 24, 40, .45), 0 1px 2px rgba(16, 24, 40, .05); }
  .m-quick a { width: auto; padding: 0; background: none; border: 0; color: var(--text); font-size: 12px; }
  .m-quick a:hover { background: none; transform: none; }
  .m-quick a > span { width: 48px; height: 48px; border-radius: 16px; color: var(--blue); background: #eef4ff; box-shadow: none; }
  .m-quick a > span.primary { color: #fff; background: linear-gradient(145deg, #1e6ff0, #0b2a6b); }
  .m-quick a > span.in { color: #0f8a4a; background: #eafaf1; }
  .m-quick a > span.out { color: #c2410c; background: #fff4ea; }
  .m-list { display: block; }
  #view.view-in > .page > * { animation-duration: .35s; }
}

/* =====================================================================
   Reuniões: cor própria (violeta), painel no dashboard, calendário, formulário e lembretes
   ===================================================================== */
:root { --meet: #7c5cff; --meet-bg: #f1edff; }

/* dashboard (computador): faixa azul-marinho com saudação à esquerda e reuniões à direita */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); grid-template-areas: "hero meet" "hero quick"; gap: 16px 28px;
  position: relative; overflow: hidden; padding: 28px 30px; border-radius: 22px; color: #fff;
  background: linear-gradient(140deg, var(--navy) 0%, #0c2050 55%, var(--navy-2) 100%); box-shadow: 0 24px 50px -28px rgba(8, 17, 38, .7); }
.dash-top::after { content: ''; position: absolute; right: 22%; top: -40%; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(closest-side, rgba(30, 111, 240, .32), transparent); pointer-events: none; }
.dash-top .m-hero { grid-area: hero; position: static; overflow: visible; background: none; box-shadow: none; border-radius: 0; padding: 4px 0; }
.dash-top .m-hero::after { display: none; }
.dash-top .m-mark { left: -120px; }
.dash-top .m-quick { grid-area: quick; position: relative; right: auto; bottom: auto; align-self: end; justify-content: flex-end; }
.dash-top .m-quick a { width: auto; flex: 1; max-width: 96px; }

.m-meet { grid-area: meet; position: relative; z-index: 1; border-radius: 18px; padding: 16px 16px 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
@supports (backdrop-filter: blur(8px)) { .m-meet { backdrop-filter: blur(12px); } }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mm-head b { font-size: 14px; color: #fff; }
.mm-add { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; font: 600 12.5px var(--font); padding: 6px 11px; border-radius: 9px; cursor: pointer; transition: background .2s, border-color .2s; }
.mm-add:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); }
.mm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mm-list li { display: flex; align-items: center; gap: 8px; border-radius: 12px; transition: background .2s; animation: vtRise .4s var(--ease) both; }
.mm-list li:nth-child(2) { animation-delay: .06s; }
.mm-list li:nth-child(3) { animation-delay: .12s; }
.mm-list li:hover { background: rgba(255, 255, 255, .07); }
.mm-item { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; border: 0; background: none; color: #fff; font: inherit; padding: 8px 10px; cursor: pointer; border-radius: 10px; }
.mm-when { font-size: 11.5px; font-weight: 700; color: #b9a9ff; letter-spacing: .01em; }
.mm-item b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-item small { font-size: 12px; color: #9fb0d3; }
.mm-item em { font-style: normal; color: #fcd581; font-weight: 600; }
.mm-list li.live .mm-when { color: #6ee7b7; }
.mm-join { flex: none; margin-right: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: #10b981; color: #fff; font-size: 12.5px; font-weight: 700; text-decoration: none !important; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .8); animation: mmPulse 2s ease-in-out infinite; }
.mm-join svg, .btn svg.ic-video, .btn > svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes mmPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 60% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } }
.mm-more { display: inline-block; margin: 6px 4px 2px; padding: 0; border: 0; background: none; font: 600 12.5px var(--font); color: var(--sky); cursor: pointer; }
.mm-more:hover { text-decoration: underline; }
.mm-today { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--meet); vertical-align: 1px; }
.mm-empty { margin: 4px 2px 6px; font-size: 13px; color: #9fb0d3; }

@media (max-width: 1100px) {
  .dash-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "meet" "quick"; }
  .dash-top .m-quick { justify-content: flex-start; }
}

/* calendário */
.chip-meet { --c: var(--meet); }
.ev-meet { --c: var(--meet); --bg: var(--meet-bg); }
.ev-meet .ev-amt { color: #5b3fd9; }
.ev-meet.live { box-shadow: inset 0 0 0 1px #9be7c4; --c: #10b981; --bg: #e8faf2; }
.ag-item.ev-meet, .al-item.ev-meet { --c: var(--meet); }
.meet-time { color: #5b3fd9; font-weight: 700; }
.cs.meet-box { border-top: 3px solid var(--meet); }
.al-meet .al-title { color: #5b3fd9; }
.al-meet .al-title span { background: var(--meet); }
.app-ic.meet { color: #6b4ef0; background: linear-gradient(160deg, #f3efff, #e6defe); }

/* formulário */
.meet-modal .modal { max-width: 720px; }
.meet-people { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fafbfd; }
.meet-people-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; color: var(--text); }
.meet-people-head small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.meet-people-head b { color: var(--blue); }
.meet-people-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; padding: 2px; }
.mp-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.mp-item:hover { border-color: #b9c8e6; }
.mp-item input { position: absolute; opacity: 0; pointer-events: none; }
.mp-item:has(input:checked) { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(30, 111, 240, .1); }
.mp-item:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.mp-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(145deg, var(--blue), var(--navy-2)); }
.mp-av.ext { background: linear-gradient(145deg, #a0aec0, #64748b); }
.mp-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mp-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-check { margin-left: auto; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; transition: background .2s, border-color .2s, transform .2s; }
.mp-check svg { width: 14px; height: 14px; fill: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.mp-item:has(input:checked) .mp-check { background: var(--blue); border-color: var(--blue); }
.mp-item:has(input:checked) .mp-check svg { transform: scale(1); }
.meet-extra { margin-top: 2px; }

/* detalhes */
.md-head { display: flex; align-items: flex-start; gap: 14px; }
.md-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #8b6cff, #5b3fd9); box-shadow: 0 10px 20px -10px rgba(91, 63, 217, .8); }
.md-ic svg { width: 22px; height: 22px; fill: currentColor; }
.md-head h4 { margin: 0; font-size: 18px; color: var(--navy); }
.md-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.md-live { margin-left: auto; }
.md-desc { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #f6f8fb; color: var(--text-2); white-space: pre-wrap; line-height: 1.55; }
.md-link { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 8px 8px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.md-link span { flex: 1; min-width: 0; color: var(--blue); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-label { margin: 18px 0 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.md-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.md-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.md-person > span:last-child { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.md-person b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-person small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-cancel { color: var(--red); margin-right: auto; }
.md-cancel:hover { background: var(--red-bg) !important; }
.meet-modal footer .btn > svg { fill: currentColor; }

/* lembretes no canto da tela */
#meet-notes { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.meet-note { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; color: #fff;
  background: linear-gradient(150deg, var(--navy), #13285a); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 44px -16px rgba(8, 17, 38, .6);
  animation: vtToast .35s var(--ease) both; transition: opacity .25s, transform .25s; }
.meet-note.out { opacity: 0; transform: translateX(20px); }
.mn-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(124, 92, 255, .3); color: #d9cfff; }
.mn-ic svg { width: 20px; height: 20px; fill: currentColor; }
.mn-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mn-txt b { font-size: 14px; }
.mn-txt small { font-size: 12.5px; color: #9fb0d3; }
.mn-act { display: flex; align-items: center; gap: 4px; }
.meet-note .btn { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; }
.meet-note .btn-primary { background: #10b981; border-color: #10b981; }
.meet-note .icon-btn { color: #9fb0d3; }
.meet-note .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

@media (max-width: 780px) {
  .dash-top { display: flex; flex-direction: column; padding: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  .dash-top .m-quick { order: 2; align-self: stretch; }
  .m-meet { order: 3; }
  .dash-top::after { display: none; }
  .dash-top .m-hero { position: relative; overflow: hidden; padding: 18px 20px 58px; background: linear-gradient(150deg, var(--navy) 0%, #0c2050 55%, var(--navy-2) 100%); }
  .dash-top .m-quick a { max-width: none; }
  .m-meet { margin: 14px 16px 0; padding: 14px; background: #fff; border-color: var(--border); box-shadow: var(--shadow); color: var(--text); }
  .mm-head b { color: var(--navy); }
  .mm-add { color: var(--blue); background: var(--blue-50); border-color: transparent; }
  .mm-list li:hover { background: #f6f8fb; }
  .mm-item { color: var(--text); }
  .mm-when { color: #5b3fd9; }
  .mm-item small, .mm-empty { color: var(--muted); }
  .mm-item em { color: #b45309; }
  .mm-list li.live .mm-when { color: #059669; }
  .mm-more { color: var(--blue); }
  .meet-people-list, .md-grid { grid-template-columns: 1fr; }
  #meet-notes { top: auto; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); right: 16px; left: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .mm-join, .mm-list li, .meet-note { animation: none; } }

/* avisos: rodapé com vários botões quebra em linhas */
.modal footer { flex-wrap: wrap; }

/* reunião: escolha entre Sala Vetra e link externo */
.meet-form div.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.meet-kind { display: flex; width: 100%; }
.meet-kind button { flex: 1; padding: 8px 10px; }
.meet-room-hint { grid-column: span 12; margin: -4px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--blue-50); color: #1d4ed8; font-size: 13px; line-height: 1.5; }
.meet-room-hint[hidden], .meet-link-f[hidden] { display: none !important; }
.md-room span b { color: var(--navy); }

/* iniciar agora / acesso dos convidados */
.mm-acts { display: inline-flex; gap: 6px; }
.mm-now { background: #10b981 !important; border-color: #10b981 !important; color: #fff !important; }
.mm-now:hover { background: #059669 !important; }
.meet-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meet-acc button { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.meet-acc button b { font-size: 14px; color: var(--text); }
.meet-acc button small { font-size: 12.5px; color: var(--muted); }
.meet-acc button.on { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(30, 111, 240, .1); }
.meet-acc-f[hidden] { display: none !important; }
.meet-form .meet-acc-f { grid-column: span 12; }
@media (max-width: 780px) { .meet-acc { grid-template-columns: 1fr; } .mm-acts { flex-wrap: wrap; justify-content: flex-end; } }

/* assinatura eletrônica (equipe) */
.sign-modal .modal { max-width: 860px; }
.sg-doc-title { margin: 0; font-weight: 700; font-size: 15.5px; color: var(--navy); }
.sg-head-row, .sg-row { display: grid; grid-template-columns: 140px minmax(0, 1.2fr) minmax(0, 1.2fr) 150px 34px; gap: 8px; align-items: center; }
.sg-head-row { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sg-row { margin-bottom: 8px; animation: vtRise .25s var(--ease) both; }
.sg-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.sg-top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sg-progress, .sg-mini { height: 6px; border-radius: 6px; background: #eef1f6; overflow: hidden; margin-top: 14px; }
.sg-mini { width: 90px; margin: 0 0 4px; }
.sg-progress i, .sg-mini i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #10b981, #34d399); transition: width .6s var(--ease); }
.sg-tip { padding: 10px 14px; border-radius: 12px; background: var(--blue-50); color: #1d4ed8; font-size: 13px; margin: 0 0 12px; }
.sg-signers { display: grid; gap: 8px; }
.sg-signer { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; }
.sg-signer .sg-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(145deg, #94a3b8, #64748b); flex: none; }
.sg-signer .sg-av.assinado { background: linear-gradient(145deg, #10b981, #047857); }
.sg-signer .sg-av.visualizado { background: linear-gradient(145deg, var(--blue), var(--navy-2)); }
.sg-signer .sg-av.recusado { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.sg-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-info b { font-size: 14px; }
.sg-info small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 780px) {
  .sg-head-row { display: none; }
  .sg-row { grid-template-columns: 1fr 34px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
  .sg-row > * { grid-column: 1; }
  .sg-row [data-rm] { grid-column: 2; grid-row: 1; }
  .sg-signer { flex-wrap: wrap; }
}

/* Histórico / auditoria */
.hist-btn { gap: 6px; }
.appbar .hist-btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); padding: 6px 8px; }
.appbar .hist-btn span { display: none; }
.appbar .hist-btn[hidden], .hist-btn[hidden] { display: none; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.hist-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line, #e5e8ee); }
.hist-item:last-child { border-bottom: 0; }
.hist-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--blue-50); color: var(--blue-600); }
.hist-item.tone-green .hist-av { background: var(--green-bg); color: var(--green); }
.hist-item.tone-red .hist-av { background: var(--red-bg); color: var(--red); }
.hist-item.tone-amber .hist-av { background: var(--amber-bg); color: var(--amber); }
.hist-body { min-width: 0; flex: 1; }
.hist-act { color: var(--muted, #64748b); margin-left: 6px; }
.hist-det { font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.hist-meta { font-size: 12px; color: var(--muted, #64748b); margin-top: 4px; }
.hist-changes { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12.5px; }
.hist-changes th { text-align: left; font-weight: 600; color: var(--muted, #64748b); padding: 3px 8px 3px 0; }
.hist-changes td { padding: 3px 8px 3px 0; vertical-align: top; overflow-wrap: anywhere; border-top: 1px solid var(--line, #eef0f3); }
.hist-changes td.from { color: var(--red); }
.hist-changes td.to { color: var(--green); }
.hist-more { margin-top: 6px; }

/* Comprovante dentro do sistema */
.receipt-modal .modal-body { padding: 0; background: #f1f3f6; }
.receipt-view { display: flex; justify-content: center; align-items: flex-start; min-height: 200px; max-height: 72vh; overflow: auto; }
.receipt-frame { width: 100%; height: 72vh; border: 0; background: #fff; }
.receipt-img { max-width: 100%; height: auto; display: block; }
