/* Quilate — identidade visual: marfim, tinta e ouro champanhe */
:root {
  --bg: #f6f3ec; --surface: #fff; --surface-2: #faf8f3; --ink: #1d1b17; --ink-2: #4a463e; --muted: #7d776b;
  --line: #ebe5d8; --line-2: #dcd4c3;
  --gold: #b08a4f; --gold-2: #8b6a35; --gold-soft: #f5ecda; --gold-tint: #fbf7ee;
  --side: #15130f; --side-ink: #d9d2c3; --side-muted: #8b8476;
  --ok: #2e7a52; --ok-soft: #e5f2ea; --warn: #a2650f; --warn-soft: #fbefd9;
  --danger: #b03f35; --danger-soft: #f9e5e2; --info: #33659a; --info-soft: #e5edf7;
  --r: 14px; --shadow: 0 1px 2px rgba(29, 27, 23, .04), 0 6px 20px rgba(29, 27, 23, .05);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.r { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; letter-spacing: .01em; }
.txt-danger { color: var(--danger); font-weight: 600; }
.txt-ok { color: var(--ok); }
.txt-gold { color: var(--gold-2); }
.sp { flex: 1; }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------ estrutura */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.main { flex: 1; margin-left: 252px; min-width: 0; }
.view { max-width: 1260px; margin: 0 auto; padding: 30px 36px 72px; }
.topbar { display: none; }
.brand { display: block; padding: 22px 22px 16px; text-align: center; text-decoration: none !important; }
.brand-logo { display: block; width: 100%; max-width: 168px; max-height: 130px; object-fit: contain; margin: 0 auto; }
.brand small { margin-top: 12px !important; font-size: 10.5px !important; letter-spacing: .08em; text-transform: uppercase; }
.top-logo { height: 28px; width: auto; }
.doc-logo-img { height: 92px; width: auto; max-width: 180px; object-fit: contain; flex: none; }
.doc-logo-img.sm { height: 64px; }
.doc-brand small { border-left: 1px solid #e6dcc6; padding-left: 14px; }
.cert-logo { display: block; height: 130px; width: auto; max-width: 260px; object-fit: contain; margin: 0 auto 6px; }
.brand .logo { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 28px; font-weight: 600; color: #f3e6cb; letter-spacing: .02em; line-height: 1; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #e2c58c, #9c7438); color: #1a160f; }
.brand small { display: block; margin-top: 10px; color: var(--side-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); font-weight: 500; text-decoration: none; transition: background .15s; }
.nav a .ic { color: var(--side-muted); }
.nav a:hover { background: rgba(255, 255, 255, .05); }
.nav a.on { background: linear-gradient(90deg, rgba(212, 175, 110, .22), rgba(212, 175, 110, .05)); color: #f6e7c8; }
.nav a.on .ic { color: #dcbb7c; }
.nav .cnt { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #3a3329; color: #eadfc6; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav .cnt.danger { background: var(--danger); color: #fff; }
.nav .cnt.ok { background: #2f7a52; color: #fff; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: 8px 8px; }
.side-cta { margin: 8px 16px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #d8b878, #a37b3f); color: #1a160f; font-weight: 700; text-decoration: none !important; }
.side-cta:hover { filter: brightness(1.05); }
.side-foot { padding: 14px 22px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: var(--side-muted); display: flex; align-items: center; gap: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5fb184; box-shadow: 0 0 0 3px rgba(95, 177, 132, .16); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }

/* ------------------------------------------------ cabeçalho de página */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.05; letter-spacing: -.005em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head p::first-letter { text-transform: uppercase; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.back:hover { color: var(--ink); text-decoration: none; }

/* ------------------------------------------------ botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { background: var(--surface-2); border-color: #c9bfa9; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #f6ead2; }
.btn.primary:hover { background: #312d26; }
.btn.gold { background: linear-gradient(135deg, #cfac6c, #a27a3e); border-color: #a27a3e; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(29, 27, 23, .05); }
.btn.danger { color: var(--danger); }
.btn.danger-fill, .btn.primary.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wa { background: #1f9d57; border-color: #1f9d57; color: #fff; }
.btn.wa:hover { background: #198a4b; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 48px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(29, 27, 23, .06); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.wa { color: #1f9d57; }
.icon-btn.wa:hover { background: #e3f4ea; }

/* ------------------------------------------------ cartões e grade */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h.pad { padding: 18px 22px 0; }
.card-h h2 { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.pad { padding: 0 22px 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2.wide-left { grid-template-columns: 1.35fr 1fr; }
.grid-2 > .card, .stack > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.quick button { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--gold-tint); cursor: pointer; font-weight: 600; color: var(--ink-2); text-align: left; transition: all .15s; }
.quick button .ic { color: var(--gold-2); }
.quick button:hover { border-style: solid; border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); opacity: .7; }
.kpi.danger::before { background: var(--danger); opacity: 1; }
.kpi.ok::before { background: var(--ok); }
.kpi-l { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-v { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi.danger .kpi-v { color: var(--danger); }
.kpi-s { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------ listas, alertas, avatares */
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.al { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.al-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.al.danger .al-ic { background: var(--danger-soft); color: var(--danger); }
.al.warn .al-ic { background: var(--warn-soft); color: var(--warn); }
.al.ok .al-ic { background: var(--ok-soft); color: var(--ok); }
.al.info .al-ic { background: var(--info-soft); color: var(--info); }
.al.danger { border-color: #f0d3cf; background: #fffaf9; }
.al-t { flex: 1; min-width: 0; font-size: 13.5px; }
.al-a { display: flex; gap: 6px; flex: none; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); font-size: 12.5px; }
.list .time { font-weight: 700; font-size: 13px; color: var(--gold-2); min-width: 48px; font-variant-numeric: tabular-nums; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold-2); font-weight: 700; font-size: 13px; }
.av.sm { width: 32px; height: 32px; }
.av.rose { background: #f8e6e4; color: #a5524a; }
.av.lg { width: 68px; height: 68px; font-size: 24px; font-family: var(--serif); background: linear-gradient(135deg, #f1e2c2, #e1c58f); color: #6b4f22; }
.who { display: flex; align-items: center; gap: 12px; }
.who small { display: block; color: var(--muted); font-size: 12px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint { display: block; color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty .ic { margin: 0 auto 8px; color: var(--line-2); }
.empty p { margin: 0; }

/* ------------------------------------------------ badges e chips */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-2); }
.badge.muted { background: #efece5; color: #6f695d; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 5px 12px; border-radius: 20px; background: var(--gold-tint); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.chip.danger { background: var(--danger-soft); border-color: #efcdc8; color: var(--danger); }

/* ------------------------------------------------ tabelas */
.toolbar { display: flex; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-width: 180px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 220px; }
.search .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.click tbody tr { cursor: pointer; transition: background .1s; }
.tbl.click tbody tr:hover { background: var(--gold-tint); }
.tbl tr.off td { opacity: .5; }
.tbl .r { text-align: right; }
.tbl td.ell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl small.block { font-size: 11.5px; margin-top: 2px; }
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab span { font-size: 11px; background: #efece5; color: var(--ink-2); border-radius: 10px; padding: 1px 7px; }
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.tab.on span { background: var(--gold-soft); color: var(--gold-2); }

/* ------------------------------------------------ formulários */
.fg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.c2 { grid-column: span 2; } .fld.c3 { grid-column: span 3; } .fld.c4, .fg > .c4 { grid-column: 1 / -1; }
.fld.end { justify-content: flex-end; }
.fld label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--gold); }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
select { cursor: pointer; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 79, .16); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--gold-2); cursor: pointer; }
.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(176, 63, 53, .12) !important; }
.fld.strong input { font-weight: 700; font-size: 15px; border-color: var(--gold); background: var(--gold-tint); }
.form-sec { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.form-sec:last-child { border: 0; margin: 0; padding: 0; }
.form-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); margin-bottom: 12px; font-weight: 700; }
.form-sec h4 small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 12px; }
.inline { display: flex; gap: 6px; }
.inline select { width: 74px; flex: none; }
.row-fill { display: flex; gap: 8px; }
.row-fill select { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; user-select: none; }
.mono-ta { font-size: 13px; }

/* ------------------------------------------------ modal e avisos */
.modal-back { position: fixed; inset: 0; background: rgba(21, 19, 15, .5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 100; overflow-y: auto; animation: fade .15s ease; }
.modal { width: 100%; max-width: 540px; background: var(--surface); border-radius: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, .28); display: flex; flex-direction: column; animation: pop .2s ease; margin-bottom: 4vh; }
.modal.wide { max-width: 960px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; }
.modal-b { padding: 22px; }
.modal-f { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; position: sticky; bottom: 0; flex-wrap: wrap; }
.confirm-msg { font-size: 15px; margin: 0; }
.msg-prev { background: #e7f6ec; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-top: 10px; white-space: pre-wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.banner { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; font-size: 13.5px; }
.banner.danger { background: var(--danger-soft); color: #7d2a22; }
.banner.warn { background: var(--warn-soft); color: #6f4508; }
.banner.info { background: var(--info-soft); color: #234b74; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--ink); color: #f6ead2; padding: 11px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; animation: pop .2s ease; transition: opacity .35s, transform .35s; max-width: min(92vw, 520px); }
.toast .ic { color: #8fd3a8; }
.toast.erro { background: #7d2a22; color: #fff; }
.toast.erro .ic { color: #ffc9c2; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ------------------------------------------------ clientes */
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pf-main { flex: 1; min-width: 240px; }
.pf-main h1 { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.pf-main p { margin: 4px 0 0; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dl { margin: 0; display: grid; gap: 12px; }
.dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.dl dd { margin: 2px 0 0; }
.foot-actions { display: flex; justify-content: flex-end; }

/* ------------------------------------------------ peças */
.sum-line { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sum-line b { color: var(--ink); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 18px; }
.pgrid > .empty { grid-column: 1 / -1; }
.pcard { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(29, 27, 23, .09); border-color: var(--line-2); }
.thumb { width: 100%; aspect-ratio: 1 / .78; object-fit: cover; display: block; background: var(--surface-2); }
.thumb.ph { display: grid; place-items: center; }
.thumb.m-gold { background: radial-gradient(circle at 30% 25%, #fff6e2, #ead5aa 60%, #d6b77c); color: #8b6a35; }
.thumb.m-silver { background: radial-gradient(circle at 30% 25%, #ffffff, #e3e4e8 60%, #c9ccd3); color: #6c717c; }
.thumb.m-rose { background: radial-gradient(circle at 30% 25%, #fff0ea, #f0cfc3 60%, #dfab9b); color: #9a5a49; }
.thumb.xs { width: 44px; height: 44px; aspect-ratio: auto; border-radius: 10px; flex: none; }
.pc-b { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.code { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.pc-n { font-size: 14px; line-height: 1.3; margin-top: 2px; }
.pc-b small { color: var(--muted); font-size: 12px; }
.pc-p { font-weight: 700; font-size: 16px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.peca-form { display: grid; grid-template-columns: 250px 1fr; gap: 24px; }
.pf-side { display: flex; flex-direction: column; gap: 10px; }
.photo { width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px dashed var(--line-2); background: var(--gold-tint); cursor: pointer; display: grid; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.sm { width: 140px; flex: none; }
.ph-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gold-2); font-weight: 600; font-size: 13px; }
.row-btns { display: flex; gap: 6px; }
.calc { position: sticky; top: 0; background: var(--ink); color: #eadfc8; border-radius: 14px; padding: 14px 16px; margin-top: 4px; }
.calc-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; }
.calc-row small { color: #a59c8a; }
.calc-row.big { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 4px; padding-top: 9px; font-size: 14px; }
.calc-row.big b { font-size: 17px; }
.calc .txt-ok { color: #8fd3a8; }
.calc .txt-danger { color: #ff9d92; }
.calc .muted { color: #a59c8a; }
.bar { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #d8b878, #f0d9a6); border-radius: 3px; }
.xrow { display: grid; grid-template-columns: 1fr 1.4fr 34px; gap: 8px; margin-bottom: 8px; align-items: center; }

/* ------------------------------------------------ nova venda */
.sale { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.sale-side { position: sticky; top: 20px; }
.step-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-h h2 { font-family: var(--serif); font-size: 24px; }
.num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #f1e2c2; font-weight: 700; font-size: 13px; flex: none; }
.cli-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--gold-tint); border: 1px solid var(--line); }
.cli-card > div { flex: 1; min-width: 0; }
.cli-card small { display: block; color: var(--muted); font-size: 12.5px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pick-cap { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 4px 0 2px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--gold); background: var(--gold-tint); }
.pk-t { flex: 1; min-width: 0; }
.pk-t b { display: block; }
.pk-t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-p { font-weight: 700; white-space: nowrap; }
.pk-add { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #f1e2c2; flex: none; }
.cart { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.cart-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--gold-tint); border: 1px solid #efe3c9; }
.cart-row small { display: block; color: var(--muted); font-size: 12px; }
.cart-empty { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 16px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--muted); }
.pay-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.pay { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; text-align: center; font-size: 12.5px; color: var(--ink-2); transition: all .15s; }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay .ic { color: var(--muted); }
.pay:hover { border-color: var(--gold); }
.pay.on { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.pay.on .ic { color: var(--gold-2); }
.pay:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.resumo h3 { font-family: var(--serif); font-size: 24px; margin-bottom: 12px; }
.rs-cli { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 12px; }
.rs-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.rs-row span { color: var(--muted); }
.rs-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.rs-total span { font-weight: 600; }
.rs-total b { font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rs-extenso { font-size: 11.5px; color: var(--muted); text-align: right; margin-bottom: 12px; }
.rs-pay { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.rs-big { font-size: 15px; margin: 6px 0; }
.rs-list { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; }
.rs-list li { display: flex; justify-content: space-between; padding: 3px 0; border-top: 1px dashed var(--line); }

/* ------------------------------------------------ documentos (contrato, certificado, OS) */
.doc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-bar .back { margin: 0; }
.doc { background: #fff; max-width: 820px; margin: 0 auto 24px; padding: 56px 64px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 12px 40px rgba(29, 27, 23, .08); font-size: 13.5px; line-height: 1.65; color: #23211c; }
.doc p { margin: 0 0 12px; text-align: justify; }
.doc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--gold); margin-bottom: 26px; }
.doc-brand { display: flex; gap: 14px; align-items: center; }
.doc-brand h2 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.doc-brand small { color: var(--muted); font-size: 11.5px; line-height: 1.5; display: block; margin-top: 3px; }
.doc-logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #e2c58c, #9c7438); color: #1a160f; flex: none; }
.doc-logo.lg { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 10px; }
.doc-num { text-align: right; display: flex; flex-direction: column; flex: none; }
.doc-num small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.doc-num b { font-size: 20px; font-variant-numeric: tabular-nums; }
.doc-title { font-family: var(--serif); text-align: center; font-size: 27px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 22px; }
.doc-tbl { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 13px; }
.doc-tbl th { text-align: left; background: var(--gold-tint); border-bottom: 1px solid var(--gold); padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.doc-tbl td { padding: 8px 10px; border-bottom: 1px solid #eee7d8; vertical-align: top; }
.doc-tbl td small { color: var(--muted); }
.doc-tbl td.mono { white-space: nowrap; }
.doc-tbl tfoot td { border: 0; padding: 4px 10px; }
.doc-tbl tr.tot td { font-weight: 700; font-size: 15px; border-top: 1px solid var(--gold); padding-top: 8px; }
.doc-tbl.parc { max-width: 420px; }
.doc-local { text-align: right !important; margin-top: 26px !important; }
.signs { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 56px; text-align: center; }
.signs.one { grid-template-columns: minmax(0, 320px); justify-content: center; }
.signs span { display: block; border-top: 1px solid #23211c; margin-bottom: 6px; }
.signs b { display: block; font-size: 13px; }
.signs small { color: var(--muted); font-size: 11px; }
.cert { padding: 22px; }
.cert-in { border: 2px solid var(--gold); outline: 1px solid var(--gold); outline-offset: -8px; border-radius: 4px; padding: 48px 52px; text-align: center; }
.cert-in h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 4px 0 18px; }
.cert-in p { text-align: center; }
.cert-loja { font-family: var(--serif); font-size: 18px; color: var(--gold-2); letter-spacing: .14em; text-transform: uppercase; margin: 0 !important; }
.cert-list { list-style: none; padding: 0; margin: 18px auto; max-width: 560px; text-align: left; }
.cert-list li { padding: 10px 0; border-bottom: 1px solid #eee7d8; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.cert-list small { grid-column: 1 / -1; color: var(--muted); }
.cert-gar { display: inline-flex; align-items: center; gap: 12px; text-align: left; background: var(--gold-tint); border: 1px solid #ecdcb9; border-radius: 12px; padding: 12px 18px; margin: 6px 0 18px; color: var(--gold-2); }
.cert-gar span { display: block; font-size: 12px; color: var(--muted); }
.cert-gar b { color: var(--ink); font-size: 15px; }
.os-doc { padding: 36px 48px; }
.os-title { font-family: var(--serif); font-size: 22px; margin-bottom: 14px; }
.os-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; margin-bottom: 14px; }
.os-grid .full { grid-column: 1 / -1; }
.os-grid dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.os-grid dd { margin: 0; }
.os-foto { max-width: 160px; border-radius: 8px; margin-bottom: 10px; }
.os-via .signs { margin-top: 36px; }
.os-via .doc-h { margin-bottom: 16px; }
.cut { text-align: center; color: var(--muted); font-size: 11px; border-top: 1px dashed var(--line-2); margin: 30px 0; padding-top: 4px; }

/* ------------------------------------------------ agenda */
.week-nav { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.week-nav h3 { font-size: 16px; margin-left: 6px; }
.week-nav h3 .muted { font-weight: 500; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.lg-gold::before { background: var(--gold); } .lg-info::before { background: var(--info); } .lg-ok::before { background: var(--ok); } .lg-warn::before { background: var(--warn); } .lg-muted::before { background: #a29b8d; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 440px; }
.day { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.day:last-child { border-right: 0; }
.day.past { background: #fcfbf8; }
.day.past .day-h { opacity: .6; }
.day-h { display: flex; align-items: center; gap: 6px; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.day-h span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.day-h b { font-size: 18px; }
.day-h .icon-btn { margin-left: auto; opacity: .55; }
.day:hover .day-h .icon-btn { opacity: 1; }
.day.today .day-h { background: var(--gold-soft); }
.day.today .day-h b { color: var(--gold-2); }
.day-b { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.free { color: #c3bba9; font-size: 12px; text-align: center; margin-top: 10px; }
.ev { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 9px; border-radius: 9px; border: 0; border-left: 3px solid; text-align: left; cursor: pointer; font-size: 12.5px; line-height: 1.3; transition: filter .15s; width: 100%; }
.ev:hover { filter: brightness(.97); }
.ev b { font-weight: 600; word-break: break-word; }
.ev small { color: inherit; opacity: .75; font-size: 11.5px; }
.ev-h { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 11.5px; }
.ev-gold { background: var(--gold-soft); border-color: var(--gold); color: #5e461c; }
.ev-info { background: var(--info-soft); border-color: var(--info); color: #1f456d; }
.ev-ok { background: var(--ok-soft); border-color: var(--ok); color: #1d5539; }
.ev-warn { background: var(--warn-soft); border-color: var(--warn); color: #6b4309; }
.ev-muted { background: #f0ede6; border-color: #a29b8d; color: #4f4a40; }
.ev.off { opacity: .45; text-decoration: line-through; }
.ev.done { opacity: .6; }

/* ------------------------------------------------ consertos (quadro) */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: #efebe2; border-radius: 16px; padding: 12px; min-height: 200px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; }
.col-h h3 { font-size: 14px; }
.count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 10px; padding: 1px 8px; }
.dot-s { width: 9px; height: 9px; border-radius: 50%; }
.dot-s.s0 { background: var(--info); } .dot-s.s1 { background: var(--warn); } .dot-s.s2 { background: var(--ok); } .dot-s.s3 { background: #a29b8d; }
.col-b { display: flex; flex-direction: column; gap: 10px; }
.os { background: #fff; border-radius: 12px; padding: 12px 13px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); cursor: pointer; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.os:hover { border-color: var(--line-2); box-shadow: 0 6px 18px rgba(29, 27, 23, .08); }
.os-top { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.os-tipo { color: var(--gold-2); }
.os p { font-size: 12.5px; color: var(--ink-2); margin: 3px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.os-meta span { display: inline-flex; align-items: center; gap: 4px; }
.os-act { display: flex; justify-content: space-between; margin-top: 10px; gap: 6px; }
.os-protect { display: flex; gap: 16px; align-items: flex-start; }

/* ------------------------------------------------ planilha */
.sheet-wrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 300px; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.sheet th, .sheet td { border-right: 1px solid #e6e0d2; border-bottom: 1px solid #e6e0d2; padding: 0 10px; height: 34px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.sheet thead th { position: sticky; top: 0; z-index: 2; background: #f3efe6; text-align: left; font-weight: 600; font-size: 11px; color: #9b9383; height: auto; padding: 6px 10px; }
.sheet thead th small { display: block; font-size: 12.5px; color: var(--ink); font-weight: 600; }
.sheet .rn { position: sticky; left: 0; z-index: 1; background: #f3efe6; color: #9b9383; text-align: center; font-size: 11.5px; min-width: 42px; padding: 0 6px; }
.sheet thead .rn { z-index: 3; }
.sheet td.ed { cursor: text; background: #fff; }
.sheet td.ed:hover { background: #fffcf4; }
.sheet td.ed:focus { outline: 2px solid var(--gold); outline-offset: -2px; background: #fff; white-space: normal; text-overflow: clip; overflow: visible; }
.sheet td.ro { background: #faf8f3; color: var(--ink-2); }
.sheet td.saved { background: #e5f2ea !important; transition: background .2s; }
.sheet tfoot td { position: sticky; bottom: 0; background: #f3efe6; font-weight: 700; }

/* ------------------------------------------------ configurações */
.cfg .fg { margin-bottom: 4px; }
.cfg-f { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.logo-cfg { display: flex; gap: 18px; align-items: center; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.logo-cfg > div:last-child { flex: 1; min-width: 220px; }
.logo-cfg p { margin: 4px 0 10px; }
.logo-prev { width: 150px; height: 110px; border-radius: 12px; background: var(--side); display: grid; place-items: center; padding: 12px; flex: none; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.backup { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------ gerador de contratos */
.cg { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 20px; align-items: start; }
.cg-form { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; margin: 0; }
.cg-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.cg-form fieldset:disabled { opacity: .55; }
.cg-form .fg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cg-form .form-sec h4 { display: flex; align-items: center; gap: 6px; }
.mt-s { margin-top: 12px; }
.it-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.it-top { display: grid; grid-template-columns: 1fr 110px 34px; gap: 6px; align-items: center; }
.it-row small { font-size: 11.5px; }
.cg-prev { min-width: 0; }
.cg-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cg-num { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.cg-prev .doc { padding: 44px 48px; }
.pill { font-size: 11px; background: var(--gold-soft); color: var(--gold-2); border-radius: 10px; padding: 1px 7px; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sig-box { display: flex; flex-direction: column; gap: 6px; }
.sig-box label { font-size: 12.5px; color: var(--ink-2); }
.sig-box canvas { width: 100%; height: 180px; border: 1px dashed var(--line-2); border-radius: 12px; background: #fff linear-gradient(transparent 74%, #e7dfcd 74%, #e7dfcd calc(74% + 1px), transparent calc(74% + 1px)); touch-action: none; cursor: crosshair; }
.sig-box .btn { align-self: flex-end; }
.signs > div { display: flex; flex-direction: column; justify-content: flex-end; }
.sig { display: block; height: 64px; max-width: 100%; object-fit: contain; margin: 0 auto -8px; }
.sig-note { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; color: var(--muted); margin-top: 22px !important; text-align: left !important; }
.sig-note .ic { margin-top: 1px; color: var(--ok); }

/* ------------------------------------------------ responsivo */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
  .sale { grid-template-columns: 1fr; }
  .sale-side { position: static; }
  .cg { grid-template-columns: 1fr; }
  .cg-form { position: static; max-height: none; overflow: visible; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-opts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .side { transform: translateX(-100%); box-shadow: 10px 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--side); color: #f3e6cb; padding: 8px 12px; }
  .topbar .icon-btn { color: #f3e6cb; }
  .brand-sm { font-family: var(--serif); font-size: 22px; font-weight: 600; }
  .view { padding: 20px 16px 64px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .week { grid-template-columns: 1fr; min-height: 0; }
  .day { border-right: 0; border-bottom: 1px solid var(--line); }
  .day-b { flex-direction: column; }
  .day.past { display: none; }
  .peca-form { grid-template-columns: 1fr; }
  .pf-side { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: start; }
  .pf-side .photo { grid-row: span 2; }
  .pf-side .calc { grid-column: 1 / -1; position: static; }
  .doc { padding: 32px 22px; }
  .doc-h { flex-direction: column; }
  .doc-num { text-align: left; }
  .cert-in { padding: 32px 18px; }
}
@media (max-width: 720px) {
  .fg { grid-template-columns: 1fr 1fr; }
  .fld.c2, .fld.c3 { grid-column: 1 / -1; }
  .page-head h1 { font-size: 32px; }
  .kanban { grid-template-columns: 1fr; }
  .al { flex-wrap: wrap; }
  .al-a { width: 100%; justify-content: flex-end; }
  .signs { grid-template-columns: 1fr; gap: 40px; }
  .os-grid { grid-template-columns: 1fr 1fr; }
  .os-protect { flex-direction: column; }
  .sig-grid { grid-template-columns: 1fr; }
  .cg-prev .doc { padding: 28px 18px; }
  .toolbar select { flex: 1; min-width: 140px; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; margin: 0; }
  .modal-f { border-radius: 0; }
}
@media (max-width: 460px) {
  .fg { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick button { flex-direction: column; text-align: center; gap: 6px; padding: 12px 8px; }
  .pay-opts { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
}

/* ------------------------------------------------ impressão */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .side, .topbar, .scrim, .toasts, .no-print { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  .doc { box-shadow: none; border-radius: 0; padding: 0; margin: 0; max-width: none; font-size: 12px; }
  .page-break { page-break-before: always; break-before: page; }
  .cert { padding: 0; }
  .cg { display: block; }
  .cg-prev .doc { padding: 0; }
  .doc-h { border-bottom-color: #b08a4f; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- dashboard, números clicáveis e login ---- */
.chart-box { position: relative; height: 280px; }
.kpi.click { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi.click:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(29, 27, 23, .06), 0 10px 26px rgba(29, 27, 23, .09); }
.kpi.click:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kpi.click::after { content: 'Ver detalhes ›'; position: absolute; right: 14px; top: 14px; font-size: 11.5px; font-weight: 600; color: var(--gold-2); opacity: 0; transition: opacity .12s; }
.kpi.click:hover::after, .kpi.click:focus-visible::after { opacity: 1; }
.page-actions select { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font: inherit; }

.auth { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: var(--side); overflow-y: auto; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border-radius: 18px; padding: 30px 30px 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); }
.auth-card img { display: block; width: 130px; margin: 0 auto 10px; }
.auth-card h1 { font-family: var(--serif); font-size: 27px; font-weight: 600; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 4px 0 20px; }
.auth-card .fld { margin-bottom: 12px; }
.auth-err { min-height: 20px; margin: 2px 0 10px; color: var(--danger); font-size: 13px; font-weight: 500; }

.side-user { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user .su-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-user b { color: var(--side-ink); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--side-muted); font-size: 11.5px; }
.side-user .icon-btn { color: var(--side-muted); }
.side-user .icon-btn:hover { color: #f6e7c8; background: rgba(255, 255, 255, .07); }

/* ---- contrato no formato do bloco de papel ---- */
.chk-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 22px; justify-content: start; padding-top: 4px; }
details.ficha > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.ficha > summary::-webkit-details-marker { display: none; }
details.ficha > summary h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; }
details.ficha > summary h2 small { font-family: var(--sans); font-size: 12.5px; font-weight: 400; margin-left: 6px; }
details.ficha[open] > summary { margin-bottom: 16px; }

.cf { padding: 30px 34px; font-size: 12.5px; line-height: 1.35; }
.cf-head { display: grid; grid-template-columns: 1fr 200px; border: 1.5px solid #23211c; }
.cf-brand { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.cf-logo { height: 76px; width: auto; max-width: 120px; object-fit: contain; flex: none; }
.cf-brand b { display: block; font-size: 15px; }
.cf-brand small { display: block; font-size: 11px; color: #4a463e; }
.cf-title { border-left: 1.5px solid #23211c; padding: 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.cf-title b { font-size: 18px; letter-spacing: .04em; line-height: 1.15; }
.cf-title span { font-weight: 700; font-size: 12.5px; }
.cf-title small { font-size: 10.5px; }
.cf-title em { font-style: normal; font-size: 11.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cf-row { display: flex; border: 1.5px solid #23211c; border-top: 0; }
.cf-c { flex: 1 1 0; min-width: 0; padding: 3px 8px 4px; border-left: 1px solid #23211c; min-height: 36px; display: flex; flex-direction: column; justify-content: space-between; }
.cf-c:first-child { border-left: 0; }
.cf-c small { font-size: 10px; font-weight: 600; color: #4a463e; }
.cf-c b { font-size: 13px; font-weight: 600; min-height: 17px; overflow-wrap: anywhere; }
.cf-c.w2 { flex-grow: 2; } .cf-c.w3 { flex-grow: 3; } .cf-c.sm { flex-grow: .45; }
.cf-sec { margin: 0; padding: 4px; text-align: center; font: 700 13px var(--sans); letter-spacing: .08em; border: 1.5px solid #23211c; border-top: 0; background: var(--gold-tint); }
.cf-items { width: 100%; border-collapse: collapse; border: 1.5px solid #23211c; border-top: 0; font-size: 12px; }
.cf-items th { text-align: left; padding: 4px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #23211c; }
.cf-items td { padding: 4px 8px; border-bottom: 1px solid #ddd5c4; vertical-align: top; }
.cf-items td small { display: block; color: #6b655a; font-size: 11px; }
.cf-items .r { text-align: right; white-space: nowrap; }
.cf-items tfoot td { border: 0; }
.cf-box { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; border: 1.5px solid #23211c; border-top: 0; }
.cf-cell { padding: 8px 10px; border-left: 1px solid #23211c; min-width: 0; }
.cf-cell:first-child { border-left: 0; }
.cf-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; margin-bottom: 8px; }
.cf-cb { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; white-space: nowrap; }
.cf-cb i { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1.2px solid #23211c; font: 700 10px/1 var(--sans); font-style: normal; }
.cf-l { margin: 0 0 7px !important; text-align: left !important; }
.cf-l small { font-size: 10.5px; font-weight: 600; color: #4a463e; }
.cf-l b { font-weight: 600; }
.cf-tot { font-size: 16px; }
.cf-pls { margin-top: 4px; }
.cf-pl { display: flex; gap: 8px; align-items: baseline; border-bottom: 1px solid #23211c; min-height: 19px; font-size: 11.5px; }
.cf-pl i { font-style: normal; }
.cf-obs { border: 1.5px solid #23211c; border-top: 0; padding: 4px 8px; min-height: 96px; }
.cf-obs small { font-size: 10px; font-weight: 600; color: #4a463e; }
.cf-obs p { margin: 2px 0 0 !important; text-align: left !important; white-space: pre-wrap; }
.cf-recebi { margin: 14px 0 0 !important; text-align: left !important; }
.cf-signs { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 28px; margin-top: 34px; text-align: center; }
.cf-signs > div { display: flex; flex-direction: column; justify-content: flex-end; min-height: 60px; }
.cf-signs span { display: block; border-top: 1px solid #23211c; margin-bottom: 4px; }
.cf-signs b { font-size: 12px; font-weight: 500; }
.cf-signs small { font-size: 10.5px; color: #6b655a; }
.cf-sig { height: 54px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 2px; }
@media (max-width: 720px) {
  .cf { padding: 18px 12px; }
  .cf-head, .cf-box { grid-template-columns: 1fr; }
  .cf-title, .cf-cell { border-left: 0; border-top: 1px solid #23211c; }
  .cf-row { flex-wrap: wrap; }
  .cf-c { flex: 1 1 45%; border-top: 1px solid #ddd5c4; }
  .cf-signs { grid-template-columns: 1fr; }
  .chk-grid { grid-template-columns: repeat(2, auto); }
}
@media print {
  .cf { font-size: 10.5px; line-height: 1.28; }
  .cf-sec { background: none; padding: 2px; }
  .cf-c { min-height: 28px; padding: 2px 6px 3px; }
  .cf-c b { font-size: 11.5px; min-height: 14px; }
  .cf-logo { height: 58px; }
  .cf-brand, .cf-title { padding: 6px 10px; }
  .cf-items td, .cf-items th { padding: 2px 8px; }
  .cf-cell { padding: 5px 8px; }
  .cf-l { margin-bottom: 4px !important; }
  .cf-pl { min-height: 15px; }
  .cf-obs { min-height: 58px; }
  .cf-recebi { margin-top: 8px !important; }
  .cf-signs { margin-top: 20px; }
}

.side-trial { margin: 0 16px 10px; padding: 8px 10px; border-radius: 10px; background: rgba(212, 175, 110, .14); color: #f0d9a8; font-size: 12px; font-weight: 600; text-align: center; }
