[hidden] { display: none !important; }
body.no-scroll { overflow: hidden; }
.app-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; border: 0; cursor: pointer; }
.top-avatar { background: #D9B27C; color: #1F2E27; }
.view { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.muted-sm { color: var(--muted); font-size: 13px; }
.btn.sm { width: auto; height: 42px; padding: 0 16px; font-size: 14px; margin-top: 0; flex-shrink: 0; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.icon-btn svg, .round-btn svg, .tab-item svg, .search svg, .fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Tab bar */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 20px rgba(0,0,0,.05); }
.tab-item { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 12px; transition: color .2s; }
.tab-item.active { color: var(--gold); }
.tab-item.active svg { stroke-width: 2.2; }

/* Dashboard */
.hero { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--green); border: 0; color: #F2EFE7; }
.hero .muted-sm { color: rgba(242, 239, 231, .7); }
.hero-title { margin: 4px 0; font-size: 21px; }
.hero .btn.primary { background: #D9B27C; color: #15170F; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { padding: 14px; text-align: right; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: var(--text); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 26px; line-height: 1; }
.kpi.gold b { color: var(--gold); }
.section { padding: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 16px; }
.pipeline { display: grid; gap: 4px; }
.pipe-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 0; cursor: pointer; font: inherit; color: var(--text); text-align: right; }
.pipe-label { font-size: 13px; }
.pipe-bar { height: 10px; background: var(--beige); border-radius: 99px; overflow: hidden; }
.pipe-bar i { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.pipe-count { text-align: left; font-size: 14px; }
.follow-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); cursor: pointer; text-align: right; }
.follow-row:last-child { border-bottom: 0; }
.follow-main { display: flex; flex-direction: column; gap: 3px; }
.follow-main small { color: var(--muted); font-size: 12px; }
.follow-main small.overdue { color: var(--danger); font-weight: 600; }

/* Badges & chips */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip-btn { flex-shrink: 0; border: 1.5px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 99px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s; }
.chip-btn.active { background: var(--green); border-color: var(--green); color: #F2EFE7; }
.chip-btn[style].active { background: var(--c); border-color: var(--c); color: #fff; }
@media (prefers-color-scheme: dark) { .chip-btn.active:not([style]) { background: #D9B27C; border-color: #D9B27C; color: #15170F; } }

/* Leads */
.search { position: relative; }
.search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 50px; padding: 0 46px 0 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font-size: 16px; outline: none; }
.search input:focus { border-color: var(--gold); }
.lead-list { display: grid; gap: 10px; }
.lead-card { padding: 14px; cursor: pointer; transition: transform .15s; }
.lead-card:active { transform: scale(.99); }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lead-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.lead-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lead-actions, .detail-actions { display: flex; gap: 8px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.round-btn.lg { width: 46px; height: 46px; }
.round-btn.wa { color: #1E9E5A; }
.round-btn.call { color: var(--gold); }
.fab { position: fixed; left: 18px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 15; width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--green); color: #F2EFE7; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(31, 46, 39, .3); cursor: pointer; }
.fab svg { width: 28px; height: 28px; }
@media (prefers-color-scheme: dark) { .fab { background: #D9B27C; color: #15170F; } }

/* Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 12, .45); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; inset: auto 0 0 0; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); max-width: 640px; margin: 0 auto; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; background: var(--card); padding: 6px 0 10px; z-index: 1; }
.sheet-title { margin: 0; font-size: 18px; }
.field select, .field textarea, .inline-form textarea, .inline-form input, .composer textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 16px; outline: none; font-family: inherit; color: var(--text); }
.field select { height: 50px; padding: 0 12px; }
.field textarea, .inline-form textarea, .composer textarea { padding: 12px 14px; resize: vertical; min-height: 80px; }
.field select:focus, .field textarea:focus, .inline-form textarea:focus, .inline-form input:focus, .composer textarea:focus { border-color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-phone { font-size: 18px; font-weight: 700; margin-bottom: 6px; text-align: right; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info { background: var(--beige); border-radius: 12px; padding: 10px 12px; }
.info span { display: block; font-size: 12px; color: var(--muted); }
.info b { font-size: 14px; overflow-wrap: anywhere; }
.notes { background: var(--beige); border-radius: 12px; padding: 12px; margin: 10px 0 0; line-height: 1.8; white-space: pre-wrap; }
.sub { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: stretch; }
.inline-form input { height: 46px; padding: 0 12px; }
.inline-form.col { flex-direction: column; }
.inline-form.col .btn { align-self: flex-start; }
.activities { display: grid; gap: 2px; margin-bottom: 8px; }
.activity { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity:last-child { border-bottom: 0; }
.activity p { margin: 4px 0; line-height: 1.7; white-space: pre-wrap; }
.activity small { color: var(--muted); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--muted); }
.dot.k-call { background: var(--gold); } .dot.k-whatsapp { background: #1E9E5A; } .dot.k-stage { background: #3B6EA5; } .dot.k-note { background: #6C5BA6; } .dot.k-meeting { background: #0F7C86; }

/* Timeline */
.composer { padding: 14px; display: grid; gap: 10px; }
.composer-row { display: flex; gap: 10px; align-items: flex-start; }
.composer .btn { justify-self: start; }
.feed { display: grid; gap: 10px; }
.post { padding: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-who { flex: 1; display: flex; flex-direction: column; }
.post-who small { color: var(--muted); font-size: 12px; }
.post-body { margin: 10px 0 0; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }

/* More */
.team { display: grid; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row b { flex: 1; font-size: 14px; }
.field input:disabled { opacity: .6; }

/* States */
.skeleton { height: 86px; border: 0; box-shadow: none; background: linear-gradient(90deg, var(--line) 25%, var(--beige) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 10px; }
.skeleton.line { height: 16px; border-radius: 8px; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty-icon { font-size: 30px; color: var(--gold); margin-bottom: 6px; }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 14px; line-height: 1.7; }
