:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EEF2F7;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #475569;
  --muted: #8A97AB;
  --primary: #1D4ED8;
  --primary-600: #2563EB;
  --primary-50: #EEF3FF;
  --primary-100: #DCE6FE;
  --navy: #0B1B33;
  --navy-2: #12284A;
  --success: #047857;
  --success-500: #10B981;
  --success-50: #ECFDF5;
  --warning: #B45309;
  --warning-500: #F59E0B;
  --warning-50: #FFF8EB;
  --danger: #B91C1C;
  --danger-500: #EF4444;
  --danger-50: #FEF2F2;
  --violet: #6D28D9;
  --violet-50: #F3EEFF;
  --sap: #0A6ED1;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
svg { width: 1.15em; height: 1.15em; flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.sap-h svg { width: 15px; height: 15px; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13.5px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-3-2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--navy); color: #C9D4E5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 20px 24px 64px; max-width: 1680px; width: 100%; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2563EB, #1E40AF); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand-title { color: #fff; font-weight: 700; font-size: 14px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #8DA2C0; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-section { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6F86A8; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #C9D4E5; font-weight: 500; font-size: 13px; margin-bottom: 1px; transition: background .12s, color .12s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: #1D4ED8; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.1); color: #fff; font-variant-numeric: tabular-nums; }
.nav .count.warn { background: #F59E0B; color: #1F1300; }
.nav .count.danger { background: #EF4444; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-switch { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2B4A78; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.user-switch select { background: transparent; border: 0; color: #fff; font-weight: 600; font-size: 12.5px; width: 100%; cursor: pointer; padding: 0; }
.user-switch select option { color: var(--text); }
.user-switch .role { font-size: 11px; color: #8DA2C0; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 62px; }
.page-title h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.015em; }
.page-title .crumb { font-size: 11.5px; color: var(--muted); }
.status-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: default; }
.pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); flex: none; position: relative; }
.dot.live::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: var(--success-500); opacity: .35; animation: pulse 2s infinite; }
.dot.warn { background: var(--warning-500); } .dot.warn::after { background: var(--warning-500); }
.dot.err { background: var(--danger-500); } .dot.err::after { background: var(--danger-500); }
.dot.gray { background: var(--muted); }
@keyframes pulse { 0% { transform: scale(.8); opacity: .5; } 70% { transform: scale(1.9); opacity: 0; } 100% { opacity: 0; } }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }

.progress { height: 2px; background: transparent; position: sticky; top: 62px; z-index: 19; overflow: hidden; }
.progress.on div { height: 100%; width: 35%; background: linear-gradient(90deg, transparent, var(--primary-600), transparent); animation: slide 1.1s infinite linear; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---------------------------------------------------------------- Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--text); white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: #B6C2D2; }
.btn:focus-visible, .input:focus, .select:focus { outline: 2px solid var(--primary-100); outline-offset: 0; border-color: var(--primary-600); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #1A43BF; }
.btn.sap { background: var(--sap); border-color: var(--sap); color: #fff; }
.btn.sap:hover { background: #085CAF; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-50); border-color: #F3B4B4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select { height: 34px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); padding: 0 10px; font-size: 13px; min-width: 0; }
.select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; }
.input.sm, .select.sm { height: 30px; font-size: 12.5px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search .input { padding-left: 32px; width: 260px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.toggle { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; cursor: pointer; transition: .15s; }
.toggle span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--primary-600); }
.toggle input:checked + span::before { transform: translateX(16px); }
input[type=checkbox].cb { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 0; overflow-x: auto; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 13px; color: var(--text-2); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .n { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.tab.active .n { background: var(--primary-50); color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 11px; height: 30px; font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--primary-50); color: var(--primary); }

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-b { padding: 0 16px 16px; }
.card-b.flush { padding: 0; }
.card.pad { padding: 16px; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 8px; }

.kpi { padding: 16px 16px 14px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.kpi .label .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.kpi .label .ic svg { width: 15px; height: 15px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin: 10px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.kpi .foot { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi .foot b { color: var(--text-2); font-weight: 600; }
.kpi .meter { height: 6px; border-radius: 99px; background: var(--surface-3); margin: 8px 0 6px; overflow: hidden; display: flex; }
.kpi .meter i { display: block; height: 100%; }
.ic.blue { background: var(--primary-50); color: var(--primary); }
.ic.green { background: var(--success-50); color: var(--success); }
.ic.amber { background: var(--warning-50); color: var(--warning); }
.ic.red { background: var(--danger-50); color: var(--danger); }
.ic.violet { background: var(--violet-50); color: var(--violet); }
.ic.sap { background: #E6F1FB; color: var(--sap); }

/* ---------------------------------------------------------------- Pipeline */
.pipeline { display: grid; grid-template-columns: 1fr 34px 1fr 34px 1fr; align-items: stretch; }
.pipe-step { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); position: relative; transition: border-color .2s, box-shadow .2s, background .2s; }
.pipe-step.active { border-color: var(--primary-600); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-100); }
.pipe-step .step-n { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .07em; }
.pipe-step h4 { margin: 3px 0 2px; font-size: 14px; font-weight: 650; }
.pipe-step .src { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.pipe-step .src svg { width: 14px; height: 14px; flex: none; color: var(--primary); }
table.t td.sub-row { border-bottom-style: dashed; }
table.t tr.match-cont td { border-top: 0; }
.pipe-stats { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.pipe-stats div { display: flex; flex-direction: column; }
.pipe-stats b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pipe-stats span { font-size: 11.5px; color: var(--muted); }
.pipe-arrow { display: grid; place-items: center; color: var(--border-strong); }
.pipe-arrow svg { width: 22px; height: 22px; }
.pipe-arrow.flow svg { color: var(--primary-600); animation: nudge 1s infinite; }
@keyframes nudge { 50% { transform: translateX(3px); } }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
@media (max-width: 1000px) { .pipeline { grid-template-columns: 1fr; } .pipe-arrow { transform: rotate(90deg); height: 28px; } }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); background: var(--surface-2); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.t td { padding: 9px 10px; border-bottom: 1px solid #EEF1F5; vertical-align: middle; }
table.t tbody tr:hover td { background: #FAFBFD; }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr.selected td { background: var(--primary-50); }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
table.t .group-h th { background: var(--surface); border-bottom: 0; padding-top: 10px; padding-bottom: 4px; font-size: 10.5px; }
.gh { display: flex; align-items: center; gap: 6px; }
.gh .bar { flex: 1; height: 2px; border-radius: 2px; }
.split-l { border-left: 3px solid #93B4F5 !important; }
.split-c { border-left: 3px solid #7FB8EA !important; }
.split-r { border-left: 3px solid #C4B5FD !important; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cell-sub.mono { font-size: 11px; }
.stack-items > div + div { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.c { color: var(--success); }
.amount.d { color: var(--text); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--border-strong); margin-bottom: 8px; }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 3px; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; line-height: 16px; }
.badge.gray { background: var(--surface-3); color: var(--text-2); }
.badge.blue { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.badge.green { background: var(--success-50); color: var(--success); border-color: #C6F0DD; }
.badge.amber { background: var(--warning-50); color: var(--warning); border-color: #FBE3B5; }
.badge.red { background: var(--danger-50); color: var(--danger); border-color: #F8CACA; }
.badge.violet { background: var(--violet-50); color: var(--violet); border-color: #E0D3FD; }
.badge.sap { background: #E6F1FB; color: var(--sap); border-color: #C2DDF6; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rule { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); }

.score { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.score .track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.score .track i { display: block; height: 100%; border-radius: 99px; }
.score b { font-size: 12.5px; font-variant-numeric: tabular-nums; width: 38px; text-align: right; }

/* ---------------------------------------------------------------- Feed / timeline */
.feed { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.feed li { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid #EEF1F5; font-size: 12.5px; animation: fadein .3s; }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.feed .ic svg { width: 14px; height: 14px; }
.feed .t { font-size: 11px; color: var(--muted); white-space: nowrap; margin-left: auto; padding-left: 8px; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 12.5px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary-600); }
.timeline li.ok::after { border-color: var(--success-500); background: var(--success-500); }
.timeline li.warn::after { border-color: var(--warning-500); }
.timeline li.err::after { border-color: var(--danger-500); }
.timeline .when { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 10.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar .bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; display: flex; }
.hbar .bar i { display: block; height: 100%; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------------------------------------------------------- Modal / drawer / toast */
.overlay { position: fixed; inset: 0; background: rgba(11, 27, 51, .42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; animation: fadein .15s; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; display: flex; flex-direction: column; max-height: 88vh; }
.modal.lg { max-width: 980px; }
.modal.xl { max-width: 1180px; }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.modal-h .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-b { padding: 16px 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(11, 27, 51, .32); z-index: 90; animation: fadein .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 91; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.toasts { position: fixed; top: 74px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; border-radius: 9px; padding: 11px 14px; box-shadow: var(--shadow-lg); font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; animation: fadein .2s; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #34D399; } .toast.err svg { color: #F87171; } .toast.info svg { color: #93C5FD; } .toast.warn svg { color: #FBBF24; }
.toast b { display: block; font-size: 13px; margin-bottom: 1px; }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; margin: 0; font-size: 12.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
pre.json { background: #0D1B2E; color: #CFE0F5; border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 11.5px; overflow: auto; max-height: 320px; margin: 0; line-height: 1.5; }
pre.json .k { color: #8EC5FF; } pre.json .s { color: #A8E6B0; } pre.json .n { color: #FFC98B; } pre.json .b { color: #F5A3C7; }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.callout.blue { background: var(--primary-50); color: #1E3A8A; }
.callout.amber { background: var(--warning-50); color: #78350F; }
.callout.red { background: var(--danger-50); color: #7F1D1D; }
.callout.green { background: var(--success-50); color: #064E3B; }
.callout.violet { background: var(--violet-50); color: #4C1D95; }

/* ---------------------------------------------------------------- Simulador */
.sim-fab { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 99px; background: var(--violet); color: #fff; border: 0; font-weight: 600; font-size: 13px; cursor: pointer; box-shadow: 0 6px 20px rgba(109, 40, 217, .35); }
.sim-fab svg { width: 18px; height: 18px; }
.sim-panel { position: fixed; right: 20px; bottom: 72px; z-index: 81; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid #E0D3FD; overflow: hidden; animation: fadein .15s; }
.sim-panel header { background: var(--violet); color: #fff; padding: 12px 14px; }
.sim-panel header b { display: block; font-size: 14px; }
.sim-panel header span { font-size: 11.5px; opacity: .85; }
.sim-panel .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.sim-action { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; width: 100%; }
.sim-action:hover { border-color: #C4B5FD; background: #FBF9FF; }
.sim-action svg { width: 18px; height: 18px; color: var(--violet); flex: none; margin-top: 1px; }
.sim-action b { display: block; font-size: 12.5px; }
.sim-action span { font-size: 11.5px; color: var(--muted); }
.bank-status { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; font-size: 12px; }

/* ---------------------------------------------------------------- Misc */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); font-size: 12.5px; color: #1E3A8A; }
.split-head { display: grid; gap: 0; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sum-chip { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; min-width: 150px; text-align: left; }
.sum-chip:hover { border-color: var(--border-strong); }
.sum-chip.active { border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.sum-chip b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sum-chip span { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.sum-chip small { font-size: 11px; color: var(--muted); }
.doc-link { font-family: var(--mono); font-size: 12px; color: var(--sap); font-weight: 500; cursor: pointer; border-bottom: 1px dashed currentColor; }
.code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.sap-frame { border: 1px solid #C2DDF6; border-radius: 8px; overflow: hidden; }
.sap-frame .sap-h { background: linear-gradient(90deg, #0A6ED1, #0854A0); color: #fff; padding: 8px 12px; font-size: 12px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.skel { background: linear-gradient(90deg, #EEF2F7 25%, #F6F8FB 50%, #EEF2F7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.conn-bank { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface); }
.conn-bank .nm { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.conn-bank .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; }
.endpoint { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #EEF1F5; font-size: 12.5px; }
.endpoint:last-child { border-bottom: 0; }
.method { font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px; min-width: 52px; text-align: center; }
.method.GET { background: #E7F6EE; color: #047857; } .method.POST { background: #E8EFFE; color: #1D4ED8; } .method.PUT, .method.PATCH { background: #FFF5E0; color: #B45309; } .method.DELETE { background: #FDECEC; color: #B91C1C; } .method.mixed { background: var(--surface-3); color: var(--text-2); }
.hash { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.flow-diagram { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; }
.flow-node { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; background: var(--surface-2); }
.flow-node b { display: block; font-size: 13px; }
.flow-node span { font-size: 11.5px; color: var(--muted); }
.flow-edge { font-size: 11px; color: var(--text-2); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.flow-edge svg { width: 40px; height: 14px; color: var(--primary-600); }
@media (max-width: 900px) { .flow-diagram { grid-template-columns: 1fr; } .flow-edge svg { transform: rotate(90deg); } }
@media (max-width: 900px) { .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; } .sidebar.open { transform: none; } .content { padding: 16px; } .topbar { padding: 10px 16px; } .menu-btn { display: inline-flex !important; } }
.menu-btn { display: none !important; }

/* ---------------------------------------------------------------- Botão "?" de ajuda com hover */
.tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 700;
  cursor: help; vertical-align: middle; margin-left: 5px; border: 1px solid var(--border-strong); flex: none; line-height: 1; text-transform: none; letter-spacing: 0; font-family: var(--font); user-select: none; transition: background .12s, color .12s; }
.tip:hover, .tip:focus { background: var(--primary); color: #fff; border-color: var(--primary); outline: none; }
.tip.light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
#tip-pop { position: fixed; z-index: 400; width: 320px; max-width: calc(100vw - 16px); background: #0B1B33; color: #E2E8F0; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 14px 36px rgba(11, 27, 51, .35); pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity .12s, transform .12s; }
#tip-pop.on { opacity: 1; transform: none; }
#tip-pop b { display: block; color: #fff; font-size: 13.5px; margin-bottom: 6px; }
#tip-pop .tp-sec { margin-top: 6px; }
#tip-pop .tp-sec span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7FA3DD; margin-bottom: 1px; }

/* ---------------------------------------------------------------- Upload */
.dropzone { display: block; border: 2px dashed var(--border-strong); border-radius: 12px; padding: 30px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary-600); background: var(--primary-50); }
.dropzone svg { width: 34px; height: 34px; color: var(--primary); }
.dropzone b { display: block; font-size: 14px; margin-top: 8px; }
.dropzone span { font-size: 12.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- Ajuda contextual */
.help-banner { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(90deg, #EEF3FF, #F6F8FF); border: 1px solid var(--primary-100); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.help-banner .hb-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.help-banner .hb-ic svg { width: 18px; height: 18px; }
.help-banner b { font-size: 13.5px; }
.help-banner p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.help-banner .todo { margin-top: 6px; font-size: 12.5px; color: #1E3A8A; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.help-banner .todo svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Guia */
.guide-hero { background: linear-gradient(135deg, #0B1B33, #1D3B70); color: #fff; border-radius: 14px; padding: 26px 28px; }
.guide-hero h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.guide-hero p { margin: 0; color: #C9D6EA; max-width: 760px; line-height: 1.55; }
.how { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; margin-top: 22px; }
.how-step { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; padding: 14px; }
.how-step .n { width: 26px; height: 26px; border-radius: 50%; background: #2563EB; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.how-step b { display: block; font-size: 14px; }
.how-step span { font-size: 12.5px; color: #B9C8DF; line-height: 1.45; display: block; margin-top: 3px; }
.how-arrow { display: grid; place-items: center; color: #5B7BB0; }
.how-arrow svg { width: 20px; height: 20px; }
@media (max-width: 1100px) { .how { grid-template-columns: 1fr; } .how-arrow { transform: rotate(90deg); } }
.task { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #EEF1F5; }
.task:last-child { border-bottom: 0; }
.task .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none; }
.task .num.done { background: var(--success-50); color: var(--success); }
.task .num.todo { background: var(--warning-50); color: var(--warning); }
.task .txt { flex: 1; }
.task .txt b { display: block; font-size: 13.5px; }
.task .txt span { font-size: 12.5px; color: var(--text-2); }
.demo-step { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid #EEF1F5; }
.demo-step:last-child { border-bottom: 0; }
.demo-step .num { width: 26px; height: 26px; border-radius: 7px; background: var(--violet-50); color: var(--violet); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.demo-step b { font-size: 13px; }
.demo-step p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.demo-step p i { color: var(--text); font-style: normal; font-weight: 600; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.gloss div { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface); }
.gloss b { font-family: var(--mono); font-size: 12px; color: var(--primary); }
.gloss span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.legend-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 12.5px; color: var(--text-2); }
.legend-row .badge { min-width: 150px; justify-content: center; }

/* ---------------------------------------------------------------- Conciliação (3 colunas) */
table.cz td { vertical-align: top; padding: 12px 12px; }
table.cz tbody tr:hover td { background: #FAFBFE; }
.cz-col-bank { width: 38%; }
.cz-col-sap { width: 37%; }
.bank-tag { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 54px; padding: 3px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; line-height: 1.25; border: 1px solid transparent; flex: none; }
.bank-tag small { font-family: var(--mono); font-weight: 500; font-size: 10px; opacity: .85; }
.bt-341 { background: #FFF1E6; color: #C2410C; border-color: #FED7AA; }
.bt-237 { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.bt-033 { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.bt-001 { background: #FEFCE8; color: #854D0E; border-color: #FDE68A; }
.bt-104 { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.bt-x { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.cz-top { display: flex; gap: 10px; align-items: flex-start; }
.cz-meta { font-size: 12px; color: var(--text-2); line-height: 1.45; flex: 1; min-width: 0; }
.cz-meta .mono { font-size: 11.5px; }
.cz-val { text-align: right; white-space: nowrap; }
.cz-val b { font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; display: block; }
.cz-val small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cz-title { font-weight: 650; font-size: 13px; margin-top: 8px; text-transform: uppercase; letter-spacing: .01em; }
.cz-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.sap-item + .sap-item { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sap-head { display: flex; gap: 8px; align-items: baseline; }
.sap-head .lbl { font-size: 12px; color: var(--sap); font-weight: 600; }
.sap-name { font-weight: 650; font-size: 13px; margin-top: 3px; }
.sap-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; }
.sap-none { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 12.5px; padding: 6px 0; }
.sap-none svg { width: 18px; height: 18px; color: var(--muted); }
.verdict { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.35; border: 1px solid; }
.verdict i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-top: 5px; flex: none; }
.verdict small { display: block; font-weight: 500; opacity: .85; font-size: 11.5px; margin-top: 1px; }
.verdict.green { background: var(--success-50); color: var(--success); border-color: #BBF0D6; }
.verdict.blue { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.verdict.amber { background: var(--warning-50); color: var(--warning); border-color: #FBE3B5; }
.verdict.red { background: var(--danger-50); color: var(--danger); border-color: #F8CACA; }
.verdict.done { background: var(--surface-2); color: var(--success); border-color: var(--border); }
.cz-actions { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.cz-actions .btn.sap { flex: 1; min-width: 150px; }

.linklike { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 12px; }
.linklike:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Login */
.login-wrap { position: fixed; inset: 0; z-index: 150; background: radial-gradient(1200px 600px at 20% 0%, #1D3B70 0%, #0B1B33 60%); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 26px 26px 22px; }
.login-card h2 { font-size: 19px; margin: 14px 0 12px; letter-spacing: -.015em; }
.login-brand { display: flex; flex-direction: column; gap: 6px; }
.login-brand span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-demo { margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--violet-50); border: 1px solid #E0D3FD; font-size: 12.5px; color: #4C1D95; }
.login-demo b { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.login-demo svg { width: 15px; height: 15px; }
.login-demo .t td { background: transparent !important; padding: 5px 6px; border-color: #E9E0FD; }
.login-demo.phone { text-align: center; }
.login-demo.phone b { justify-content: center; }
.otp { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: .18em; color: #2E1065; margin: 6px 0 2px; }
.mfa-input { width: 100%; height: 48px; font-family: var(--mono); font-size: 24px; letter-spacing: .4em; text-align: center; }
.brand-logo { display: block; }
.login-brand img { align-self: flex-start; }
.login-env { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.login-env .linklike { font-size: 11.5px; }
.otp-inline { font-size: 13px; color: var(--text); letter-spacing: .08em; }
