
:root{
  --bg:#EDEFF2; --surface:#FFFFFF; --surface2:#F6F7F9; --ink:#16181B; --muted:#5B626B; --line:#D5D9DF;
  --yellow:#E9FF1F; --on-yellow:#171900; --danger:#C8203A; --danger-bg:#FCE8EB; --ok:#1B7F53; --ok-bg:#E3F5EC;
  --focus:#3A5BFF;
  --font:"Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#111315; --surface:#1A1D20; --surface2:#22262A; --ink:#ECEEF0; --muted:#9BA2AA; --line:#2E3338;
    --danger:#FF6479; --danger-bg:#3A1D23; --ok:#43CE8F; --ok-bg:#16322A; --focus:#8EA2FF; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#111315; --surface:#1A1D20; --surface2:#22262A; --ink:#ECEEF0; --muted:#9BA2AA; --line:#2E3338;
  --danger:#FF6479; --danger-bg:#3A1D23; --ok:#43CE8F; --ok-bg:#16322A; --focus:#8EA2FF; color-scheme:dark;
}
*,*::before,*::after{box-sizing:inherit}
html{height:100%;scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
img{max-width:100%}
.num{font-stretch:72%;font-weight:750;font-variant-numeric:tabular-nums;letter-spacing:-.01em}

/* Layout */
.app{display:grid;grid-template-columns:1fr;min-height:100vh}
.side{display:none}
main{padding:18px 16px 110px;max-width:1200px;width:100%;margin:0 auto}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom,0px)}
.tabs button{flex:1;border:0;background:none;padding:9px 2px 8px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11.5px;color:var(--muted);cursor:pointer;position:relative}
.tabs button svg{width:22px;height:22px}
.tabs button[aria-current="page"]{color:var(--ink);font-weight:650}
.tabs button[aria-current="page"]::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;background:var(--yellow);border-radius:0 0 3px 3px}
.badge{position:absolute;top:4px;left:calc(50% + 6px);min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--danger);color:#fff;font-size:10.5px;font-weight:700;display:grid;place-items:center}
@media (min-width:900px){
  .app{grid-template-columns:232px 1fr}
  .tabs{display:none}
  .side{display:flex;flex-direction:column;position:sticky;top:0;height:100vh;border-right:1px solid var(--line);background:var(--surface);padding:22px 14px}
  .brand{display:flex;align-items:center;gap:10px;padding:0 8px 22px}
  .brand-mark{width:34px;height:34px;border-radius:8px;background:var(--yellow);color:var(--on-yellow);display:grid;place-items:center;font-weight:800;font-stretch:75%;font-size:15px}
  .brand b{display:block;font-size:15px}
  .brand span{font-size:12.5px;color:var(--muted)}
  .side nav button{display:flex;align-items:center;gap:11px;width:100%;border:0;background:none;padding:10px 10px;border-radius:8px;text-align:left;cursor:pointer;color:var(--muted);position:relative}
  .side nav button svg{width:20px;height:20px}
  .side nav button:hover{background:var(--surface2);color:var(--ink)}
  .side nav button[aria-current="page"]{background:var(--surface2);color:var(--ink);font-weight:650}
  .side nav button[aria-current="page"]::before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:4px;border-radius:2px;background:var(--yellow)}
  .side .badge{position:static;margin-left:auto}
  .side-foot{margin-top:auto;font-size:12.5px;color:var(--muted);padding:0 8px}
  main{padding:28px 32px 48px}
}

/* Header */
.head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:18px}
.head h1{margin:0;font-size:clamp(26px,5vw,34px);line-height:1.05;font-weight:780;font-stretch:88%;letter-spacing:-.015em}
.head p{margin:4px 0 0;color:var(--muted)}
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

/* Controls */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);background:var(--surface);padding:8px 13px;border-radius:8px;cursor:pointer;font-weight:600;font-size:14px;white-space:nowrap;text-decoration:none}
.btn:hover{border-color:var(--muted)}
.btn.primary{background:var(--yellow);border-color:var(--yellow);color:var(--on-yellow)}
.btn.primary:hover{filter:brightness(.96)}
.btn.ghost{border-color:transparent;background:none}
.btn.small{padding:5px 9px;font-size:13px}
.btn.danger{color:var(--danger)}
.btn svg{width:16px;height:16px}
.seg{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:3px}
.seg button{border:0;background:none;padding:5px 12px;border-radius:6px;cursor:pointer;font-size:13.5px;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--surface);font-weight:600}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field>span{font-size:13px;color:var(--muted);font-weight:550}
input[type=text],input[type=email],input[type=tel],input[type=number],input[type=date],input[type=search],select,textarea{
  width:100%;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:9px 11px;min-height:40px}
textarea{min-height:80px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--focus);outline-offset:0;border-color:transparent}
.grid2{display:grid;grid-template-columns:1fr;gap:12px}
@media (min-width:560px){.grid2{grid-template-columns:1fr 1fr}}
.full{grid-column:1/-1}
.checks{display:flex;flex-wrap:wrap;gap:6px}
.checks label{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);border-radius:20px;padding:5px 11px;font-size:13.5px;cursor:pointer;background:var(--surface)}
.checks input{accent-color:var(--ink)}
.checks label:has(input:checked){background:var(--ink);color:var(--surface);border-color:var(--ink)}
.quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}

/* Cards/lists */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px}
.section{margin-top:22px}
.section h2{font-size:16px;margin:0 0 8px;font-weight:700;display:flex;align-items:center;gap:8px}
.section h2 .count{font-size:13px;color:var(--muted);font-weight:500}
.list{list-style:none;margin:0;padding:0}
.item{display:flex;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item-main{flex:1;min-width:0;cursor:pointer}
.item-title{font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item-sub{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item-end{display:flex;gap:6px;align-items:center;flex-shrink:0}
.kind{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;background:var(--surface2);flex-shrink:0}
.kind svg{width:17px;height:17px}
.date{font-size:12.5px;font-weight:650;padding:2px 8px;border-radius:12px;background:var(--surface2);white-space:nowrap}
.date.late{background:var(--danger-bg);color:var(--danger)}
.date.today{background:var(--yellow);color:var(--on-yellow)}
.empty{padding:22px 16px;color:var(--muted);text-align:center}
.empty b{display:block;color:var(--ink);margin-bottom:4px}
.pill{font-size:12px;padding:2px 8px;border-radius:12px;border:1px solid var(--line);white-space:nowrap;color:var(--muted)}
.avatar{width:22px;height:22px;border-radius:50%;flex-shrink:0;vertical-align:middle;object-fit:cover}
.who{display:inline-flex;align-items:center;gap:6px}

/* Today hero */
.callsheet{display:grid;grid-template-columns:auto 1fr;gap:0;border-radius:14px;overflow:hidden;background:var(--surface);border:1px solid var(--line)}
.callsheet .big{background:var(--yellow);color:var(--on-yellow);padding:16px 20px;display:flex;flex-direction:column;justify-content:center;min-width:120px}
.callsheet .big .num{font-size:64px;line-height:.9}
.callsheet .big small{font-size:13px;font-weight:600;margin-top:6px}
.callsheet .facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}
.callsheet .fact{padding:14px 16px;border-left:1px solid var(--line)}
.callsheet .fact .num{font-size:30px;line-height:1}
.callsheet .fact small{display:block;font-size:12.5px;color:var(--muted);margin-top:4px}
.fact.late .num{color:var(--danger)}
@media (max-width:520px){.callsheet{grid-template-columns:1fr}.callsheet .big{flex-direction:row;align-items:baseline;gap:12px}.callsheet .fact{border-left:0;border-top:1px solid var(--line)}.callsheet .facts{grid-template-columns:repeat(3,1fr)}.callsheet .fact+.fact{border-left:1px solid var(--line)}}

/* Pipeline */
.pipe-top{display:flex;flex-wrap:wrap;gap:22px;margin-bottom:14px}
.pipe-top div small{display:block;font-size:12.5px;color:var(--muted)}
.pipe-top .num{font-size:30px;line-height:1.05}
.board-wrap{overflow-x:auto;margin:0 -16px;padding:0 16px 8px;-webkit-overflow-scrolling:touch}
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(250px,1fr);gap:10px;min-width:min-content}
.col{background:var(--surface2);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;min-height:200px;min-width:250px}
.col.drop{outline:2px dashed var(--ink);outline-offset:-4px}
.col-head{padding:12px 12px 8px}
.col-head b{display:flex;justify-content:space-between;font-size:14px}
.col-head b span{color:var(--muted);font-weight:500}
.col-head .num{font-size:24px;display:block;margin-top:2px}
.col[data-fase="ganho"] .col-head{border-top:4px solid var(--ok);border-radius:12px 12px 0 0}
.col[data-fase="perdido"] .col-head{border-top:4px solid var(--muted);border-radius:12px 12px 0 0}
.col-body{padding:0 8px 8px;display:flex;flex-direction:column;gap:7px;flex:1}
.card{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:10px 11px;cursor:pointer;display:flex;flex-direction:column;gap:6px}
.card:hover{border-color:var(--muted)}
.card[draggable="true"]{cursor:grab}
.card.dragging{opacity:.4}
.card-t{font-weight:650;line-height:1.25}
.card-c{font-size:13px;color:var(--muted)}
.card-f{display:flex;justify-content:space-between;align-items:center;gap:6px;flex-wrap:wrap}
.card-f .num{font-size:17px}
@media (min-width:900px){.board-wrap{margin:0;padding:0 0 8px}}

/* Table */
.table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
table{border-collapse:collapse;width:100%;min-width:760px}
th,td{padding:11px 12px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}
th{font-size:12.5px;color:var(--muted);font-weight:600;background:var(--surface2)}
th:first-child,td:first-child{text-align:left}
tbody tr:last-child td{border-bottom:0}
tfoot td{font-weight:700;background:var(--surface2);border-top:1px solid var(--line);border-bottom:0}
td .num{font-size:18px}
td.hl{background:color-mix(in srgb,var(--yellow) 30%,transparent)}

/* Sheet */
.overlay{position:fixed;inset:0;z-index:50;background:rgba(10,12,14,.5);display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-width:640px;max-height:92vh;overflow-y:auto;border-radius:16px 16px 0 0;padding:0 0 env(safe-area-inset-bottom,0px)}
@media (min-width:700px){.overlay{align-items:center;padding:20px}.sheet{border-radius:16px;max-height:88vh}}
@media (prefers-reduced-motion:no-preference){.sheet{animation:up .22s ease-out}@keyframes up{from{transform:translateY(24px);opacity:.4}to{transform:none;opacity:1}}}
.sheet-head{position:sticky;top:0;z-index:2;background:var(--bg);display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 18px 12px;border-bottom:1px solid var(--line)}
.sheet-head h3{margin:0;font-size:19px;font-weight:750;font-stretch:90%;line-height:1.2}
.sheet-body{padding:16px 18px 20px}
.sheet-foot{position:sticky;bottom:0;background:var(--bg);display:flex;justify-content:flex-end;gap:8px;padding:12px 18px;border-top:1px solid var(--line)}
.info{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin:4px 0 16px}
.info div small{display:block;font-size:12px;color:var(--muted)}
.info div b{font-weight:600}
.timeline{list-style:none;margin:0;padding:0;border-left:2px solid var(--line);margin-left:6px}
.timeline li{position:relative;padding:0 0 14px 16px}
.timeline li::before{content:"";position:absolute;left:-6px;top:5px;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid var(--muted)}
.timeline li.c::before{background:var(--yellow);border-color:var(--ink)}
.timeline small{color:var(--muted);font-size:12.5px}
.timeline p{margin:2px 0 0;white-space:pre-wrap}
.search-hits{border:1px solid var(--line);border-radius:8px;background:var(--surface);margin-top:6px;overflow:hidden}
.search-hits button{display:flex;align-items:center;gap:8px;width:100%;border:0;border-bottom:1px solid var(--line);background:none;padding:8px 10px;text-align:left;cursor:pointer}
.search-hits button:last-child{border-bottom:0}
.search-hits button:hover{background:var(--surface2)}

.banner{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--yellow);border-radius:10px;padding:10px 14px;margin-bottom:16px;font-size:14px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(82px + env(safe-area-inset-bottom,0px));z-index:70;background:var(--ink);color:var(--surface);padding:10px 16px;border-radius:10px;font-size:14px;max-width:calc(100% - 32px);box-shadow:0 6px 20px rgba(0,0,0,.25)}
@media (min-width:900px){.toast{bottom:24px}}
.fab{position:fixed;right:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:15;box-shadow:0 6px 18px rgba(0,0,0,.2);padding:12px 16px;border-radius:12px}
@media (min-width:900px){.fab{display:none}}
.hide-m{display:none}
@media (min-width:900px){.hide-m{display:inline-flex}}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.loading{padding:60px 0;text-align:center;color:var(--muted)}

/* Login */
.login{min-height:100vh;display:grid;place-items:center;padding:24px 16px}
.login-box{width:100%;max-width:400px}
.login-mark{display:inline-grid;place-items:center;background:var(--yellow);color:var(--on-yellow);font-weight:800;font-stretch:72%;font-size:44px;line-height:1;padding:14px 16px 10px;border-radius:12px;margin-bottom:18px}
.login h1{margin:0 0 4px;font-size:28px;font-weight:780;font-stretch:88%}
.login p{margin:0 0 20px;color:var(--muted)}
.login form{display:flex;flex-direction:column;gap:12px}
.login .btn{padding:12px}
.err{background:var(--danger-bg);color:var(--danger);border-radius:8px;padding:9px 12px;font-size:14px}
.acct{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:20px;padding:4px 12px 4px 4px;cursor:pointer;font-size:13.5px}
.initials{width:26px;height:26px;border-radius:50%;background:var(--ink);color:var(--surface);display:grid;place-items:center;font-size:11.5px;font-weight:700}
.prop-v{font-stretch:72%;font-weight:750;font-size:15px;background:var(--surface2);border-radius:6px;padding:3px 7px}
.pill.pdf{border-color:var(--ink);color:var(--ink);font-weight:600}
.file-drop{border:1.5px dashed var(--line);border-radius:10px;padding:16px;text-align:center;background:var(--surface);cursor:pointer}
.file-drop.has{border-style:solid;border-color:var(--ink)}
.file-drop input{position:absolute;width:1px;height:1px;opacity:0}
.checkline{display:flex;gap:8px;align-items:flex-start;font-size:14px}
.checkline input{margin-top:3px;accent-color:var(--ink);width:16px;height:16px}
.side-foot .acct{margin-top:10px}
@media (min-width:900px){.hide-d{display:none}}
[hidden]{display:none!important}

/* Temperatura dos clientes */
:root{--hot:#D7263D;--hot-bg:#FDE7EA;--warm:#B86A00;--warm-bg:#FFF1DB;--cold:#3F6FB5;--cold-bg:#E6EEF9}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--hot:#FF6B7E;--hot-bg:#3C1C22;--warm:#F5A83B;--warm-bg:#3A2A12;--cold:#8CB3F0;--cold-bg:#1B2A40}}
:root[data-theme="dark"]{--hot:#FF6B7E;--hot-bg:#3C1C22;--warm:#F5A83B;--warm-bg:#3A2A12;--cold:#8CB3F0;--cold-bg:#1B2A40}
.temp{display:inline-block;font-size:11.5px;font-weight:700;padding:2px 8px;border-radius:10px;vertical-align:1px;letter-spacing:.01em}
.temp.hot{background:var(--hot-bg);color:var(--hot)}
.temp.warm{background:var(--warm-bg);color:var(--warm)}
.temp.cold{background:var(--cold-bg);color:var(--cold)}
.temp-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.temp-dot.hot{background:var(--hot)}.temp-dot.warm{background:var(--warm)}.temp-dot.cold{background:var(--cold)}
.kind.hot{background:var(--hot-bg);color:var(--hot)}.kind.warm{background:var(--warm-bg);color:var(--warm)}
.checks label:has(input:checked) .temp-dot{outline:2px solid var(--surface)}
.seg{flex-wrap:wrap}
details>summary{list-style-position:inside}
.banner.warn{border-left-color:var(--warm);background:var(--warm-bg);color:var(--ink)}
.banner.warn b{color:var(--ink)}
