/* Paleta emprestada do painel ERP Desktop (src/ui/style.css) — mesma identidade visual da família Da Luz. */
:root {
  --bg: #0f1117; --bg2: #1a1d27; --bg3: #22263a;
  --accent: #4f8ef7; --accent2: #6c63ff;
  --green: #22c55e; --red: #ef4444; --yellow: #f59e0b; --blue: #4f8ef7;
  --text: #e8eaf6; --text2: #8b92b0; --border: #2e3350;
  --radius: 12px; --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; font-size: 15px; }
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: env(safe-area-inset-top,0) 16px 10px; padding-top: calc(env(safe-area-inset-top,0) + 10px); background: var(--bg2); border-bottom: 1px solid var(--border); }
.topbar-title { display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 16px; }
.empresa { font-size: 12px; color: var(--text2); }
.topbar-user { font-size: 12px; color: var(--text2); }

.content { flex: 1; padding: 14px 16px calc(84px + env(safe-area-inset-bottom,0)); max-width: 640px; margin: 0 auto; width: 100%; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--bg2); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom,0)); }
.tab { flex: 1; background: none; border: none; color: var(--text2); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; }
.tab span { font-size: 20px; }
.tab:active { background: var(--bg3); }
.fila-badge { position: absolute; top: 2px; right: 62px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; }

.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi .card-title { font-size: 12px; color: var(--text2); font-weight: 600; }
.card-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.card-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-yellow { color: var(--yellow); } .text-blue { color: var(--blue); }
.text-muted { color: var(--text2); } .fw-bold { font-weight: 700; } .fs-sm { font-size: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.estado-ok { color: var(--green); font-weight: 600; }

.titulo-tela { font-size: 18px; font-weight: 700; margin-bottom: 6px; }

.lista { display: flex; flex-direction: column; gap: 8px; }
.row-click, .row-static { display: flex; justify-content: space-between; align-items: center; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; gap: 10px; }
.row-click { cursor: pointer; } .row-click:active { background: var(--bg3); }
.row-main { flex: 1; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.field label { font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.input, select.input { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 12px; font-size: 15px; width: 100%; }
.input:focus { outline: none; border-color: var(--accent); }

.btn { border: none; border-radius: 10px; padding: 12px 16px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 7px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .6; }

.chips { display: flex; gap: 8px; margin-top: 6px; }
.chip { flex: 1; background: var(--bg3); border: 1px solid var(--border); color: var(--text2); border-radius: 10px; padding: 10px; text-align: center; }
.chip-on { background: var(--accent); color: #fff; border-color: var(--accent); }

.form-erro { color: var(--red); font-size: 13px; min-height: 16px; margin-top: 8px; }
.empty, .loading { text-align: center; color: var(--text2); padding: 40px 10px; }

.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.auth-title { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--text2); font-size: 13px; margin-bottom: 4px; }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom,0)); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-err { border-color: var(--red); } .toast-warn { border-color: var(--yellow); }
