* { box-sizing: border-box; }
body { font-family: -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; background: #f5f6f8; color: #222; }
header { background: #1f2937; color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
header h1 { margin: 0; font-size: 18px; }
.stats { font-size: 13px; opacity: .9; }
.stats span { margin-left: 16px; }
.tabs { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 20px; }
.tab { background: none; border: none; padding: 12px 18px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; }
.tab.active { border-color: #2563eb; color: #2563eb; font-weight: 600; }
.tab-pane { display: none; padding: 20px; }
.tab-pane.active { display: block; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select, .filters button { padding: 6px 10px; font-size: 13px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; }
.filters button, #upload, #recompute, #export { background: #2563eb; color: #fff; border: none; cursor: pointer; }
.filters button:hover, #upload:hover, #recompute:hover, #export:hover { background: #1d4ed8; }
.meta { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 220px); background: #fff; border: 1px solid #e5e7eb; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #f1f2f4; text-align: left; vertical-align: top; white-space: nowrap; }
th { background: #f9fafb; position: sticky; top: 0; z-index: 1; font-weight: 600; }
tr:hover td { background: #f9fafb; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.neg { color: #b91c1c; }
td.pos { color: #065f46; }
td select, td input { width: 100%; font-size: 12px; padding: 3px 4px; border: 1px solid transparent; background: transparent; border-radius: 3px; }
td select:focus, td input:focus { border-color: #2563eb; background: #fff; outline: none; }
.card { background: #fff; padding: 16px 20px; border: 1px solid #e5e7eb; border-radius: 4px; margin-bottom: 16px; max-width: 720px; }
.card h2 { font-size: 15px; margin: 0 0 8px; }
.card p { font-size: 13px; color: #6b7280; margin: 0 0 12px; }
.card input[type=file] { margin-right: 8px; }
#upload-msg, #recompute-msg { margin-top: 10px; font-size: 13px; color: #065f46; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 11px; }
.badge.deb { background: #dcfce7; color: #065f46; }
.badge.cre { background: #fee2e2; color: #991b1b; }
