/* Levaí Admin: mesmo tema do app (amarelo, preto e creme). */
:root {
  --yellow: #FFD400; --yellow-soft: #FFF4CC; --black: #000; --dark1: #1A1A1A; --dark2: #2A2A2A; --dark-muted: #A6A6A6;
  --cream: #FFFBEA; --line: #F1E9C8; --white: #FFF; --gray: #5E5E5E; --gray-soft: #EEEEEE;
  --green: #06C167; --green-text: #04844A; --green-soft: #E6F9EF; --red: #E11900; --red-text: #B71C1C; --red-soft: #FDECEA;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--black); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.boot { padding: 40px; color: var(--gray); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estrutura */
.layout { min-height: 100vh; display: flex; }
.side { width: 248px; flex: none; background: var(--black); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--yellow); display: grid; place-items: center; flex: none; }
.brand-name { font-size: 20px; font-weight: 800; color: var(--yellow); letter-spacing: -0.4px; }
.brand-sub { font-size: 12px; color: var(--dark-muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; border: 0; border-radius: 12px; padding: 0 14px; font-size: 15px; font-weight: 600; background: transparent; color: var(--white); text-align: left; }
.nav button:hover { background: var(--dark1); }
.nav button[aria-current="page"] { background: var(--yellow); color: var(--black); }
.nav svg { flex: none; }
.nav .badge { margin-left: auto; }
.me { margin-top: auto; background: var(--dark1); border-radius: 12px; padding: 12px 14px; color: var(--white); }
.me small { display: block; color: var(--dark-muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.me button { margin-top: 8px; background: var(--dark2); color: var(--white); border: 0; border-radius: 10px; min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; width: 100%; }
.main { flex: 1; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; max-width: 1400px; }

/* Peças */
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--gray); letter-spacing: .02em; }
.muted { color: var(--gray); font-size: 13px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.head > :first-child { flex: 1 1 260px; }
.card { background: var(--white); border-radius: 16px; padding: 18px; min-width: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 14px; }
.cols > .wide { flex: 2 1 440px; }
.cols > .narrow { flex: 1 1 300px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin-top: 6px; }
.kpi-note { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--gray); }
.up { color: var(--green-text); } .down { color: var(--red-text); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.yellow { background: var(--yellow-soft); } .pill.black { background: var(--black); color: var(--yellow); }
.pill.green { background: var(--green-soft); color: var(--green-text); } .pill.red { background: var(--red-soft); color: var(--red-text); }
.pill.gray { background: var(--gray-soft); color: #3D3D3D; }
.badge { background: var(--yellow); color: var(--black); font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.live { background: var(--black); color: var(--yellow); font-size: 13px; padding: 8px 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.btn { border: 0; border-radius: 12px; padding: 0 16px; min-height: 44px; font-size: 14px; font-weight: 700; background: var(--black); color: var(--yellow); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.yellow { background: var(--yellow); color: var(--black); } .btn.soft { background: var(--yellow-soft); color: var(--black); }
.btn.gray { background: var(--gray-soft); color: var(--black); } .btn.danger { background: var(--red-soft); color: var(--red-text); }
.btn.small { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--black); color: var(--yellow); font-size: 13px; font-weight: 800; display: grid; place-items: center; flex: none; }
.avatar.alert { background: var(--red); color: var(--white); }
.avatar.big { width: 46px; height: 46px; font-size: 15px; }
.empty { padding: 28px 8px; text-align: center; color: var(--gray); font-size: 14px; }
.alert { background: var(--yellow); border-radius: 16px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.alert-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--black); display: grid; place-items: center; flex: none; }
.alert .grow { flex: 1 1 220px; }
.alert strong { display: block; font-size: 16px; }
.alert span { font-size: 13px; color: #3D3D3D; }
.map { position: relative; height: 340px; border-radius: 12px; overflow: hidden; background: #ECEAE6; }
.map .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gray); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
.marker-moto { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--black); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.marker-moto.free { border-color: var(--white); }
.marker-wait { width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 3px solid var(--white); box-shadow: 0 0 0 6px rgba(225,25,0,.25); }
.feed .row { align-items: flex-start; }
.feed .text { font-size: 14px; font-weight: 600; white-space: normal; }
.bars { flex: 1; min-height: 170px; display: flex; align-items: flex-end; gap: 6px; margin-top: 16px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar i { display: block; width: 100%; border-radius: 6px; background: var(--yellow); min-height: 3px; }
.bar i.top { background: var(--black); } .bar i.now { background: var(--line); }
.bar b { font-size: 11px; } .bar small { font-size: 11px; color: var(--gray); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; font-weight: 600; border-radius: 999px; padding: 0 14px; min-height: 36px; border: 1px solid var(--line); background: var(--white); }
.chip[aria-pressed="true"] { background: var(--black); color: var(--white); border-color: var(--black); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gray); cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--black); }
.search { display: flex; align-items: center; gap: 8px; background: var(--white); border-radius: 12px; padding: 0 14px; min-height: 44px; flex: 0 1 320px; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; font-size: 14px; }
.table-box { padding: 6px 6px 0; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--gray); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--cream); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--cream); border-radius: 12px; padding: 10px; }
.stats3 b { display: block; font-size: 17px; font-weight: 800; }
.stats3 span { font-size: 12px; color: var(--gray); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions > * { flex: 1 1 auto; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: 14px; }
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.doc { min-height: 110px; border-radius: 12px; border: 0; background: var(--gray-soft); color: var(--gray); font-weight: 600; font-size: 14px; display: grid; place-items: center; text-align: center; padding: 10px; }
.cash-hero { background: var(--yellow); border-radius: 16px; padding: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.cash-hero .big { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.cash-hero .part b { display: block; font-size: 20px; font-weight: 800; }
.cash-hero .part span, .cash-hero .total span { font-size: 13px; font-weight: 600; }
.cash-hero .levai { background: var(--black); color: var(--yellow); border-radius: 12px; padding: 10px 14px; }
.day-pick { display: flex; align-items: center; gap: 8px; }
.day-pick input { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; background: var(--white); }
.error-box { background: var(--red-soft); color: var(--red-text); border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--black); }
.login form { width: 100%; max-width: 380px; background: var(--white); border-radius: 20px; overflow: hidden; }
.login .top { background: var(--yellow); padding: 22px 22px 18px; }
.login .body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); padding: 12px 14px; font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; }

/* Aviso no topo (igual ao app) */
.toast { position: fixed; z-index: 60; top: 14px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); background: var(--yellow); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toast-in .25s ease-out; }
.toast[hidden] { display: none; }
.toast .ico { width: 34px; height: 34px; border-radius: 50%; background: var(--black); display: grid; place-items: center; flex: none; }
.toast strong { display: block; font-size: 15px; } .toast span { font-size: 13px; color: rgba(0,0,0,.72); }
.toast .grow { flex: 1; min-width: 0; }
.toast button { border: 0; background: transparent; width: 32px; height: 32px; }
@keyframes toast-in { from { transform: translate(-50%, -20px); opacity: 0; } }

/* Folha de baixo (perguntas e detalhes) */
.sheet-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-overlay[hidden] { display: none; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--cream); border-radius: 20px 20px 0 0; animation: sheet-in .25s ease-out; }
.sheet .top { background: var(--yellow); padding: 10px 18px 18px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.25); margin: 0 auto 14px; }
.sheet .body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sheet .buttons { display: flex; flex-direction: column; gap: 8px; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 900px) { .sheet-overlay { align-items: center; } .sheet { border-radius: 20px; } }

/* Celular: menu vira barra no topo com abas que rolam */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: auto; height: auto; position: sticky; top: 0; z-index: 10; padding: 10px 12px; gap: 10px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: 0; } .brand-mark { width: 32px; height: 32px; } .brand-name { font-size: 18px; } .brand-sub { display: none; }
  .nav { order: 3; flex-direction: row; overflow-x: auto; width: 100%; gap: 6px; scrollbar-width: none; }
  .nav button { width: auto; min-height: 38px; font-size: 14px; padding: 0 12px; white-space: nowrap; }
  .nav svg { display: none; }
  .me { margin: 0 0 0 auto; padding: 0; background: transparent; }
  .me strong, .me small { display: none; }
  .me button { margin: 0 0 0 6px; width: auto; }
  .main { padding: 16px; gap: 16px; }
  h1 { font-size: 24px; }
  .map { height: 260px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis .card { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .cash-hero .big { font-size: 32px; }
}

/* Bonecos dos motoboys no mapa (mesmo desenho do app) */
.boneco { position: relative; display: grid; justify-items: center; pointer-events: auto; cursor: pointer; }
.boneco .figure { line-height: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.boneco .tag { margin-top: -2px; background: var(--black); color: var(--white); font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 9px; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.boneco.calling .figure { animation: boneco-blink .8s ease-in-out infinite; }
.boneco .wave { position: absolute; left: 50%; top: 22px; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--yellow); animation: boneco-wave 1.2s ease-out infinite; z-index: -1; }
.boneco .wave.late { animation-delay: .6s; }
.boneco .bubble { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -2px); background: var(--black); color: var(--yellow); font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 11px; white-space: nowrap; }
@keyframes boneco-blink { 50% { opacity: .25; } }
@keyframes boneco-wave { from { transform: scale(.5); opacity: .6; } to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .boneco.calling .figure, .boneco .wave { animation: none; } }

/* Aba Mapa: o mapa usa a altura toda da tela */
.map-head { margin-bottom: 12px; }
.map-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.map.map-page { height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 420px; }
.map-expand { position: fixed; right: 28px; bottom: 28px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 24px; border: 0; background: var(--black); color: var(--yellow); font: inherit; font-weight: 800; font-size: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; }
.map-expand svg { width: 20px; height: 20px; }
body.map-expanded .side, body.map-expanded .map-head { display: none !important; }
body.map-expanded .main { padding: 0 !important; max-width: none !important; }
body.map-expanded .map.map-page { position: fixed; inset: 0; height: auto; min-height: 0; border-radius: 0; z-index: 20; }
@media (max-width: 760px) { .map.map-page { height: calc(100dvh - 210px); } .map-expand { right: 16px; bottom: 16px; } }
