/* Complete Billing Check — POP house style: hairline rules, one accent, no gradients. */
:root {
  --pink:   #EC1A61;
  --plum:   #2C1336;
  --canvas: #F6F2EC;
  --ink:    #1A1118;
  --muted:  #6B6270;
  --line:   #DDD6CC;
  --card:   #FFFFFF;
  --high:   #C0143F;
  --med:    #B5741A;
  --low:    #6B6270;
  --ok:     #17694A;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: Helvetica, "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- chrome ---------- */
.topbar {
  background: var(--plum);
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  /* The nav is long. Keep the identity block on the same line and let the nav
     itself scroll rather than wrapping the whole bar onto two rows. */
  flex-wrap: nowrap;
}
.topbar .brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 16px;
  margin-right: 8px;
  white-space: nowrap;
}
.topbar .brand span { color: var(--pink); }
.topbar nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  /* min-width:0 is what actually lets a flex child shrink below its content,
     so the bar stays one row and the nav scrolls instead of being clipped. */
  min-width: 0;
  flex: 0 1 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: rgba(255,255,255,0.75);
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 14px;
  white-space: nowrap;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.topbar nav a.on { color: #fff; background: var(--pink); }
.topbar .spacer { flex: 1 0 12px; }
.topbar .who { display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: 0 0 auto; }
.topbar form { margin: 0; }
.topbar select {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }

h1 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 16px; letter-spacing: -0.01em; margin: 32px 0 10px; font-weight: 700; }
h2:first-child { margin-top: 0; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 62ch; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 28px; }
.tile { background: var(--card); padding: 16px 18px; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile.alert .v { color: var(--high); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; white-space: nowrap; background: #FBF9F6; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FBF9F6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
.neg { color: var(--ok); }
.pos { color: var(--high); }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.pill.high { background: #FBE7EC; color: var(--high); }
.pill.medium { background: #FCF1E0; color: var(--med); }
.pill.low, .pill.info { background: #EFECE7; color: var(--low); }
.pill.claim { background: #FBE7EC; color: var(--high); }
.pill.review { background: #EFECE7; color: var(--low); }
.pill.open { background: #FBE7EC; color: var(--high); }
.pill.investigating { background: #FCF1E0; color: var(--med); }
.pill.disputed { background: #FCF1E0; color: var(--med); }
.pill.recovered, .pill.resolved_by_supplier { background: #E4F0EA; color: var(--ok); }
.pill.accepted, .pill.not_an_issue { background: #EFECE7; color: var(--low); }
.pill.imported { background: #E4F0EA; color: var(--ok); }
.pill.duplicate { background: #FCF1E0; color: var(--med); }
.pill.rejected { background: #FBE7EC; color: var(--high); }
.pill.control { background: #EFECE7; color: var(--low); }
.pill.detail { background: #EDE9F1; color: var(--plum); }

/* ---------- forms / buttons ---------- */
.btn {
  display: inline-block; background: var(--pink); color: #fff; border: 0;
  padding: 9px 16px; border-radius: 3px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #d01554; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--plum); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
input[type=text], input[type=file], input[type=password], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: #fff; max-width: 100%;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); padding: 20px; margin-bottom: 20px; }
.note { background: #FBF9F6; border-left: 2px solid var(--pink); padding: 12px 16px; margin: 16px 0; font-size: 14px; }
.note.warn { border-left-color: var(--med); }
.note.bad { border-left-color: var(--high); }
.note.good { border-left-color: var(--ok); }

.dropzone { border: 1px dashed var(--line); background: #FBF9F6; padding: 28px; text-align: center; border-radius: 4px; }
.dropzone.hot { border-color: var(--pink); background: #fff; }

/* ---------- month bars ---------- */
.bar { display: block; height: 8px; background: var(--pink); border-radius: 2px; min-width: 1px; }
.bar.mut { background: var(--line); }
.barcell { width: 180px; }

details.detail { margin: 0; }
details.detail summary { cursor: pointer; color: var(--pink); font-size: 13px; }
details.detail > div { margin-top: 8px; padding: 10px; background: #FBF9F6; border: 1px solid var(--line); font-size: 13px; }
details.detail table { font-size: 12px; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.right { text-align: right; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; }

@media (max-width: 860px) {
  /* Narrow screens get the two-row bar back — scrolling a nav you cannot see
     the ends of is worse than wrapping it. */
  .topbar { flex-wrap: wrap; padding: 8px 14px; gap: 8px 16px; }
  .topbar nav { flex-wrap: wrap; overflow: visible; }
  .topbar .spacer { flex-basis: 100%; height: 0; }
}
@media (max-width: 640px) {
  .tile .v { font-size: 21px; }
  .wrap { padding: 18px 14px 48px; }
}
