/* LEDGERS Nomenclature — same slate/indigo look as the filings dashboard. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #FAFBFD; color: #0F172A; font-size: 14px; }
button { font: inherit; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 20px; background: #fff; border-bottom: 1px solid #F1F5F9; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .04em; color: #475569; white-space: nowrap; }
.brand b { color: #0F172A; font-weight: 600; letter-spacing: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; background: #0F172A; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.top-nav { display: flex; gap: 4px; padding: 4px; background: #F1F5F9; border-radius: 12px; }
.top-link { font-size: 12px; color: #64748B; background: none; border: 0; border-radius: 9px; padding: 6px 16px; cursor: pointer; }
.top-link:hover { color: #0F172A; }
.top-link.active { background: #0F172A; color: #fff; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: #64748B; white-space: nowrap; }
.role { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #4F46E5; background: #EEF2FF; border-radius: 9999px; padding: 2px 8px; }
.top-user a { color: #64748B; }
.boot, .gate { max-width: 520px; margin: 80px auto; padding: 24px; text-align: center; color: #64748B; }
.gate h1 { font-size: 20px; color: #0F172A; font-weight: 500; }

/* ---------- Page header + cards ---------- */
.cv-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; background: #fff; border-bottom: 1px solid #F1F5F9; padding: 18px 20px 16px; }
.cv-title { margin: 0; color: #0F172A; font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.cv-sub { color: #64748B; font-size: 11px; letter-spacing: .02em; margin-top: 2px; text-transform: uppercase; }
.cv-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; padding: 4px; background: #F1F5F9; border-radius: 12px; }
.cv-tab { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #64748B; background: none; border: 0; border-radius: 9px; padding: 6px 18px; cursor: pointer; }
.cv-tab:hover { color: #0F172A; }
.cv-tab.active { background: #0F172A; color: #fff; }
.cv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cv-period { display: flex; gap: 8px; }
select { appearance: none; font-size: 12px; color: #0B132B; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px; border: 1px solid #E2E8F0; border-radius: 12px; padding: 7px 30px 7px 12px; cursor: pointer; }
.cv-body { padding: 24px 20px 100px; min-width: 0; }
.cv-card { background: #fff; border: 1px solid #F1F5F9; border-radius: 24px; padding: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.05); margin-bottom: 20px; min-width: 0; }
.cv-h2 { margin: 0 0 12px; color: #0F172A; font-size: 16px; font-weight: 500; }
.cv-note { font-size: 12px; color: #94A3B8; }
.cv-empty { text-align: center; color: #94A3B8; padding: 36px !important; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 7px 14px; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: #F8FAFC; color: #0F172A; }
.btn.primary { background: #4F46E5; border-color: #4F46E5; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #4338CA; color: #fff; }
.btn.danger { border-color: #FECACA; color: #DC2626; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }
.btn input[type=file] { display: none; }
.link-btn { font-size: 12px; font-weight: 500; color: #4F46E5; background: #EEF2FF; border: 1px solid #E0E7FF; border-radius: 10px; padding: 4px 12px; cursor: pointer; }
.link-btn:hover:not(:disabled) { background: #4F46E5; color: #fff; }
.link-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Rename table ---------- */
.nb-card { padding: 0; overflow: hidden; contain: inline-size; }
.nb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 16px; border-bottom: 1px solid #F1F5F9; }
.search { display: flex; align-items: center; gap: 8px; flex: 0 1 320px; min-width: 200px; border: 1px solid #E2E8F0; border-radius: 12px; padding: 7px 12px; background: #fff; }
.search svg { width: 14px; height: 14px; color: #94A3B8; flex-shrink: 0; }
.search input { border: 0; outline: 0; font-size: 12px; width: 100%; color: #0F172A; background: transparent; }
.search:focus-within { border-color: #A5B4FC; box-shadow: 0 0 0 3px #EEF2FF; }
.nb-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #475569; cursor: pointer; }
.nb-toggle input { accent-color: #4F46E5; }
.nb-shown { margin-left: auto; font-size: 11px; color: #94A3B8; }
.n { font-size: 10px; font-weight: 600; background: #EEF2FF; color: #4F46E5; border-radius: 9999px; padding: 0 7px; line-height: 16px; }
.active > .n { background: rgba(255,255,255,.2); color: #fff; }
.nb-seg { display: inline-flex; gap: 2px; padding: 3px; background: #F1F5F9; border-radius: 10px; }
.nb-seg-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #64748B; background: none; border: 0; border-radius: 8px; padding: 5px 14px; cursor: pointer; }
.nb-seg-btn.active { background: #fff; color: #0F172A; font-weight: 500; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.nb-seg-btn.active .n { background: #EEF2FF; color: #4F46E5; }
.nb-rule { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 9px 16px; border-bottom: 1px solid #F1F5F9; background: #FCFDFE; font-size: 11px; color: #94A3B8; }
.nb-rule-label { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: #A5B4FC; font-weight: 600; }
.nb-rule code { font-size: 10.5px; }
.nb-rule code span { cursor: help; border-bottom: 1px dotted #CBD5E1; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
.t th { text-align: left; font-size: 10px; font-weight: 500; color: #0F172A; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid #F1F5F9; background: #FAFBFD; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid #F8FAFC; vertical-align: middle; color: #475569; }
.nb-table { table-layout: fixed; min-width: 760px; }
.nb-table th { white-space: normal; vertical-align: bottom; line-height: 1.35; }
.nb-table tr.has-error td { background: #FFFBFB; }
.nb-co-h { width: 26%; }
.nb-dl-h { width: 150px; }
.nb-reg-h { width: 70px; }
.nb-reg { font-weight: 600; color: #334155; }
.nb-table td[rowspan] { vertical-align: top; }
.nb-stack { display: flex; flex-direction: column; gap: 6px; }
.nb-drop.more { height: 24px; align-self: flex-start; }
.co-name { color: #0F172A; font-size: 12px; line-height: 1.35; }
.co-bid { color: #94A3B8; font-size: 10px; margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nb-drop { position: relative; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; color: #94A3B8; font-size: 11px; cursor: pointer; }
.nb-drop:hover { background: #F8FAFC; color: #4F46E5; border-color: #E2E8F0; }
.nb-drop.over { background: #EEF2FF; color: #4F46E5; border: 1px dashed #4F46E5; }
.nb-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.nb-file { border: 1px solid #D1FAE5; background: #F6FEFA; border-radius: 10px; padding: 6px 8px 7px; min-width: 0; }
.nb-file.error { border-color: #FECACA; background: #FEF2F2; }
.nb-file.review { border-color: #FDE68A; background: #FFFBEB; }
.nb-file.checking { border-color: #E2E8F0; background: #F8FAFC; }
.nb-file-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nb-mark { font-size: 11px; color: #10B981; flex-shrink: 0; }
.nb-file.error .nb-mark { color: #EF4444; }
.nb-file.review .nb-mark { color: #D97706; }
.nb-file.checking .nb-mark { color: #94A3B8; }
.nb-orig { flex: 1; min-width: 0; font-size: 11px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-x { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: #94A3B8; cursor: pointer; flex-shrink: 0; }
.nb-x:hover { background: #FEE2E2; color: #EF4444; }
.nb-get:hover { background: #EEF2FF; color: #4F46E5; }
.nb-x svg { width: 12px; height: 12px; }
.nb-new { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; color: #0F172A; word-break: break-all; }
.nb-msg { margin-top: 4px; font-size: 10.5px; line-height: 1.35; color: #059669; }
.nb-file.error .nb-msg { color: #EF4444; }
.nb-file.review .nb-msg { color: #B45309; }
.nb-msg.dim { color: #94A3B8; }
.nb-ok-btn { margin-top: 6px; font-size: 11px; color: #92400E; background: #fff; border: 1px solid #FCD34D; border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.nb-ok-btn:hover { background: #FEF3C7; }
.nb-blocked { font-size: 11px; color: #EA580C; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px; padding: 10px 12px; }
.nb-dl-cell { text-align: right; }
.nb-dl { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nb-dl svg { width: 12px; height: 12px; }
.dash { color: #CBD5E1; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #F1F5F9; font-size: 11px; color: #64748B; }
.pages { display: flex; flex-wrap: wrap; gap: 4px; }
.pg { min-width: 28px; height: 28px; padding: 0 8px; font-size: 12px; color: #475569; background: #fff; border: 1px solid #E2E8F0; border-radius: 8px; cursor: pointer; }
.pg.active { background: #0F172A; border-color: #0F172A; color: #fff; }
.pg:disabled { opacity: .4; cursor: default; }
.foot { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; background: #fff; border-top: 1px solid #F1F5F9; box-shadow: 0 -4px 16px rgba(15,23,42,.05); font-size: 12px; color: #475569; }
.foot b { color: #0F172A; font-weight: 600; }
.foot-actions { display: flex; gap: 8px; }
.err { color: #EF4444; }
.warn { color: #B45309; }
.toast { position: fixed; bottom: 76px; left: 50%; z-index: 60; max-width: min(640px, calc(100% - 32px)); transform: translate(-50%, 8px); background: #0F172A; color: #fff; font-size: 12px; padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.25); opacity: 0; pointer-events: none; transition: all .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #B91C1C; }

/* ---------- Companies + Activity ---------- */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.row .grow { flex: 1; }
.chip { display: inline-block; font-size: 10px; font-weight: 500; color: #475569; background: #F1F5F9; border-radius: 9999px; padding: 1px 8px; margin: 1px 2px 1px 0; }
.chip.ok { color: #047857; background: #ECFDF5; }
.chip.bad { color: #B91C1C; background: #FEF2F2; }
.chip.warn { color: #B45309; background: #FFFBEB; }
.ids { font-size: 10.5px; line-height: 1.6; }
.ids b { font-family: system-ui, sans-serif; font-weight: 500; color: #94A3B8; margin-right: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid #F1F5F9; border-radius: 16px; padding: 10px 14px; background: #FAFBFD; }
.stat b { display: block; font-size: 20px; font-weight: 500; color: #0F172A; }
.stat span { font-size: 11px; color: #64748B; }
.stat.bad b { color: #DC2626; } .stat.warn b { color: #B45309; } .stat.ok b { color: #059669; }
.diff { font-size: 10.5px; }
.diff del { color: #DC2626; text-decoration: line-through; }
.diff ins { color: #059669; text-decoration: none; }
.callout { border-radius: 14px; padding: 12px 14px; font-size: 12px; margin-bottom: 14px; }
.callout.bad { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.callout.warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.callout.ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.callout label { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

@media (max-width: 720px) {
  .top { gap: 10px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .top-user span.email { display: none; }
  .cv-right { align-items: flex-start; }
  .cv-body { padding: 16px 12px 120px; }
}
.m0 { margin: 0 !important; }
.mt16 { margin: 16px 0 0; }
