:root { --bg:#f4f5f7; --panel:#fff; --line:#dfe3e8; --text:#1c2430; --muted:#66707d; --accent:#1f5fbf; --ok:#1f7a45; --warn:#a15c00; --bad:#b3261e; --dup:#6a3fb5; }
* { box-sizing: border-box; }
body { margin:0; font:14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--text); background:var(--bg); }
button, input, select, textarea { font:inherit; }
button { border:1px solid var(--line); background:var(--panel); border-radius:6px; padding:6px 10px; cursor:pointer; }
button:hover { border-color:var(--accent); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--bad); }
button:disabled { opacity:.5; cursor:not-allowed; }
input, select, textarea { border:1px solid var(--line); border-radius:6px; padding:6px 8px; background:#fff; max-width:100%; }
header.top { display:flex; align-items:center; gap:16px; padding:10px 16px; background:var(--panel); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; }
header.top h1 { font-size:16px; margin:0; }
nav.tabs { display:flex; gap:4px; flex:1; flex-wrap:wrap; }
nav.tabs button { border:none; background:none; padding:8px 12px; border-radius:6px; }
nav.tabs button.active { background:#e6eefb; color:var(--accent); font-weight:600; }
.who { color:var(--muted); font-size:12px; }
main { padding:16px; }
.login { max-width:380px; margin:12vh auto; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:24px; display:grid; gap:12px; }
.chips { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.chip { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:8px 12px; min-width:104px; text-align:left; }
.chip b { display:block; font-size:20px; }
.chip.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.bar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
.notice { background:#fff8e6; border:1px solid #e8cf8a; border-radius:8px; padding:8px; }
.notice.interrupted { background:#fdecea; border-color:#e7a9a4; }
.bulk { background:#eef3fb; border:1px solid #c9d8f2; border-radius:8px; padding:8px; position:sticky; top:52px; z-index:4; }
.drop { border:2px dashed var(--line); border-radius:10px; padding:14px; text-align:center; color:var(--muted); background:var(--panel); margin-bottom:12px; }
.drop.over { border-color:var(--accent); color:var(--accent); }
.layout { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.layout.split { grid-template-columns:minmax(0,1fr) minmax(340px,440px); }
.tablewrap { background:var(--panel); border:1px solid var(--line); border-radius:8px; overflow:auto; max-height:calc(100vh - 250px); }
table { border-collapse:collapse; width:100%; }
th, td { padding:6px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; white-space:nowrap; }
td.wrap { white-space:normal; min-width:160px; }
th { position:sticky; top:0; background:#f8f9fb; font-size:12px; color:var(--muted); z-index:1; }
tr.sel { background:#f2f7ff; }
tr.row { cursor:pointer; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
.badge { display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:600; border:1px solid currentColor; }
.s-READY, .s-COMMITTED, .s-OPEN { color:var(--ok); } .s-NEEDS_REVIEW, .s-PENDING_EXTRACTION, .s-COMMITTING, .s-DUE_TODAY, .s-DUE_SOON, .s-NO_DUE_DATE { color:var(--warn); }
.s-AMBIGUOUS, .s-POSSIBLE_DUPLICATE { color:var(--dup); } .s-REJECTED, .s-EXTRACTION_FAILED, .s-OVERDUE { color:var(--bad); }
.hint { color:var(--muted); font-size:12px; } .warn { color:var(--warn); font-size:12px; } .err { color:var(--bad); }
.sugg { border-bottom:1px dotted var(--warn); }
aside.detail { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px; max-height:calc(100vh - 110px); overflow:auto; position:sticky; top:60px; }
aside.detail img, aside.detail iframe { width:100%; border:1px solid var(--line); border-radius:6px; }
aside.detail iframe { height:420px; }
.field { display:grid; grid-template-columns:120px 1fr; gap:6px; align-items:center; margin:5px 0; }
.cand { border:1px solid var(--line); border-radius:6px; padding:8px; margin:6px 0; }
dialog { border:1px solid var(--line); border-radius:10px; padding:18px; max-width:min(860px,94vw); width:100%; }
dialog::backdrop { background:rgba(0,0,0,.35); }
.toast { position:fixed; right:16px; bottom:16px; background:#1c2430; color:#fff; padding:10px 14px; border-radius:8px; max-width:420px; z-index:20; }
pre.raw { white-space:pre-wrap; background:#f8f9fb; border:1px solid var(--line); border-radius:6px; padding:8px; max-height:220px; overflow:auto; font-size:12px; }
@media (max-width: 980px) { .layout.split { grid-template-columns:minmax(0,1fr); } aside.detail { position:static; max-height:none; } }
/* ---- painel operacional: navegação, visão geral, etapas ---- */
[hidden] { display:none !important; }
h2 { font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:18px 0 8px; }
a.btn { display:inline-block; border:1px solid var(--line); background:var(--panel); border-radius:6px; padding:6px 10px; color:var(--text); text-decoration:none; }
a.btn:hover { border-color:var(--accent); } a.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button:focus-visible, a.btn:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
nav.tabs { align-items:center; } .more { position:relative; }
.menu { position:absolute; top:100%; left:0; background:var(--panel); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.12); padding:4px; display:grid; min-width:180px; z-index:10; }
.menu button { text-align:left; }
.who { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.loading, .empty { color:var(--muted); padding:22px 12px; text-align:center; } td.empty { white-space:normal; }
.quick { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:6px; } .quick button { padding:9px 14px; font-weight:600; }
dialog .quick { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:12px; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; margin-bottom:8px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px 14px; text-align:left; display:grid; gap:2px; font:inherit; color:inherit; }
button.card { cursor:pointer; } button.card:hover { border-color:var(--accent); }
.card b { font-size:21px; font-variant-numeric:tabular-nums; } .card-t { font-size:12px; color:var(--muted); font-weight:600; }
.card.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.card.bad { border-left:4px solid var(--bad); } .card.bad b { color:var(--bad); } .card.warnc { border-left:4px solid var(--warn); }
.attention { display:grid; gap:6px; max-width:860px; }
.att { display:flex; justify-content:space-between; gap:12px; align-items:center; text-align:left; padding:10px 12px; border-left:4px solid var(--warn); }
.att.bad { border-left-color:var(--bad); } .att.dup { border-left-color:var(--dup); }
.okline { color:var(--ok); }
.subtabs { display:flex; gap:4px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.subtabs button { border:none; background:none; border-bottom:3px solid transparent; border-radius:0; padding:8px 14px; font-weight:600; color:var(--muted); }
.subtabs button.active { color:var(--accent); border-bottom-color:var(--accent); }
.pill { border-radius:16px; padding:4px 12px; } .pill.active { background:#e6eefb; border-color:var(--accent); color:var(--accent); font-weight:600; }
.chip.small { min-width:0; padding:4px 10px; display:flex; gap:6px; align-items:baseline; font-size:12px; } .chip.small b { display:inline; font-size:13px; }
.chips { align-items:center; }
.bulk.idle { background:var(--panel); border-color:var(--line); }
.pager { margin-left:auto; }
.drop { text-align:left; } .drop.full { padding:22px; } .drop b { color:var(--text); }
.how { margin:8px 0 0; padding-left:18px; color:var(--muted); font-size:12px; } .drop details { margin-top:6px; font-size:12px; }
.progress { margin-bottom:12px; } .track { display:flex; height:8px; border-radius:4px; overflow:hidden; background:var(--line); }
.legend { display:flex; gap:14px; flex-wrap:wrap; font-size:12px; margin-top:4px; } .legend i { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:5px; }
.p-read { background:#9aa5b1; } .p-review { background:var(--warn); } .p-ready { background:var(--accent); } .p-done { background:var(--ok); }
.steps { display:flex; align-items:center; gap:3px; margin:4px 0 2px; font-size:11px; color:var(--muted); }
.steps i { width:14px; height:5px; border-radius:3px; background:var(--line); } .steps i.done { background:var(--ok); } .steps i.now { background:var(--warn); } .steps span { margin-left:4px; }
td.status { min-width:230px; } td.status .warn { margin-top:1px; }
.todo { margin:6px 0; padding-left:18px; color:var(--warn); font-size:13px; }
.tag { display:inline-block; font-size:11px; padding:0 6px; border-radius:4px; background:#efe9fb; color:var(--dup); font-weight:600; }
.c-RECEIVED, .c-PAID { color:var(--ok); } .c-RECEIVABLE, .c-PAYABLE { color:var(--warn); } .c-UNKNOWN { color:var(--muted); }
.choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.choice { border:1px solid var(--line); border-radius:8px; padding:8px 10px; display:grid; grid-template-columns:auto 1fr; column-gap:8px; cursor:pointer; } .choice .hint { grid-column:2; }
.choice:has(input:checked) { border-color:var(--accent); background:#f2f7ff; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; max-width:640px; } .panel h2 { margin-top:0; }
.cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; } ul.plain { margin:0; padding-left:18px; }
header.top { flex-wrap:wrap; row-gap:6px; }
@media (max-width: 1100px) { nav.tabs button { padding:8px 8px; } .who { display:none; } }
label.btn { display:inline-block; border:1px solid var(--accent); background:var(--accent); color:#fff; border-radius:6px; padding:6px 12px; cursor:pointer; font-weight:600; }
.filepick input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.filepick:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.o-new { background:#e7f4ec; color:var(--ok); } .o-old { background:#fff3dc; color:var(--warn); } .o-dup { background:#efe9fb; color:var(--dup); } .o-fix { background:#fdecea; color:var(--bad); }
