/* styles.css — Rota de Campo v2 (30/09/2026): visual estilo app */
:root{
  --bg:#F1F4F0; --surface:#FFFFFF; --surface-2:#E8EDE8; --ink:#15201A; --ink-muted:#5C6A62; --border:#DCE3DD;
  --brand:#1D6B48; --brand-600:#155338; --brand-soft:#DFEFE5; --on-brand:#FFFFFF;
  --danger:#C0392B; --danger-soft:#FBE7E4; --ok:#1F8A4C; --ok-soft:#DFF2E6; --warn:#9A6200; --warn-soft:#FFF0CF;
  --cat-combustivel:#E08A1E; --cat-alimentacao:#2E9E6B; --cat-hotel:#5B6FD6; --cat-geral:#7A8791;
  --r:20px; --r-sm:14px; --shadow:0 1px 2px rgba(16,32,24,.05),0 12px 30px rgba(16,32,24,.08);
  --tabbar-h:66px; --sab:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0E1411; --surface:#18211C; --surface-2:#222D27; --ink:#EAF0EB; --ink-muted:#9DAAA2; --border:#2A362F;
    --brand:#3FA774; --brand-600:#5FBB8B; --brand-soft:#173325; --on-brand:#08150E;
    --danger:#E5796D; --danger-soft:#3A1E1B; --ok:#5FBB8B; --ok-soft:#173325; --warn:#E8B04C; --warn-soft:#38290C;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 30px rgba(0,0,0,.35);
  }
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
[hidden]{display:none!important}
html,body{margin:0; background:var(--bg); color:var(--ink); font-family:'IBM Plex Sans',system-ui,-apple-system,Segoe UI,Roboto,sans-serif; font-size:15px; line-height:1.4}
body{min-height:100vh; -webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:'Archivo','IBM Plex Sans',sans-serif; margin:0; letter-spacing:-.01em}
button{font:inherit; color:inherit; cursor:pointer}
input,select,textarea{font:inherit; color:var(--ink)}
svg{display:block; width:1.25em; height:1.25em; flex:none}
.num{font-family:'IBM Plex Mono',ui-monospace,monospace; font-variant-numeric:tabular-nums}
.muted{color:var(--ink-muted)} .small{font-size:12.5px}
.app{max-width:560px; margin:0 auto; min-height:100vh; padding-bottom:calc(var(--tabbar-h) + var(--sab) + 28px)}

/* topo */
.topbar{position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px; background:color-mix(in srgb,var(--bg) 88%,transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px)}
.brand{display:flex; align-items:center; gap:10px}
.brand-mark{width:38px; height:38px; border-radius:12px; background:var(--brand); color:var(--on-brand); display:grid; place-items:center}
.brand-mark svg{width:20px; height:20px}
.brand h1{font-size:16px; font-weight:800} .brand .sub{font-size:11.5px; color:var(--ink-muted)}
.who{display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:4px 12px 4px 4px; font-size:13px; font-weight:600}
.avatar{width:30px; height:30px; border-radius:99px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center; font-size:12px; font-weight:800}
.role-pill{font-size:10px; font-weight:700; padding:2px 7px; border-radius:99px; background:var(--surface-2); color:var(--ink-muted); text-transform:uppercase; letter-spacing:.04em}
.role-pill.master{background:var(--brand-soft); color:var(--brand)}
.offline-bar{display:none; background:var(--warn-soft); color:var(--warn); text-align:center; font-size:12.5px; font-weight:600; padding:7px 12px}
.offline-bar.show{display:block}

/* telas */
.screen{padding:4px 16px 8px; display:flex; flex-direction:column; gap:14px; animation:fade .18s ease}
@keyframes fade{from{opacity:0; transform:translateY(4px)}to{opacity:1; transform:none}}
.screen-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:4px}
.screen-head h2{font-size:22px; font-weight:800}
.card{background:var(--surface); border-radius:var(--r); box-shadow:var(--shadow); padding:16px}
.card h3{font-size:14.5px; font-weight:700; margin-bottom:10px}
.stack{display:flex; flex-direction:column; gap:14px}
.row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.filter{background:var(--surface); border:1px solid var(--border); border-radius:99px; padding:8px 12px; font-size:13px; max-width:55%}

/* hero */
.hero{position:relative; overflow:hidden; border-radius:24px; padding:20px 20px 18px; color:#fff; background:linear-gradient(135deg,#1D6B48 0%,#2C8A5E 55%,#3AA173 100%); box-shadow:var(--shadow)}
.hero::after{content:''; position:absolute; right:-40px; top:-40px; width:170px; height:170px; border-radius:50%; background:rgba(255,255,255,.09)}
.hero .lbl{font-size:12.5px; opacity:.9; font-weight:500; color:#fff} .hero .big{font-family:'Archivo',sans-serif; font-size:34px; font-weight:800; letter-spacing:-.02em; margin:2px 0 12px}
.hero .mini{display:flex; gap:10px}
.hero .mini div{flex:1; background:rgba(255,255,255,.14); border-radius:14px; padding:9px 12px; font-size:12px}
.hero .mini b{display:block; font-size:15px; font-family:'IBM Plex Mono',monospace; margin-top:1px}
.hero .rota{margin-top:12px; font-size:12.5px; opacity:.92; display:flex; align-items:center; gap:7px}
.hero .rota svg{width:15px; height:15px}

/* atalhos / categorias */
.tiles{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.tile{position:relative; border:0; text-align:left; background:var(--surface); border-radius:var(--r); box-shadow:var(--shadow); padding:16px; display:flex; flex-direction:column; gap:12px; min-height:112px; transition:transform .12s}
.tile:active{transform:scale(.97)}
.tile .ico{width:46px; height:46px; border-radius:15px; display:grid; place-items:center; color:#fff}
.tile .ico svg{width:24px; height:24px}
.tile b{font-size:15px; font-family:'Archivo',sans-serif; font-weight:700}
.tile span.d{font-size:12px; color:var(--ink-muted); margin-top:-8px}

/* semana */
.week-strip{display:flex; align-items:center; justify-content:space-between; gap:8px}
.week-nav{display:flex; gap:6px; width:64px}
.week-nav button,.icon-btn{width:34px; height:34px; border-radius:11px; border:1px solid var(--border); background:var(--surface); display:grid; place-items:center}
.status-open{color:var(--warn); font-weight:600} .status-closed{color:var(--ok); font-weight:600}

/* kpis */
.kpis{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.kpi{background:var(--surface); border-radius:var(--r); box-shadow:var(--shadow); padding:14px}
.kpi .label{font-size:12px; color:var(--ink-muted)} .kpi .value{font-size:20px; font-weight:700; margin-top:3px}
.kpi.accent{background:var(--brand); color:var(--on-brand)} .kpi.accent .label{color:inherit; opacity:.85}
.kpi.warn{background:var(--warn-soft)} .kpi .delta{font-size:11.5px; margin-top:3px; opacity:.85}

/* barras */
.bar-row{display:flex; align-items:center; gap:10px; padding:6px 0}
.bar-label{width:112px; font-size:12.5px; color:var(--ink-muted)}
.bar-track{flex:1; height:9px; border-radius:99px; background:var(--surface-2); overflow:hidden}
.bar-fill{height:100%; border-radius:99px}
.bar-val{min-width:84px; text-align:right; font-size:12.5px}

/* lista de despesas */
.list{display:flex; flex-direction:column}
.item{display:flex; align-items:center; gap:12px; padding:12px 4px; border:0; background:transparent; width:100%; text-align:left; border-bottom:1px solid var(--border)}
.item:last-child{border-bottom:0}
.item:active{background:var(--surface-2); border-radius:12px}
.item .ico{width:42px; height:42px; border-radius:14px; display:grid; place-items:center; color:#fff; flex:none; overflow:hidden}
.item .ico svg{width:21px; height:21px} .item .ico img{width:100%; height:100%; object-fit:cover}
.item .info{flex:1; min-width:0} .item .t{font-weight:600; font-size:14.5px}
.item .m{font-size:12px; color:var(--ink-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item .v{font-weight:700; font-size:14px; text-align:right}
.tags{display:flex; gap:5px; flex-wrap:wrap; margin-top:4px}
.tag{font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:99px; background:var(--surface-2); color:var(--ink-muted)}
.tag.ok{background:var(--ok-soft); color:var(--ok)} .tag.warn{background:var(--warn-soft); color:var(--warn)} .tag.pending{background:var(--warn-soft); color:var(--warn)} .tag.lock{background:var(--surface-2); color:var(--ink)}
.day-h{font-size:12px; font-weight:700; color:var(--ink-muted); text-transform:uppercase; letter-spacing:.05em; padding:12px 4px 2px; display:flex; justify-content:space-between}
.empty{text-align:center; color:var(--ink-muted); padding:22px 10px; font-size:13.5px}

/* formulário */
.field{display:flex; flex-direction:column; gap:6px}
.field>label,.lbl{font-size:12.5px; font-weight:600; color:var(--ink-muted)}
input[type=text],input[type=number],input[type=date],select,textarea{width:100%; background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r-sm); padding:0 14px; height:48px; font-size:16px; outline:0; transition:border-color .15s}
textarea{height:auto; min-height:76px; padding:12px 14px; resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--brand)}
.money{position:relative}
.money span{position:absolute; left:16px; top:50%; transform:translateY(-50%); font-weight:700; color:var(--ink-muted)}
.money input{padding-left:46px; font-size:24px; font-weight:700; height:60px; font-family:'Archivo',sans-serif}
.hint{font-size:12px; color:var(--ink-muted)}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{border:1.5px solid var(--border); background:var(--surface); border-radius:99px; padding:9px 15px; font-size:13.5px; font-weight:600}
.chip.active{background:var(--brand); border-color:var(--brand); color:var(--on-brand)}
.seg{display:grid; grid-auto-flow:column; grid-auto-columns:1fr; background:var(--surface-2); border-radius:var(--r-sm); padding:4px; gap:4px}
.seg button{border:0; background:transparent; border-radius:11px; padding:10px 6px; font-size:13px; font-weight:600; color:var(--ink-muted)}
.seg button.active{background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.12)}
.switch{display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--surface-2); border-radius:var(--r-sm); padding:12px 14px; border:0; width:100%; text-align:left}
.switch .tx b{display:block; font-size:14px} .switch .tx span{font-size:12px; color:var(--ink-muted)}
.knob{width:46px; height:28px; border-radius:99px; background:#B9C3BC; position:relative; flex:none; transition:background .15s}
.knob::after{content:''; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; transition:transform .15s; box-shadow:0 1px 3px rgba(0,0,0,.3)}
.switch.on .knob{background:var(--brand)} .switch.on .knob::after{transform:translateX(18px)}
.section-t{font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--brand); margin-top:4px}
.cat-banner{display:flex; align-items:center; gap:12px}
.cat-banner .ico{width:44px; height:44px; border-radius:14px; display:grid; place-items:center; color:#fff}
.cat-banner b{font-family:'Archivo',sans-serif; font-size:17px}
.posto-card{display:flex; gap:10px; align-items:center; background:var(--brand-soft); border-radius:var(--r-sm); padding:10px 12px; margin-top:8px}
.posto-card b{font-size:13px} .posto-card .c{font-size:11.5px; color:var(--ink-muted)}

/* foto / QR */
.photo-box{display:flex; gap:12px; align-items:center; border:2px dashed var(--border); border-radius:var(--r-sm); padding:12px; background:var(--surface); cursor:pointer}
.photo-box .pi{width:52px; height:52px; border-radius:14px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center; flex:none; overflow:hidden}
.photo-box .pi svg{width:26px; height:26px} .photo-box .pi img{width:100%; height:100%; object-fit:cover}
.photo-box .pt{font-size:12.5px; color:var(--ink-muted)} .photo-box .pt b{display:block; color:var(--ink); font-size:14px}
.photo-box.has{border-style:solid; border-color:var(--ok)}
input[type=file]{display:none}
.scan-status{font-size:12.5px; font-weight:600; padding:8px 12px; border-radius:11px; margin-top:8px; display:flex; gap:7px; align-items:center}
.scan-status svg{width:16px; height:16px}
.scan-status.ok{background:var(--ok-soft); color:var(--ok)} .scan-status.fail{background:var(--warn-soft); color:var(--warn)} .scan-status.pending{background:var(--surface-2); color:var(--ink-muted)}

/* botões */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 22px; border-radius:99px; border:0; background:var(--brand); color:var(--on-brand); font-weight:700; font-size:14.5px}
.btn svg{width:18px; height:18px}
.btn:active{transform:scale(.97)} .btn[disabled]{opacity:.55}
.btn.ghost{background:transparent; color:var(--ink); border:1.5px solid var(--border)}
.btn.soft{background:var(--brand-soft); color:var(--brand)}
.btn.danger{background:var(--danger-soft); color:var(--danger)}
.btn.sm{height:36px; padding:0 14px; font-size:13px}
.btn.block{width:100%}
.actionbar{position:sticky; bottom:calc(var(--tabbar-h) + var(--sab) + 12px); z-index:10; display:flex; gap:10px; justify-content:flex-end; padding:10px; background:color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter:blur(10px); border-radius:99px; box-shadow:var(--shadow); border:1px solid var(--border)}
.actionbar .btn{flex:0 0 auto}
.sheet .actionbar{position:sticky; bottom:0; border-radius:var(--r); margin-top:6px}

/* nav inferior */
.tabbar{position:fixed; left:0; right:0; bottom:0; z-index:30; padding:0 12px calc(8px + var(--sab)); pointer-events:none}
.tabbar-inner{pointer-events:auto; max-width:536px; margin:0 auto; height:var(--tabbar-h); background:var(--surface); border-radius:26px; box-shadow:0 2px 6px rgba(0,0,0,.08),0 14px 34px rgba(0,0,0,.16); display:flex; align-items:center; justify-content:space-around; padding:0 6px}
.tab-btn{flex:1; border:0; background:transparent; display:flex; flex-direction:column; align-items:center; gap:3px; font-size:10px; font-weight:600; color:var(--ink-muted); padding:8px 1px; border-radius:18px}
.tab-btn svg{width:23px; height:23px}
.tab-btn.active{color:var(--brand)} .tab-btn.active svg{transform:translateY(-1px)}
.tab-btn.active span{font-weight:800}
.tab-btn.fab{flex:0 0 66px; margin-top:-26px}
.tab-btn.fab .fab-c{width:56px; height:56px; border-radius:50%; background:var(--brand); color:var(--on-brand); display:grid; place-items:center; box-shadow:0 6px 14px rgba(0,0,0,.22); border:4px solid var(--bg)}
.tab-btn.fab svg{width:26px; height:26px}

/* sheet / modal */
.backdrop{position:fixed; inset:0; z-index:50; background:rgba(8,14,10,.5); display:flex; align-items:flex-end; justify-content:center; animation:fade .15s}
.sheet{background:var(--bg); width:100%; max-width:560px; max-height:93vh; overflow:auto; border-radius:26px 26px 0 0; padding:8px 16px calc(18px + var(--sab)); animation:up .22s ease}
@keyframes up{from{transform:translateY(40px); opacity:.4}to{transform:none; opacity:1}}
.grab{width:42px; height:5px; border-radius:99px; background:var(--border); margin:4px auto 12px}
.sheet-h{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px}
.sheet-h h2{font-size:19px}
.kv{display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); font-size:14px}
.kv:last-child{border-bottom:0} .kv span:first-child{color:var(--ink-muted)} .kv span:last-child{text-align:right; font-weight:600; word-break:break-word}
.big-photo{width:100%; max-height:260px; object-fit:cover; border-radius:var(--r-sm); border:1px solid var(--border)}
.notice{display:flex; gap:10px; align-items:flex-start; border-radius:var(--r-sm); padding:11px 13px; font-size:13px; background:var(--surface-2)}
.notice svg{margin-top:1px; width:18px; height:18px}
.notice.warn{background:var(--warn-soft); color:var(--warn)} .notice.ok{background:var(--ok-soft); color:var(--ok)} .notice.danger{background:var(--danger-soft); color:var(--danger)}

/* scanner */
.scanner{position:fixed; inset:0; z-index:80; background:#000; display:flex; flex-direction:column}
.scanner video{flex:1; width:100%; object-fit:cover; min-height:0}
.scanner .frame{position:absolute; left:50%; top:42%; width:min(72vw,300px); aspect-ratio:1; transform:translate(-50%,-50%); border:3px solid #fff; border-radius:24px; box-shadow:0 0 0 100vmax rgba(0,0,0,.45)}
.scanner .tip{position:absolute; top:calc(20px + env(safe-area-inset-top,0px)); left:0; right:0; text-align:center; color:#fff; font-weight:600; font-size:14px; padding:0 20px}
.scanner .bar{padding:14px 16px calc(16px + var(--sab)); display:flex; gap:10px; justify-content:center; background:#000}

/* consumo */
.media-big{font-family:'Archivo',sans-serif; font-size:38px; font-weight:800; color:var(--brand); letter-spacing:-.02em}
.media-big small{font-size:15px; color:var(--ink-muted); font-weight:600}
.trecho{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); font-size:13.5px}
.trecho:last-child{border-bottom:0}
.trecho .r{text-align:right; font-weight:700}

/* login */
.login-wrap{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px}
.login-card{width:100%; max-width:380px; background:var(--surface); border-radius:28px; box-shadow:var(--shadow); padding:26px 22px}
.user-pick{display:flex; align-items:center; gap:12px; padding:12px; border:1.5px solid var(--border); border-radius:var(--r-sm); margin-bottom:9px; cursor:pointer; background:var(--surface)}
.user-pick:active{background:var(--surface-2)}
.role-choice{display:flex; gap:12px; align-items:center; padding:12px; border:1.5px solid var(--border); border-radius:var(--r-sm); cursor:pointer}
.role-choice.active{border-color:var(--brand); background:var(--brand-soft)}
.role-choice .ico{width:38px; height:38px; border-radius:12px; background:var(--surface-2); display:grid; place-items:center; flex:none}
.role-choice .rt{font-weight:700; font-size:14px} .role-choice .rd{font-size:12px; color:var(--ink-muted)}
.pin-dots{display:flex; gap:14px; justify-content:center; margin:16px 0 8px}
.pin-dot{width:14px; height:14px; border-radius:50%; border:2px solid var(--border)} .pin-dot.filled{background:var(--brand); border-color:var(--brand)}
.keypad{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:8px}
.keypad button{height:58px; border-radius:18px; border:1px solid var(--border); background:var(--surface); font-size:21px; font-weight:600; display:grid; place-items:center}
.keypad button:active{background:var(--surface-2)}

.toast{position:fixed; left:50%; bottom:calc(var(--tabbar-h) + var(--sab) + 26px); transform:translate(-50%,20px); background:#1c2a22; color:#fff; padding:11px 18px; border-radius:99px; font-size:13.5px; font-weight:600; opacity:0; pointer-events:none; transition:.2s; z-index:90; max-width:90vw; text-align:center}
.toast.show{opacity:1; transform:translate(-50%,0)}
.week-nav button[disabled]{opacity:.35}
