/* TRCM — design system (light, professional) */
:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --panel2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --side-bg: #0f172a;
  --side-text: #94a3b8;
  --side-active: #1e293b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------ layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column;
  padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.main { padding: 28px 32px; min-width: 0; }
.page { max-width: 1080px; margin: 0 auto; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ brand / nav */
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.logo-mark svg { width: 20px; height: 20px; }
.logo-mark.lg { width: 46px; height: 46px; border-radius: 13px; }
.logo-mark.lg svg { width: 25px; height: 25px; }
.brand-name { font-weight: 700; color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; min-height: 0; padding-bottom: 8px; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  background: transparent; border: none; color: var(--side-text);
  cursor: pointer; font-size: 13.5px; text-align: left; width: 100%;
  font-family: inherit;
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.nav-item.active { background: var(--side-active); color: #fff; }

.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-card { display: flex; gap: 10px; align-items: center; padding: 6px 4px; }
.uc-info { display: flex; flex-direction: column; gap: 2px; }
.uname { color: #fff; font-weight: 600; font-size: 13px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.avatar-lg { width: 52px; height: 52px; font-size: 20px; }

/* ------------------------------------------------ page head */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-user { display: flex; gap: 14px; align-items: center; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------ cards */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h3 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 960px) { .grid.two { grid-template-columns: 1fr; } }

/* ------------------------------------------------ stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; display: flex; gap: 12px; align-items: center;
}
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: rgba(37, 99, 235, .1); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-num { font-size: 22px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-lbl { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------ forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; letter-spacing: .2px; }
input, select, textarea {
  width: 100%; padding: 8px 11px; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff; color: var(--text); font-size: 13.5px;
  font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { min-height: 76px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.checkbox-line input { width: auto; }
.checkbox-line label { margin: 0; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 32px; }

/* ------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit;
  transition: filter .12s, background .12s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.96); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--panel2); }
.btn.success { background: var(--green); }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.badge.active { background: #dcfce7; color: #15803d; }
.badge.inactive { background: #e2e8f0; color: #475569; }
.badge.exited { background: #fef3c7; color: #b45309; }
.badge.admin { background: #dbeafe; color: #1d4ed8; }
.badge.staff { background: #e2e8f0; color: #475569; }
.badge.partner { background: #ede9fe; color: #6d28d9; }
.badge.funder { background: #dcfce7; color: #15803d; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.open { background: #dcfce7; color: #15803d; }
.badge.completed { background: #dbeafe; color: #1d4ed8; }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel2); }
.cli-cell { display: flex; gap: 10px; align-items: center; }
.cli-name { font-weight: 600; }
.cli-meta { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------ bar charts */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 46px; gap: 10px; align-items: center; }
.bar-lbl { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 999px; }
.bar-fill.amber { background: linear-gradient(90deg, #fbbf24, #d97706); }
.bar-fill.over { background: linear-gradient(90deg, #f87171, #dc2626); }
.bar-val { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ notes / lists */
.note-item { border-left: 3px solid #cbd5e1; background: var(--panel2); border-radius: 0 8px 8px 0; padding: 9px 12px; margin: 8px 0; }
.note-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.def-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2px 18px; margin: 0; }
.def-list div { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.def-list dt { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.def-list dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 500; }

/* ------------------------------------------------ empty / msg */
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.empty svg { width: 34px; height: 34px; opacity: .4; }
.empty p { margin: 8px 0 0; font-size: 13px; }
.msg { padding: 10px 13px; border-radius: 9px; margin: 12px 0; font-size: 13px; }
.msg.err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.msg.ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: nowrap; }

/* ------------------------------------------------ auth */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(1100px 500px at 20% -10%, rgba(37, 99, 235, .14), transparent),
    radial-gradient(900px 500px at 110% 110%, rgba(124, 58, 237, .12), transparent),
    var(--bg);
}
.auth-card {
  width: 380px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .12); padding: 28px;
}
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.auth-card .muted { margin: 0 0 10px; }

/* ------------------------------------------------ events */
.tip { background: #eff6ff; border-color: #bfdbfe; }
.tip b { color: #1e40af; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ev-card {
  display: flex; gap: 14px; padding: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.ev-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(15, 23, 42, .1); }
.ev-card.booked { border-color: rgba(22, 163, 74, .55); }
.ev-date {
  width: 54px; flex: none; text-align: center; align-self: flex-start;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 0;
}
.ev-d { font-size: 22px; font-weight: 700; line-height: 1.1; }
.ev-m { font-size: 10px; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.ev-body { min-width: 0; flex: 1; }
.ev-title { font-weight: 600; font-size: 14px; }
.ev-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.ev-meta svg { width: 13px; height: 13px; flex: none; }
.ev-foot { margin-top: 9px; display: flex; gap: 8px; align-items: center; }
.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel2); border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px; letter-spacing: 2px; text-align: center; font-size: 15px;
  user-select: all; margin: 10px 0;
}

/* ------------------------------------------------ budget */
.bud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bud-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.bud-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(15, 23, 42, .1); }
.bud-card.over { border-color: rgba(220, 38, 38, .5); }
.bud-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.bud-title { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bud-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.bud-nums div { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.bud-nums .lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.bud-nums .mono { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.mono.neg, .neg { color: var(--red); }
.bud-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; }
.progress { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 999px; transition: width .3s; }
.progress .fill.over { background: linear-gradient(90deg, #f87171, #dc2626); }

/* ------------------------------------------------ print */
@media print {
  body { background: #fff; color: #000; font-size: 11px; }
  /* EVPDF-05: browser print parity with the exported Community Event Report. */
  .print-only { display: block !important; }
  .table-wrap { overflow: visible !important; }
  tr, .card, .ev-card, .stat { break-inside: avoid; page-break-inside: avoid; }
  button, .btn, form, .form-row, .toolbar, .search, input, select, textarea { display: none !important; }
  .report-head { border-bottom: 1.5px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
  .report-doctype { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
  .report-title { font-size: 18px; margin: 4px 0 6px; }
  .report-meta, .report-counts { font-size: 10px; color: #333; }
  .report-attr { margin: 8px 0 4px; font-size: 11px; }
  /* The printed roster is the REPORT roster (from /api/events/:id/report-data). Only blocks
     explicitly marked .screen-only are hidden in print (the event page's own interactive
     cards). This must NOT be a blanket table rule: doing that removed tables from every other
     printable page (EVPDF-05 repair critic, finding 2.1). */
  .screen-only { display: none !important; }
  .report-roster { padding-bottom: 44px; }
  .report-roster h3 { font-size: 12px; border-bottom: 1px solid #999; padding-bottom: 3px; margin: 10px 0 6px; }
  .report-roster table { width: 100%; border-collapse: collapse; font-size: 9px; table-layout: fixed; }
  .report-roster th, .report-roster td { border-bottom: 1px solid #ccc; padding: 3px 4px; text-align: left; vertical-align: top; word-break: break-word; }
  .report-roster th { background: #eee; }
  .report-note { font-size: 9px; color: #444; margin: 6px 0 0; }
  .print-foot { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid #999; font-size: 9px; color: #444; padding-top: 3px; }
  @page { margin: 14mm 12mm; }
  .layout { display: block; }
  .sidebar, .actions, .btn-row, .toolbar, .msg, #msg, .side-foot, nav { display: none !important; }
  .main { padding: 0; }
  .page { max-width: 100%; animation: none; }
  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 17px; }
  .card { border: none; box-shadow: none; padding: 6px 0; margin-bottom: 10px; page-break-inside: avoid; }
  .card h3 { color: #000; border-bottom: 1px solid #999; padding-bottom: 3px; }
  table { font-size: 9px; }
  th { color: #000; border-bottom: 1px solid #000; }
  .badge { border: 1px solid #888; color: #000 !important; background: #fff !important; }
  .stat, .ev-card { border: 1px solid #999; box-shadow: none; page-break-inside: avoid; }
  .secret-box { border: 1px solid #999; }
  .tip { background: #fff; border: 1px solid #999; }
  .msg.err, .msg.ok { background: #fff; border: 1px solid #999; }
  input, select, textarea { display: none; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------------------------ print-only (EVPDF-05)
   Blocks carrying this class exist for the browser print path ONLY (the Community Event
   Report header, attribution and footer). Hidden on screen, shown by @media print above. */
.print-only { display: none; }

/* ------------------------------------------------ responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 68px 1fr; }
  .sidebar { padding: 14px 8px; }
  .brand { padding: 6px 6px 16px; justify-content: center; }
  .brand > div, .nav-label, .uc-info { display: none; }
  .nav-item { justify-content: center; }
  .user-card { justify-content: center; }
  .side-foot .btn { justify-content: center; }
  .main { padding: 20px 16px; }
}

/* ================================================================ */
/* CommunityPay Track — payment assurance, timelines, funder portal */
/* ================================================================ */

/* nav section label */
.nav-sec {
  margin: 14px 10px 4px; font-size: 10px; letter-spacing: 1.2px;
  text-transform: uppercase; color: #64748b; font-weight: 700;
}
.nav-sec[data-sec] { cursor: pointer; transition: color .12s; }
.nav-sec[data-sec]:hover { color: #cbd5e1; }

/* KPI cards (denser stat variant) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; position: relative; overflow: hidden;
}
.kpi .kpi-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.kpi .kpi-num { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi.green { border-top: 3px solid var(--green); }
.kpi.blue { border-top: 3px solid var(--accent); }
.kpi.amber { border-top: 3px solid var(--amber); }
.kpi.red { border-top: 3px solid var(--red); }
.kpi .kpi-num.ok { color: var(--green); }
.kpi .kpi-num.warn { color: var(--amber); }
.kpi .kpi-num.bad { color: var(--red); }

/* payment assurance component */
.assure {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  background: linear-gradient(180deg, var(--panel2), #fff);
}
.assure-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.assure-status {
  font-size: 12px; font-weight: 800; letter-spacing: 1px; padding: 5px 12px; border-radius: 999px;
}
.assure-status.COMPLETE { background: #dcfce7; color: #15803d; }
.assure-status.PROCESSING { background: #dbeafe; color: #1d4ed8; }
.assure-status.ACTION\ REQUIRED { background: #fef3c7; color: #b45309; }
.assure-status.EXCEPTION { background: #fee2e2; color: #b91c1c; }
.assure-ring { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.assure-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.assure-item {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 12.5px;
}
.assure-item .ai-ic { width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.assure-item.ok .ai-ic { background: #dcfce7; color: #15803d; }
.assure-item.no .ai-ic { background: #fef3c7; color: #b45309; }
.assure-item .ai-lbl { color: var(--muted); }

/* timeline */
.tl { position: relative; margin: 6px 0 0 6px; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--accent);
}
.tl-item.warn::before { border-color: var(--amber); }
.tl-item.err::before { border-color: var(--red); }
.tl-item.ok::before { border-color: var(--green); }
.tl-date { font-size: 11px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-action { font-weight: 600; font-size: 13px; margin-top: 1px; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tl-badge { margin-left: 6px; }

/* filter bar */
.filter-bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar .fb { min-width: 140px; }
.filter-bar label { margin: 0 0 4px; }

/* funder portal banner */
.funder-banner {
  background: linear-gradient(120deg, #0f172a, #1e3a5f); color: #fff; border-radius: 14px;
  padding: 20px 22px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.funder-banner h2 { margin: 0; font-size: 18px; color: #fff; }
.funder-banner .fb-sub { color: #94a3b8; font-size: 12.5px; margin-top: 3px; }
.funder-banner .fb-chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 12px; font-size: 11.5px; font-weight: 600; }

/* report preview doc */
.report-preview {
  font-size: 13px; line-height: 1.55;
}
.report-preview .rp-sec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.report-preview .rp-h { background: var(--panel2); padding: 8px 14px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--border); }
.report-preview .rp-b { padding: 10px 14px; }
.report-preview table { font-size: 12.5px; }

/* status badges for CommunityPay */
.badge.draft { background: #f1f5f9; color: #475569; }
.badge.pending, .badge.pending_approval, .badge.queued, .badge.processing { background: #dbeafe; color: #1d4ed8; }
.badge.approved { background: #dcfce7; color: #15803d; }
.badge.sent, .badge.delivered { background: #dcfce7; color: #15803d; }
.badge.participant_confirmed { background: #d1fae5; color: #047857; }
.badge.reconciled { background: #dcfce7; color: #15803d; }
.badge.failed, .badge.returned { background: #fee2e2; color: #b91c1c; }
.badge.reissue_required, .badge.reissued { background: #fef3c7; color: #b45309; }
.badge.cancelled { background: #e2e8f0; color: #475569; }
.badge.open { background: #fee2e2; color: #b91c1c; }
.badge.matched, .badge.resolved { background: #dcfce7; color: #15803d; }
.badge.variance { background: #fef3c7; color: #b45309; }
.badge.critical { background: #fee2e2; color: #b91c1c; }
.badge.high { background: #fef3c7; color: #b45309; }
.badge.medium { background: #dbeafe; color: #1d4ed8; }
.badge.low { background: #e2e8f0; color: #475569; }

/* Grant Ops status badges */
.badge.success { background: #dcfce7; color: #15803d; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #e2e8f0; color: #475569; }

/* status dot for assurance/timeline */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.blue { background: var(--accent); }
.dot.gray { background: #94a3b8; }

/* dual-column detail layout for payment record */
.detail-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }

/* compact action chip buttons inside tables */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.green { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.chip.red { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.chip.amber { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.chip.blue { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
