/* FR Fraud Tracker — Carbon g100 skin (tokens from vendor/carbon-theme-g100.css) */
:root {
  --bg: var(--cds-background, #161616); --l1: var(--cds-layer-01, #262626); --l2: #393939; --bd: #393939; --bd2: #525252;
  --tx: var(--cds-text-primary, #f4f4f4); --tx2: var(--cds-text-secondary, #c6c6c6); --tx3: #8d8d8d;
  --link: #78a9ff; --blue: #0f62fe; --ok: #42be65; --warn: #f1c21b; --bad: #ff8389; --info: #4589ff; --purple: #be95ff;
  --k-initial: #4589ff; --k-split2: #ff832b; --k-upsell: #be95ff; --k-rebill: #08bdba; --k-unknown: #a8a8a8; --k-unmatched: #6f6f6f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14px; line-height: 1.4; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, th[tabindex]:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
h1 { font-size: 20px; font-weight: 400; margin: 0 0 12px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--tx2); }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; background: #262626; padding: 0 3px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--tx2); font-weight: 400; font-size: 12px; }
.dim { color: var(--tx3); }
.sr { position: absolute; left: -9999px; }

/* header + nav */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; min-height: 48px;
  background: var(--l1); border-bottom: 1px solid var(--bd); flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 15px; white-space: nowrap; } .brand .accent { color: var(--link); }
.brand .sub { margin-left: 10px; font-weight: 400; color: var(--tx2); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }
nav.tabs { display: flex; gap: 0; background: #1c1c1c; border-bottom: 1px solid var(--bd); overflow-x: auto; padding: 0 8px; }
nav.tabs a { padding: 10px 14px; color: var(--tx2); border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a.on { color: var(--tx); border-bottom-color: var(--blue); }
nav.tabs a:hover { text-decoration: none; background: #262626; }
.statusbar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 8px 16px; font-size: 12px;
  color: var(--tx2); border-bottom: 1px solid var(--bd); background: #1a1a1a; }
.statusbar b { color: var(--tx); font-weight: 600; }
.page { padding: 16px 16px 48px; max-width: 1440px; margin: 0 auto; }

/* controls */
.btn { font: inherit; border: 1px solid transparent; padding: 6px 12px; cursor: pointer; background: var(--blue); color: #fff; display: inline-block; }
.btn:hover { text-decoration: none; background: #0353e9; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--bd); }
.btn.ghost:hover { background: #353535; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.primary { width: 100%; margin-top: 12px; }
.toolbar { display: flex; align-items: center; gap: 12px 20px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: flex; gap: 0; flex-wrap: wrap; } .seg .lbl { color: var(--tx3); font-size: 12px; align-self: center; margin-right: 6px; }
.chip { padding: 5px 10px; background: var(--l1); color: var(--tx2); border: 1px solid var(--bd); margin-left: -1px; font-size: 13px; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); position: relative; }
.chip:hover { text-decoration: none; color: var(--tx); }
select, input[type=text], input[type=date], input[type=number], input[type=password], textarea {
  background: #161616; color: var(--tx); border: 1px solid var(--bd2); border-bottom-color: #8d8d8d; font: inherit; padding: 5px 8px; }
textarea { width: 100%; min-height: 56px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--tx2); }

/* tags */
.tag { display: inline-block; padding: 1px 8px; border-radius: 12px; font-size: 11px; line-height: 16px; white-space: nowrap; vertical-align: middle; }
.tag.blue { background: #0043ce; color: #fff; } .tag.red { background: #a2191f; color: #fff; }
.tag.yellow { background: #8e6a00; color: #fff; } .tag.green { background: #0e6027; color: #fff; }
.tag.gray { background: #525252; color: #f4f4f4; } .tag.purple { background: #6929c4; color: #fff; }
.tag.outline { border: 1px solid var(--bd2); color: var(--tx2); }

/* banners */
.banner { padding: 10px 14px; margin-bottom: 14px; border-left: 3px solid var(--warn); background: #2a2616; font-size: 13px; }
.banner.bad { border-left-color: var(--bad); background: #2d1a1b; }
.banner.info { border-left-color: var(--info); background: #1a2233; }
.banner.ok { border-left-color: var(--ok); background: #162619; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--l1); padding: 14px 16px; border-top: 3px solid var(--info); min-width: 0; overflow-x: auto; }
.kpi.above_ceiling { border-top-color: var(--bad); } .kpi.below_ceiling { border-top-color: var(--warn); }
.kpi.at_stretch { border-top-color: var(--ok); } .kpi.provisional { border-top-color: #8d8d8d; border-top-style: dashed; }
.kpi .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi .title { font-size: 13px; color: var(--tx2); }
.kpi .big { font-size: 40px; font-weight: 300; line-height: 1.05; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .big small { font-size: 14px; color: var(--tx2); margin-left: 6px; }
.kpi .frac { font-size: 12px; color: var(--tx2); }
.kpi table.win { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.kpi table.win th, .kpi table.win td { padding: 4px 6px; border-top: 1px solid var(--bd); text-align: right; white-space: nowrap; }
.kpi table.win th:first-child, .kpi table.win td:first-child { text-align: left; }
.kpi table.win th { color: var(--tx3); font-weight: 400; }
.up { color: var(--bad); } .down { color: var(--ok); } .flat { color: var(--tx2); }

.grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; margin-bottom: 14px; }
.grid2e { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.card { background: var(--l1); padding: 14px 16px; margin-bottom: 12px; min-width: 0; overflow-x: auto; }
.card h2 .muted { margin-left: 6px; }
.card.flat { background: transparent; padding: 0; }
ul.facts { margin: 0; padding-left: 18px; } ul.facts li { margin: 3px 0; }

/* coverage strip */
.strip { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; margin-top: 6px; }
.strip i { display: block; height: 16px; background: var(--ok); }
.strip i.bad { background: var(--bad); } .strip i.pend { background: #8d8d8d; } .strip i.part { background: var(--warn); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--tx2); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; background: var(--c, #888); }
.legend span.line::before { height: 2px; vertical-align: 3px; } .legend span.dash::before { height: 0; border-top: 2px dashed var(--c); vertical-align: 3px; background: none; }

/* queue */
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { padding: 8px 0; border-top: 1px solid var(--bd); }
.queue li:first-child { border-top: 0; }
.queue .ev { color: var(--tx2); font-size: 12px; margin: 3px 0 0 0; padding-left: 16px; }

/* tables */
.table-wrap { overflow: auto; max-height: 75vh; }
table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.t th, table.t td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--bd); white-space: nowrap; }
table.t th { color: var(--tx2); font-weight: 600; position: sticky; top: 0; background: var(--l1); z-index: 1; }
table.t th.l, table.t td.l { text-align: left; }
table.t td.sticky, table.t th.sticky { position: sticky; left: 0; background: var(--l1); z-index: 2; }
table.t th.sticky { z-index: 3; }
table.t tr:hover td { background: #2e2e2e; } table.t tr:hover td.sticky { background: #2e2e2e; }
table.t .grp { border-left: 1px solid var(--bd2); }
table.t tr.inc td { color: #8d8d8d; } table.t tr.inc td.sticky { color: #8d8d8d; }
table.t tr.total td { font-weight: 600; border-top: 2px solid var(--bd2); }
table.t td.wrap { white-space: normal; min-width: 200px; }
table.sortable th[data-sort] { cursor: pointer; user-select: none; }
table.sortable th[data-sort]::after { content: " ↕"; color: #6f6f6f; font-weight: 400; }
table.sortable th.asc::after { content: " ↑"; color: var(--tx); } table.sortable th.desc::after { content: " ↓"; color: var(--tx); }
table.md { border-collapse: collapse; margin: 8px 0 14px; } table.md th, table.md td { border: 1px solid var(--bd); padding: 5px 8px; text-align: left; vertical-align: top; }
.bar { display: inline-block; height: 8px; background: var(--info); vertical-align: middle; margin-right: 4px; }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #393939; stroke-width: 1; }
.chart .ax { fill: #a8a8a8; font-size: 11px; font-family: "IBM Plex Sans", system-ui, sans-serif; }
.chart .tline { stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .ann { stroke: var(--purple); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .gap { fill: #ffffff08; }
.chart .hover { stroke: #f4f4f4; stroke-width: 1; opacity: .5; }
.tip { position: absolute; pointer-events: none; background: #f4f4f4; color: #161616; padding: 8px 10px; font-size: 12px; line-height: 1.35;
  min-width: 180px; max-width: 280px; box-shadow: 0 2px 6px rgba(0,0,0,.4); z-index: 10; display: none; white-space: normal; }
.tip b { font-weight: 600; } .tip .r { display: flex; justify-content: space-between; gap: 12px; }
.chart-empty { padding: 36px; text-align: center; color: var(--tx3); border: 1px dashed var(--bd); }

/* definitions / summary */
.doc { max-width: 900px; } .doc p, .doc li { color: var(--tx); } .doc blockquote { border-left: 3px solid var(--warn); margin: 0 0 12px; padding: 6px 12px; background: #2a2616; }
.doc pre { background: #262626; padding: 10px; overflow-x: auto; }
.login-wrap { display: flex; justify-content: center; padding-top: 12vh; }
.login-card { width: 340px; }
.login-card h1 { font-size: 20px; margin: 0 0 16px; }
.login-card .pw { width: 100%; padding: 10px; }
.error { color: var(--bad); }
.formgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.formgrid .wide { grid-column: span 2; } .formgrid .full { grid-column: 1 / -1; }
details summary { cursor: pointer; color: var(--link); }
.scen td input, .scen td select { width: 100%; }

@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .kpi-grid, .grid2e { grid-template-columns: 1fr; }
  .formgrid { grid-template-columns: 1fr 1fr; }
  .page { padding: 12px 10px 40px; }
  .kpi .big { font-size: 32px; }
  .brand .sub { display: none; }
  .hide-sm { display: none; }
  .kpi table.win th, .kpi table.win td { padding: 4px 3px; }
  .formgrid .wide { grid-column: 1 / -1; }
}
@media print {
  nav.tabs, .topbar-right, .statusbar, .noprint { display: none !important; }
  body, .card { background: #fff; color: #000; } a { color: #000; }
  table.t th { background: #fff; color: #000; position: static; } table.md th, table.md td { border-color: #999; }
}
