:root { --bg:#f5efe6; --ink:#1e1915; --muted:#73675e; --card:#fff; --line:#e8ded2; --accent:#1e1915; --accent-soft:#ede4d8; --ok:#15803d; --ok-bg:#dcfce7; --warn:#b91c1c; --warn-bg:#fee2e2; --buy:#92400e; --buy-bg:#fef3c7; }
* { box-sizing: border-box; }
body { margin:0; color:var(--ink); font:15px/1.45 Outfit,system-ui,sans-serif; background:var(--bg); min-height:100dvh; -webkit-font-smoothing:antialiased; }
.wrap { max-width:440px; margin:0 auto; padding:16px 16px calc(110px + env(safe-area-inset-bottom)); }
h1 { font-family:Outfit,system-ui,sans-serif; font-size:1.55rem; font-weight:700; letter-spacing:-.02em; margin:0 0 10px; }
p { margin:.3rem 0; }
.muted { color:var(--muted); font-size:.88rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:16px; margin:12px 0; box-shadow:0 4px 14px rgba(30,25,21,.04); }
.badge { display:inline-block; font-size:.65rem; letter-spacing:.05em; text-transform:uppercase; font-weight:700; padding:3px 7px; border-radius:6px; background:var(--accent-soft); color:var(--ink); }
.badge.venta { background:var(--ok-bg); color:var(--ok); }
.badge.gasto { background:var(--warn-bg); color:var(--warn); }
.badge.fiado { background:var(--accent-soft); color:#5c4e42; }
.badge.compra { background:var(--buy-bg); color:var(--buy); }
.badge.cierre { background:var(--ok-bg); color:var(--ok); }
button,input,select { font:inherit; }
input,select { width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--line); background:#faf8f5; margin:6px 0; outline:none; }
input:focus,select:focus { border-color:var(--accent); background:#fff; }
button { border:0; border-radius:12px; padding:13px; background:var(--accent); color:#fff; font-weight:650; width:100%; }
button:active { transform:scale(.985); }
button.ghost { background:var(--accent-soft); color:var(--ink); }
button.ok { background:var(--ok); }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.kpi { font-family:Outfit,system-ui,sans-serif; font-size:1.6rem; font-weight:700; }
.kpi.in { color:var(--ok); }
.kpi.out { color:var(--warn); }
.item { display:flex; justify-content:space-between; gap:10px; padding:12px 0; border-bottom:1px solid var(--line); }
.item:last-child { border-bottom:0; }
.tag { font-size:.68rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); font-weight:700; }
.actions { display:flex; gap:16px; justify-content:flex-end; margin-top:8px; }
.actions.wrap { flex-wrap:wrap; gap:0 4px; justify-content:flex-start; width:100%; margin-top:4px; }
.link { background:none; color:var(--warn); padding:8px 12px; width:auto; font-size:.82rem; min-height:40px; }
.link.okish { color:var(--ok); }
.good { color:var(--ok); }
.bad { color:var(--warn); }
.spin { width:22px; height:22px; border:3px solid #e8ddd0; border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; display:inline-block; vertical-align:middle; margin-right:8px; }
@keyframes spin { to { transform: rotate(360deg); } }
#sheet { position:fixed; inset:0; z-index:40; }
.sheet-bg { position:absolute; inset:0; background:rgba(28,23,20,.4); }
.sheet-card { position:absolute; left:50%; bottom:0; transform:translateX(-50%); width:min(430px,100%); background:var(--card); border-radius:20px 20px 0 0; padding:18px 16px calc(20px + env(safe-area-inset-bottom)); }
.hide { display:none !important; }
.menu-btn { display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left; background:var(--card); color:var(--ink); border:1px solid var(--line); margin:0; border-radius:0; padding:16px; }
.menu { overflow:hidden; padding:0; }
.menu-btn + .menu-btn { border-top:0; }
.menu-btn:first-child { border-radius:18px 18px 0 0; }
.menu-btn:last-child { border-radius:0 0 18px 18px; }
.menu-btn span { display:block; }
.chev { color:var(--muted); font-size:1.2rem; }
.seg { display:flex; background:var(--accent-soft); padding:4px; border-radius:12px; margin:8px 0 12px; gap:4px; }
.seg button { background:transparent; color:var(--ink); padding:9px 6px; font-size:.82rem; }
.seg button.on { background:#fff; color:var(--ink); box-shadow:0 2px 6px rgba(0,0,0,.06); }
.hits { margin:0; padding:0; list-style:none; border:1px solid var(--line); border-radius:12px; background:#fff; max-height:220px; overflow:auto; }
.hits:empty { display:none; }
.sr-file { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; }
.preview { width:100%; border-radius:12px; margin-top:8px; display:none; }
.scan-video { width:100%; border-radius:12px; background:#111; max-height:240px; object-fit:cover; }
.hit { width:100%; text-align:left; background:#fff; color:var(--ink); border-radius:0; padding:12px 14px; }
.hit + .hit { border-top:1px solid var(--line); }
.lang { position:absolute; top:14px; right:16px; width:auto; padding:6px 12px; background:var(--accent-soft); color:var(--ink); font-size:.75rem; border-radius:20px; }
nav { position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:calc(100% - 32px); max-width:420px; display:grid; grid-template-columns:repeat(4,1fr); background:#1e1915; border-radius:24px; padding:5px; box-shadow:0 10px 25px rgba(0,0,0,.25); z-index:20; }
nav button { background:transparent; color:#9c8e82; font-size:.72rem; font-weight:650; padding:10px 2px; border-radius:18px; }
nav button.on { background:#fff; color:var(--accent); }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-.03em; color:var(--ink); margin:0 0 8px; }
.brand .pin { width:12px; height:16px; background:#c45a3a; border-radius:10px 10px 10px 0; transform:rotate(-45deg); display:inline-block; flex-shrink:0; }
.brand.sm { font-size:.92rem; font-weight:650; }
