/* Braza Portal — app limpo: superfícies brancas sobre cinza frio, laranja da marca como acento */

:root {
  --bg: #F2F4F7;
  --bg-2: #EAEDF2;
  --card: #FFFFFF;
  --line: #E4E7EC;
  --line-2: #D0D5DD;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --brand: #0A5A9C;
  --brand-2: #004898;
  --brand-soft: #E8F0FA;
  --copper: #A06038;
  --copper-soft: #F6ECE4;
  --grad: linear-gradient(135deg, #1470BE 0%, #004898 100%);
  --ok: #027A48;
  --ok-2: #12B76A;
  --ok-soft: #ECFDF3;
  --bad: #D92D20;
  --bad-soft: #FEF3F2;
  --amber: #DC6803;
  --amber-soft: #FFFAEB;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 12px 40px -12px rgba(16, 24, 40, .28);
  --r: 20px;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;

  --c-violet: #7A5AF8; --c-blue: #2E90FA; --c-green: #12B76A; --c-amber: #F79009;
  --c-rose: #EE46BC; --c-teal: #06AED4; --c-ember: #A06038; --c-coal: #475467;
}

/* Sempre claro (pedido da dona: no celular estava ficando escuro) */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum'; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg { flex: none; }
.btn svg, .icon-btn svg, .hint svg, .menu svg, .avatar svg, .grip svg, .add svg, .paid-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.grip svg { fill: currentColor; stroke: none; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); position: relative; overflow: hidden; }
.login::before { content: ''; position: absolute; inset: -40% -20% auto; height: 70%; background: var(--grad); border-radius: 0 0 50% 50% / 0 0 30% 30%; opacity: .95; }
.login-card { position: relative; width: min(400px, 100%); background: var(--card); border-radius: 28px; padding: 28px 24px 24px; box-shadow: var(--shadow-2); display: grid; gap: 14px; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.login-brand { display: block; margin: 4px 0 8px; }
.login-brand img { display: block; width: 240px; max-width: 100%; height: auto; }
.login h1 { font-size: 26px; margin: 4px 0 0; }
.login-sub { margin: -8px 0 4px; color: var(--muted); }

/* ---------- Campos e botões ---------- */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
input, select, textarea { width: 100%; background: var(--bg-2); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; font-size: 16px; font-weight: 600; outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
input::placeholder { color: var(--muted); font-weight: 500; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.form-error { margin: 0; color: var(--bad); background: var(--bad-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }

.btn { border: 1.5px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; color: var(--ink); }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px var(--brand); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 20px; font-size: 16px; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.icon-btn { border: 0; background: var(--bg-2); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--line); }

/* ---------- Casca ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; height: 35px; width: auto; }
.brand span { font: 800 12px/1 var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--copper); padding: 5px 8px; border: 1.5px solid var(--copper); border-radius: 999px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 999px; padding: 6px 12px 6px 12px; text-decoration: none; }
.pill small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); }
.pill b { font: 800 15px/1 var(--body); }
.pill.pos { background: var(--ok-soft); } .pill.pos b { color: var(--ok); }
.pill.neg { background: var(--bad-soft); } .pill.neg b { color: var(--bad); }

.view { max-width: 1000px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.view > * { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.view > *:nth-child(2) { animation-delay: .04s; } .view > *:nth-child(3) { animation-delay: .08s; }
.view > *:nth-child(4) { animation-delay: .12s; } .view > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(7, 1fr); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; transition: color .2s; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; padding: 3px 10px; border-radius: 999px; box-sizing: content-box; transition: background .2s; }
.tabs a.on { color: var(--brand); }
.tabs a.on svg { background: var(--brand-soft); }
@media (min-width: 640px) { .tabs { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 680px; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-2); padding: 6px 8px; } }

.h-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 28px 2px 12px; }
.h-row:first-child { margin-top: 4px; }
.h-row h2 { font-size: 22px; margin: 0; }
.h-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.empty { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 28px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 700 19px var(--display); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 14px 4px 0; }
.hint.in { margin: 6px 0 2px; }

/* ---------- Navegação de data ---------- */
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.datebar .when { text-align: center; flex: 1; min-width: 0; position: relative; }
.datebar .when b { display: block; font: 700 24px/1.1 var(--display); letter-spacing: -.02em; }
.datebar .when span { font-size: 13px; color: var(--muted); font-weight: 600; }
.datebar .when input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.nav-btn { width: 42px; height: 42px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); display: grid; place-items: center; flex: none; }
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.strip button { border: 0; background: var(--card); border-radius: 16px; padding: 9px 0 8px; display: grid; justify-items: center; gap: 1px; min-width: 0; box-shadow: var(--shadow); }
.strip small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.strip b { font: 800 17px/1.1 var(--display); }
.strip i { font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 700; height: 14px; white-space: nowrap; }
.strip .has i { color: var(--ok); }
.strip .today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.strip .on { background: var(--ink); color: var(--card); }
.strip .on small, .strip .on i { color: color-mix(in srgb, var(--card) 70%, transparent); }
.strip .on.has i { color: var(--ok-2); }

/* ---------- Totais ---------- */
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.totals.four { grid-template-columns: repeat(4, 1fr); }
.totals > div { padding: 14px 14px 13px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.totals small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.totals b { display: block; font: 800 clamp(18px, 5vw, 26px)/1.15 var(--display); letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.totals .hero { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -12px var(--brand); }
.totals .hero small { color: rgba(255, 255, 255, .8); }
.totals .hero b { color: #fff; }
@media (max-width: 520px) { .totals.four { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cartões e equipes ---------- */
.grid { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 860px) { .grid.two { grid-template-columns: 1fr 1fr; align-items: start; } }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
[data-color] { --tc: var(--c-ember); }
[data-color=violet] { --tc: var(--c-violet); } [data-color=blue] { --tc: var(--c-blue); }
[data-color=green] { --tc: var(--c-green); } [data-color=amber] { --tc: var(--c-amber); }
[data-color=rose] { --tc: var(--c-rose); } [data-color=teal] { --tc: var(--c-teal); }
[data-color=coal] { --tc: var(--c-coal); }
.avatar { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--tc, var(--brand)); color: #fff; font: 800 17px var(--display); flex: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
.avatar.sm svg { width: 16px; height: 16px; }
.avatar.person { background: var(--bg-2); color: var(--ink-2); }
.team { transition: box-shadow .15s, transform .15s; }
.team.drop { box-shadow: 0 0 0 3px var(--tc), var(--shadow-2); transform: scale(1.01); }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.team-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.team-id h3 { margin: 0; font-size: 19px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-id small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--tc); }
.tag { font: 800 10.5px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--tc, var(--muted)); background: color-mix(in srgb, var(--tc, var(--muted)) 12%, transparent); padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.team-profit { text-align: right; line-height: 1.1; flex: none; }
.team-profit small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.team-profit b { font: 800 20px var(--display); letter-spacing: -.02em; }
.sec { padding: 8px 16px 14px; }
.sec + .sec { border-top: 1px solid var(--line); padding-top: 10px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); margin: 4px 0 4px; }
.sec-title b { font: 800 15px var(--body); color: var(--ink); letter-spacing: 0; }
.plan-sum { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--amber); }
.tip-sum { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--copper); }
.totals .tip-sum, .table .tip-sum { display: block; font-size: 11px; margin-top: 2px; white-space: nowrap; }
.tipb { display: block; text-align: right; font-style: normal; font-weight: 800; font-size: 10.5px; color: var(--copper); margin-top: 3px; white-space: nowrap; }

.line { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.line:last-of-type { border-bottom: 0; }
.line .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.line .k { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--bad); margin-right: 6px; }
.line .k.plan { color: var(--amber); }
.line b { font: 800 15.5px var(--body); flex: none; }
.line.planned .txt, .line.planned b { color: var(--muted); }
.line.planned b { font-weight: 600; }
.grip { width: 26px; height: 32px; display: grid; place-items: center; color: var(--line-2); cursor: grab; touch-action: none; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.grip:hover { color: var(--muted); background: var(--bg-2); }
.grip svg { width: 16px; height: 16px; }
.lifted { opacity: .35; }
.drag-ghost { position: fixed; z-index: 200; pointer-events: none; background: var(--card); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow-2); transform: rotate(-1.5deg) scale(1.03); border-bottom: 0 !important; opacity: .96; }
body.dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
body.dragging .grip { cursor: grabbing; }

.add { display: grid; grid-template-columns: auto 1fr 92px 40px; gap: 6px; margin-top: 10px; align-items: stretch; }
.add input { padding: 9px 12px; font-size: 15px; min-width: 0; border-radius: 12px; }
.add .amt { text-align: right; font-weight: 800; }
.add button[type=submit] { border: 0; border-radius: 12px; background: var(--tc, var(--brand)); color: #fff; display: grid; place-items: center; }
.add button[type=submit] svg { stroke-width: 2.4; }
.kind-toggle { border: 0; background: var(--ok-soft); border-radius: 12px; padding: 0 10px; font-size: 12px; font-weight: 800; color: var(--ok); min-width: 54px; }
.kind-toggle[data-kind=cost] { color: var(--bad); background: var(--bad-soft); }
@media (max-width: 400px) { .add { grid-template-columns: auto 1fr 78px 40px; } }

.pay-row { display: grid; grid-template-columns: 26px 1fr auto 100px; gap: 6px; align-items: center; padding: 5px 0; }
.pay-row .who { min-width: 0; border: 0; background: none; text-align: left; padding: 4px 0; border-radius: 8px; }
.pay-row .who b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-row .who small { color: var(--muted); font-size: 11.5px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-row input { text-align: right; padding: 9px 12px; font-size: 16px; font-weight: 800; border-radius: 12px; }
.pay-row input.saved { background: var(--ok-soft); border-color: var(--ok-2); }
.pay-row input.err { border-color: var(--bad); }
.chip { border: 1.5px dashed var(--line-2); background: transparent; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.sec-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sec-foot select { width: auto; padding: 7px 34px 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); background-color: transparent; border: 1.5px dashed var(--line-2); max-width: 100%; }
.team.inbox .avatar { background: var(--bg-2); color: var(--muted); }
.team.inbox .team-id small { color: var(--muted); }

/* ---------- Semana ---------- */
.worker { padding: 14px 16px; }
.worker-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.worker-top h3 { margin: 0; font-size: 19px; line-height: 1.15; }
.worker-top small { color: var(--muted); font-size: 13px; font-weight: 600; }
.worker-top .total { text-align: right; flex: none; }
.worker-top .total b { font: 800 24px/1 var(--display); letter-spacing: -.02em; }
.worker-top .total small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0 4px; }
.days div { background: var(--bg-2); border-radius: 10px; padding: 6px 2px; text-align: center; min-width: 0; }
.days small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.days b { font: 800 13px var(--body); white-space: nowrap; }
.days .zero b { color: var(--line-2); font-weight: 600; }
.adjusts { margin-top: 6px; }
.adjusts .line { grid-template-columns: 1fr auto; }
.worker-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.paid-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 12px; padding: 7px 11px; border-radius: 999px; }
.warn { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 700; margin-top: 10px; }

.result { padding: 14px 16px; }
.result-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.result-top h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); flex: none; }
.result-top b { font: 800 22px var(--display); letter-spacing: -.02em; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--bg-2); margin: 10px 0 9px; }
.bar i { display: block; height: 100%; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar .b-pay { background: var(--tc); opacity: .5; } .bar .b-cost { background: var(--c-coal); opacity: .45; } .bar .b-profit { background: var(--ok-2); } .bar .b-loss { background: var(--bad); }
.result-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); font-weight: 600; }
.result-nums b { font-weight: 800; color: var(--ink); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: right; padding: 12px 12px 8px; font-weight: 800; }
.table th:first-child, .table td:first-child { text-align: left; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: right; font-weight: 800; white-space: nowrap; }
.table td:first-child { font-weight: 700; color: var(--ink-2); }
.table tfoot td { background: var(--bg-2); border-top: 2px solid var(--line-2); }
.table .z { color: var(--line-2); font-weight: 600; }
.scroll-x { overflow-x: auto; }
@media (max-width: 520px) { .table { font-size: 12.5px; } .table th, .table td { padding-left: 5px; padding-right: 5px; } .table th:first-child, .table td:first-child { padding-left: 12px; } .table th:last-child, .table td:last-child { padding-right: 12px; } }

/* ---------- Casas e arquivos ---------- */
.house-head { padding: 14px 16px 8px; display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.house-head h3 { margin: 0; font-size: 19px; line-height: 1.15; }
.house-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.house-notes { margin: 0 16px 8px; padding: 10px 12px; background: var(--bg-2); border-radius: 12px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.file { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.file:hover { background: var(--bg-2); }
.ext { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font: 800 10.5px var(--body); letter-spacing: .05em; color: #fff; background: var(--c-coal); text-transform: uppercase; }
.ext.html { background: var(--brand); } .ext.pdf { background: #D92D20; } .ext.doc { background: var(--c-blue); } .ext.xls { background: var(--c-green); } .ext.img { background: var(--c-violet); }
.file b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--muted); font-size: 12.5px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .live { color: var(--ok); font-weight: 800; }
.file .more { color: var(--muted); font-size: 22px; line-height: 1; }
.card-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.cat-title { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); padding: 12px 16px 6px; }

/* ---------- Ajustes ---------- */
.list-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--bg-2); }
.list-row .l { min-width: 0; display: flex; align-items: center; gap: 11px; }
.list-row b { font-weight: 700; }
.list-row small { color: var(--muted); display: block; font-size: 12.5px; font-weight: 600; }
.list-row.off { opacity: .5; }
.list-row .r { color: var(--muted); font-weight: 800; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.pad { padding: 14px 16px; }
.sync { display: grid; gap: 10px; }
.sync .btn { justify-self: start; }
.sync-status { display: flex; align-items: center; gap: 12px; }
.sync-status .avatar { background: var(--brand-soft); color: var(--brand); }
.sync-status b { display: block; font-weight: 800; }
.sync-status small { color: var(--muted); font-weight: 600; font-size: 13px; }
.sync p { margin: 0; }

/* ---------- Folha (bottom sheet) ---------- */
.sheet { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; color: var(--ink); }
.sheet::backdrop { background: rgba(16, 24, 40, .5); backdrop-filter: blur(2px); }
.sheet[open] { display: grid; align-items: end; justify-items: center; }
.sheet-in { width: min(540px, 100%); max-height: 92dvh; overflow: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); animation: up .3s cubic-bezier(.2, .85, .2, 1) both; display: grid; gap: 13px; }
.sheet-in::before { content: ''; width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); justify-self: center; margin-bottom: 2px; }
@media (min-width: 640px) { .sheet[open] { align-items: center; } .sheet-in { border-radius: 24px; padding-top: 24px; } .sheet-in::before { display: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0; font-size: 22px; line-height: 1.15; }
.sheet h3 + p { margin: -8px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.sheet form { display: grid; gap: 13px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn.danger { flex: 0 0 auto; }
.menu { display: grid; gap: 8px; }
.menu .btn { justify-content: flex-start; padding: 13px 16px; border-radius: 16px; text-align: left; }
.menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); margin: 6px 0 -2px; }
.linkbox { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.linkbox input { font-size: 13px; font-family: ui-monospace, monospace; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--card); padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- Leads ---------- */
.fchips { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0 0; padding-bottom: 2px; scrollbar-width: none; }
.fchip { flex: none; border: 1.5px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.lead-search { margin-top: 10px; }
.lead-row { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.lead-row:first-child { border-top: 0; } .lead-row:hover { background: var(--bg-2); }
.lr-main b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-main small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-side { display: grid; justify-items: end; gap: 3px; font-size: 13px; }
.lr-side b { font-weight: 800; }
.stage { font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.st-novo { background: var(--brand-soft); color: var(--brand); } .st-contato { background: #EEF4FF; color: #3538CD; }
.st-orcamento { background: var(--copper-soft); color: var(--copper); } .st-followup { background: var(--amber-soft); color: var(--amber); }
.st-ganho { background: var(--ok-soft); color: var(--ok); } .st-perdido { background: var(--bad-soft); color: var(--bad); }
.fu { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; } .fu.today { color: var(--amber); } .fu.late { color: var(--bad); }
.lead-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.lead-head h3 { margin: 0; } .lead-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quote { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; }
.quote.q-aceito { border-color: var(--ok-2); } .quote.q-recusado { opacity: .6; }
.q-top { display: flex; align-items: center; gap: 8px; } .q-total { margin-left: auto; font-size: 17px; }
.qst { font-style: normal; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.q-enviado .qst { color: var(--copper); } .q-aceito .qst { color: var(--ok); }
.quote small { color: var(--muted); font-weight: 600; }
.q-act { display: flex; flex-wrap: wrap; gap: 6px; }
.note-add { display: grid !important; grid-template-columns: auto minmax(0,1fr) auto; gap: 6px; }
.note-add select { width: auto; padding: 9px 30px 9px 10px; font-size: 14px; } .note-add input { padding: 9px 12px; font-size: 15px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li small { grid-column: 2; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.ev-k { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.qlines { display: grid; gap: 6px; }
.qline { display: grid; grid-template-columns: minmax(0,1fr) 54px 88px 38px; gap: 6px; align-items: center; }
.qline input { padding: 9px 10px; font-size: 14.5px; } .qline input[name=price], .qline input[name=qty] { text-align: right; }
.pgroup { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; margin: 0; display: grid; gap: 6px; }
.pgroup input:first-child { font-weight: 800; }
.pgroup textarea { font-family: ui-monospace, monospace; font-size: 13.5px; min-height: 60px; }
/* Agente */
.agent-page { display: flex; flex-direction: column; gap: 10px; height: calc(100dvh - 59px - 16px - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 380px; }
body.on-agent .view { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.agent-page .chat { flex: 1 1 auto; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; }
.agent-page .warn { margin: 0; }
.agent-head h2 { margin: 0; font-size: 22px; display: flex; gap: 8px; align-items: center; } .agent-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.agent-head h2 svg { width: 22px; height: 22px; fill: none; stroke: var(--copper); stroke-width: 1.8; }
.agent-threads { font-size: 14px; padding: 9px 36px 9px 12px; }
.agent-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.agent-head h3 { display: flex; gap: 8px; align-items: center; } .agent-head h3 svg { color: var(--copper); width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.chat { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; min-height: 0; }
.bub { position: relative; max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bub.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bub.assistant { align-self: flex-start; background: var(--bg-2); border-bottom-left-radius: 4px; padding-right: 34px; }
.bub a { color: var(--brand); }
.bub-copy { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--muted); padding: 2px; }
.bub-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.typing { display: flex; gap: 4px; padding: 14px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-empty { display: grid; gap: 8px; justify-items: start; color: var(--muted); font-size: 14px; padding: 6px 2px; }
.chat-empty b { color: var(--ink); font: 700 17px var(--display); }
.chat-empty .chip { text-align: left; white-space: normal; border-style: solid; }
.chat-form { display: grid !important; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.chat-form textarea { min-height: 48px; max-height: 140px; resize: none; font-size: 15px; }
.chat-form .btn { height: 48px; width: 48px; padding: 0; }
.chat-form .btn svg { width: 20px; height: 20px; }
@media (max-width: 440px) { .tabs { padding-left: 4px; padding-right: 4px; } .tabs a { font-size: 9.5px; } .tabs svg { padding: 3px 5px; width: 22px; height: 22px; } }

.mp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mp-ok { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 13px; padding: 7px 11px; border-radius: 999px; }
.mp-ok svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.mp-prev { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--bg-2); border-radius: 14px; padding: 12px; }
.mp-prev small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; color: var(--muted); }
.mp-prev b { font-size: 14px; overflow-wrap: anywhere; }

/* Envio do orçamento e anexos do agente */
.q-status { color: var(--muted); font-weight: 600; } .q-status b.pos { color: var(--ok); }
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.send-opt { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 14px; border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--card); text-decoration: none; color: var(--ink); font: inherit; cursor: pointer; }
.send-opt:hover { border-color: var(--brand); } .send-opt svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; margin-bottom: 4px; }
.send-opt b { font-size: 15px; } .send-opt small { color: var(--muted); font-size: 12px; font-weight: 600; }
.send-opt:disabled, .send-opt.off { opacity: .45; pointer-events: none; }
.agent-quote { align-self: flex-start; display: flex; gap: 10px; align-items: center; background: var(--copper-soft); color: var(--copper); border-radius: 14px; padding: 8px 10px 8px 12px; font-weight: 800; font-size: 13px; }
.agent-quote span { display: flex; gap: 6px; align-items: center; } .agent-quote svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.chat-form { grid-template-columns: auto minmax(0,1fr) auto !important; }
.chat-form .btn:first-child { height: 48px; width: 44px; padding: 0; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; }
.att { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border-radius: 10px; padding: 4px 6px 4px 4px; font-size: 12.5px; font-weight: 700; max-width: 100%; }
.att img { width: 30px; height: 30px; object-fit: cover; border-radius: 7px; } .att svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.att button { border: 0; background: none; padding: 2px; color: var(--muted); display: grid; }
.thumbs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; } .thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }

.qline textarea[name=details] { grid-column: 1 / -1; font-size: 13px; padding: 8px 10px; min-height: 0; color: var(--ink-2); }
.qline { padding-bottom: 6px; border-bottom: 1px dashed var(--line); }

/* 2026-10-08: voz no agente + enquadramento no celular */
.btn { white-space: nowrap; } .btn.block { white-space: normal; }
.agent-tools { display: flex; gap: 6px; flex: none; }
.btn.icon { width: 38px; height: 38px; padding: 0; } .btn.icon.on { background: var(--copper-soft); color: var(--copper); border-color: transparent; }
.chat-form { grid-template-columns: auto minmax(0,1fr) auto auto !important; gap: 6px; }
.chat-form textarea { min-height: 48px; height: 48px; padding-top: 12px; padding-bottom: 12px; line-height: 1.4; overflow-y: auto; }
.chat-form .mic.rec { background: var(--bad); border-color: transparent; color: #fff; animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.totals > div { container-type: inline-size; }
.totals b { font-size: clamp(14px, 17.5cqi, 26px); }
@media (max-width: 520px) {
  .agent-head p { display: none; }
  .agent-head { align-items: center; }
  .agent-head h2 { font-size: 20px; }
  .agent-page .chat { padding: 10px; }
  .bub { max-width: 92%; }
  .chat-form .btn, .chat-form .btn:first-child { width: 44px; height: 46px; }
  .chat-form textarea { min-height: 46px; height: 46px; padding-left: 12px; padding-right: 12px; }
  .totals > div { padding: 12px 11px 11px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .chat-form .btn, .chat-form .btn:first-child { width: 40px; }
}
