/* Issue Reporter (visitor-submitted accessibility issues → owner review). Shared
   suite shell comes from app-chrome.css + menu.js + assistant.js; this styles the
   app-specific hero, stat cards, filters, reports table and detail slide-over.
   Fonts: Poppins (headings) + Mulish (body). Status conveyed by dot + label. */

:root {
  --fb-navy: #16273F; --fb-ink: #33404F; --fb-muted: #5B6675; --fb-faint: #8791A0;
  --fb-line: #EAEDF3; --fb-line-soft: #F1F4F8; --fb-red: #E8402A; --fb-blue: #2F6FE0;
  --fb-green: #1FA97A; --fb-amber: #D19A1E;
  --fb-card-shadow: 0 4px 16px rgba(18,38,63,0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Mulish', system-ui, sans-serif; color: var(--fb-ink); background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell .rm-header-inner, .app-shell .rm-footer-inner { max-width: 90%; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
@keyframes fbFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fbSpin { to { transform: rotate(360deg); } }
@keyframes fbShimmer { 0% { background-position: -450px 0; } 100% { background-position: 450px 0; } }

/* ---- Hero ---- */
.fb-hero { background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0)); border-bottom: 1px solid var(--fb-line); }
.fb-hero-inner { max-width: 90%; margin: 0 auto; padding: 28px 32px 22px; }
.fb-title { font-family: 'Poppins'; font-weight: 700; font-size: 30px; line-height: 1.05; margin: 0; letter-spacing: -0.5px; color: var(--fb-navy); }
.fb-subtitle { font-family: 'Mulish'; font-weight: 500; font-size: 14.5px; color: var(--fb-muted); line-height: 1.55; margin: 8px 0 0; max-width: 720px; }

/* ---- Main ---- */
.fb-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 32px 32px 56px; }
#fbContent > div { animation: fbFadeUp 0.4s ease both; }
.fb-prompt { text-align: center; color: var(--fb-faint); font-size: 15px; padding: 60px 20px; }
.fb-card { background: #fff; border: 1px solid var(--fb-line); border-radius: 20px; box-shadow: var(--fb-card-shadow); }
.fb-error { padding: 40px 24px; text-align: center; color: #C0392B; font-size: 14px; }

/* ---- Stat cards ---- */
.fb-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.fb-stat { background: #fff; border: 1px solid var(--fb-line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--fb-card-shadow); }
.fb-stat-label { font-family: 'Poppins'; font-weight: 700; font-size: 13.5px; color: var(--fb-faint); margin-bottom: 10px; }
.fb-stat-value { font-family: 'Poppins'; font-weight: 800; font-size: 32px; line-height: 1; }

/* ---- Toolbar (search + sort) ---- */
.fb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.fb-head h2 { font-family: 'Poppins'; font-weight: 700; font-size: 22px; color: var(--fb-navy); margin: 0 0 4px; }
.fb-head-sub { font-size: 14px; color: var(--fb-faint); }
.fb-search { position: relative; display: inline-flex; align-items: center; }
.fb-search svg { position: absolute; left: 13px; pointer-events: none; }
.fb-search input { padding: 10px 14px 10px 38px; border: 1px solid #DCE1E9; border-radius: 12px; font-family: 'Mulish'; font-size: 14px; color: var(--fb-navy); min-width: 240px; outline: none; background: #fff; }
.fb-search input:focus-visible { border-color: var(--fb-blue); box-shadow: 0 0 0 3px rgba(47,111,224,0.15); }

/* ---- Filters ---- */
.fb-filters { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.fb-filter-label { font-family: 'Poppins'; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--fb-faint); margin-bottom: 8px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: 'Poppins'; font-weight: 600; font-size: 13px; color: var(--fb-muted); background: #fff; border: 1.5px solid #E4E9F1; border-radius: 999px; padding: 7px 14px; }
.fb-chip:hover { border-color: #CBD6E4; }
.fb-chip.active { font-weight: 700; }
.fb-chip-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---- Table ---- */
.fb-table { background: #fff; border: 1px solid var(--fb-line); border-radius: 18px; box-shadow: var(--fb-card-shadow); overflow: hidden; }
.fb-thead, .fb-row { display: grid; grid-template-columns: 150px minmax(0, 2.2fr) minmax(0, 1.3fr) 120px 110px 28px; gap: 16px; align-items: center; }
.fb-thead { padding: 14px 24px; background: #FAFBFD; border-bottom: 1px solid var(--fb-line); }
.fb-th { font-family: 'Poppins'; font-weight: 700; font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--fb-faint); }
.fb-row { padding: 15px 24px; border: none; border-bottom: 1px solid var(--fb-line-soft); background: none; width: 100%; cursor: pointer; text-align: left; }
.fb-row:last-child { border-bottom: none; }
.fb-row:hover { background: #FBFCFE; }
.fb-row:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: -2px; }
.fb-cat-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'Poppins'; font-weight: 600; font-size: 12px; color: var(--fb-navy); background: #F4F6FA; border: 1px solid #E7EBF1; border-radius: 999px; padding: 4px 10px; justify-self: start; }
.fb-desc { font-size: 13.5px; color: var(--fb-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-page { font-size: 12.5px; color: var(--fb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.fb-when { font-size: 12.5px; color: var(--fb-faint); }
.fb-status-pill { display: inline-flex; align-items: center; gap: 6px; font-family: 'Poppins'; font-weight: 700; font-size: 12px; border-radius: 999px; padding: 4px 10px; justify-self: start; }
.fb-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.fb-noresults { padding: 48px 24px; text-align: center; color: var(--fb-faint); font-size: 14.5px; }

/* ---- Empty / first-run ---- */
.fb-empty { border: 1px solid var(--fb-line); border-radius: 20px; box-shadow: var(--fb-card-shadow); background: #fff; padding: 60px 32px; text-align: center; }
.fb-empty-icon { display: inline-flex; width: 78px; height: 78px; border-radius: 22px; background: #EEF3FF; align-items: center; justify-content: center; margin-bottom: 20px; }
.fb-empty h2 { font-family: 'Poppins'; font-weight: 700; font-size: 22px; color: var(--fb-navy); margin: 0 0 8px; }
.fb-empty p { font-size: 14.5px; color: var(--fb-muted); line-height: 1.6; max-width: 520px; margin: 0 auto; }

/* ---- Skeleton (loading) ---- */
.fb-sk { background: #EEF1F6; background-image: linear-gradient(90deg, #EEF1F6 0, #F6F8FC 220px, #EEF1F6 440px); background-size: 900px 100%; animation: fbShimmer 1.3s linear infinite; border-radius: 8px; }
.fb-sk-row { display: flex; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--fb-line-soft); }

/* ---- Detail slide-over ---- */
.fb-detail-overlay { position: fixed; inset: 0; background: rgba(16,26,40,0.5); z-index: 65; opacity: 0; transition: opacity 0.25s ease; }
.fb-detail-overlay.open { opacity: 1; }
.fb-detail { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw; background: #fff; z-index: 66; box-shadow: -16px 0 48px rgba(16,26,40,0.22); transform: translateX(102%); transition: transform 0.3s cubic-bezier(.22,.61,.36,1); }
.fb-detail.open { transform: translateX(0); }
.fb-detail-inner { display: flex; flex-direction: column; height: 100%; }
.fb-detail-top { flex: 0 0 auto; padding: 22px 26px; border-bottom: 1px solid #EFF1F6; }
.fb-detail-titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fb-detail-pills { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fb-detail-title { font-family: 'Poppins'; font-weight: 700; font-size: 18px; color: var(--fb-navy); margin: 0; line-height: 1.35; }
.fb-detail-close { width: 38px; height: 38px; border-radius: 11px; background: #F4F6FA; border: 1px solid #E4E8EF; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fb-detail-close:hover { background: #EBEFF5; }
.fb-detail-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 26px; display: flex; flex-direction: column; gap: 22px; }
.fb-detail-h3 { font-family: 'Poppins'; font-weight: 700; font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--fb-faint); margin: 0 0 8px; }
.fb-detail-desc { font-size: 14.5px; color: var(--fb-ink); line-height: 1.6; white-space: pre-wrap; }
.fb-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.fb-meta-label { font-family: 'Poppins'; font-weight: 700; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--fb-faint); margin-bottom: 4px; }
.fb-meta-value { font-size: 14px; color: var(--fb-navy); word-break: break-word; }
.fb-meta-value a { color: var(--fb-blue); }
.fb-status-seg { display: inline-flex; background: #F1F4F9; border: 1px solid #E5E9F0; border-radius: 10px; padding: 3px; gap: 3px; }
.fb-status-btn { appearance: none; border: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 8px; background: transparent; color: var(--fb-muted); }
.fb-status-btn.active { color: #fff; }
.fb-detail-foot { flex: 0 0 auto; border-top: 1px solid #EFF1F6; padding: 16px 26px; display: flex; gap: 10px; justify-content: space-between; align-items: center; background: #FBFCFE; }
.fb-btn-ghost { appearance: none; background: #fff; border: 1px solid #DCE1E9; color: var(--fb-navy); font-family: 'Poppins'; font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 11px; cursor: pointer; }
.fb-btn-ghost:hover { border-color: var(--fb-navy); }
.fb-btn-danger { appearance: none; background: none; border: none; color: #C0392B; font-family: 'Poppins'; font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 6px; }
.fb-btn-danger:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .fb-stat-grid { grid-template-columns: 1fr 1fr; }
  .fb-thead, .fb-row { grid-template-columns: 130px minmax(0,2fr) 100px 26px; }
  .fb-th.fb-col-page, .fb-th.fb-col-when, .fb-page, .fb-when { display: none; }
}
@media (max-width: 560px) {
  .fb-hero-inner, .fb-main { padding-left: 18px; padding-right: 18px; }
  .fb-stat-grid { grid-template-columns: 1fr; }
}

/* ============ Expanded Issue Reporter (severity/SLA/workflow/metrics) ============ */
/* Tab bar */
.fb-tabbar { background: #fff; border-bottom: 1px solid #E7EBF1; box-shadow: 0 1px 2px rgba(18,38,63,0.03); }
.fb-tabbar-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 38px; }
.fb-tab { appearance: none; background: none; border: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 16px; color: var(--fb-faint); padding: 16px 2px; border-bottom: 3px solid transparent; }
.fb-tab:hover { color: var(--fb-muted); }
.fb-tab.active { font-weight: 700; color: var(--fb-navy); border-bottom-color: var(--fb-red); }
.fb-tab:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: 2px; border-radius: 4px; }
.fb-stat-sub { font-size: 12px; color: var(--fb-faint); margin-top: 4px; }
.fb-muted { color: var(--fb-faint); font-size: 13.5px; }

/* Sort segmented */
.fb-sort { display: inline-flex; align-items: center; gap: 8px; }
.fb-sort-label { font-size: 12.5px; color: var(--fb-faint); font-family: 'Poppins'; font-weight: 600; }
.fb-seg { display: inline-flex; background: #F1F4F9; border: 1px solid #E5E9F0; border-radius: 10px; padding: 3px; gap: 3px; }
.fb-seg-btn { appearance: none; border: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 13px; padding: 7px 13px; border-radius: 8px; background: transparent; color: var(--fb-muted); }
.fb-seg-btn.active { background: #3C7CE0; color: #fff; box-shadow: 0 2px 6px rgba(60,124,224,0.35); }

/* Backlog table (6 columns) */
.fb-thead, .fb-row { grid-template-columns: 70px minmax(0, 2.4fr) 150px 130px 96px 28px; }
.fb-sev-pill { display: inline-flex; align-items: center; justify-content: center; font-family: 'Poppins'; font-weight: 800; font-size: 12.5px; border-radius: 999px; padding: 4px 10px; justify-self: start; letter-spacing: 0.3px; }
.fb-row-sub { font-size: 12px; color: var(--fb-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-sla { display: inline-flex; align-items: center; gap: 6px; font-family: 'Poppins'; font-weight: 700; font-size: 12px; border-radius: 999px; padding: 4px 10px; justify-self: start; }
.fb-sla::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.fb-sla.ok { color: #1FA97A; background: #E7F7F1; } .fb-sla.ok::before { background: #1FA97A; }
.fb-sla.breach { color: #C0392B; background: #FCECEC; } .fb-sla.breach::before { background: #C0392B; }
.fb-sla.met { color: #5B6675; background: #EEF1F6; } .fb-sla.met::before { background: #8791A0; }

/* Metrics — KPI cards */
.fb-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.fb-kpi { background: #fff; border: 1px solid var(--fb-line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--fb-card-shadow); }
.fb-kpi-label { font-family: 'Poppins'; font-weight: 700; font-size: 13.5px; color: var(--fb-faint); margin-bottom: 8px; }
.fb-kpi-value { font-family: 'Poppins'; font-weight: 800; font-size: 34px; line-height: 1; }
.fb-kpi-sub { font-size: 12px; color: var(--fb-faint); margin-top: 6px; }
.fb-metric-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; margin-bottom: 22px; align-items: start; }
.fb-panel { background: #fff; border: 1px solid var(--fb-line); border-radius: 20px; padding: 22px 24px; box-shadow: var(--fb-card-shadow); }
.fb-panel-title { font-family: 'Poppins'; font-weight: 700; font-size: 16px; color: var(--fb-navy); margin: 0 0 16px; }
.fb-panel-note { font-family: 'Mulish'; font-weight: 600; font-size: 12px; color: var(--fb-faint); margin-left: 8px; }
.fb-bars { display: flex; flex-direction: column; gap: 14px; }
.fb-bar-row { display: flex; align-items: center; gap: 14px; }
.fb-bar-label { flex: 0 0 96px; font-family: 'Poppins'; font-weight: 700; font-size: 12.5px; }
.fb-bar-count { flex: 0 0 28px; font-family: 'Poppins'; font-weight: 700; font-size: 14px; color: var(--fb-navy); }
.fb-bar-track { flex: 1; height: 12px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 999px; }
.fb-avg-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fb-line-soft); font-size: 12.5px; color: var(--fb-muted); flex-wrap: wrap; }
.fb-avg-row strong { color: var(--fb-navy); font-family: 'Poppins'; }
.fb-status-counts { display: flex; flex-direction: column; gap: 12px; }
.fb-status-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-status-num { font-family: 'Poppins'; font-weight: 800; font-size: 18px; color: var(--fb-navy); }
.fb-trend { display: flex; flex-direction: column; gap: 12px; }
.fb-trend-row { display: flex; align-items: center; gap: 14px; }
.fb-trend-name { flex: 0 0 130px; font-size: 13.5px; color: var(--fb-navy); }
.fb-trend-bar { flex: 1; height: 10px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.fb-trend-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7A5AF0, #9B82F5); }
.fb-trend-count { flex: 0 0 28px; text-align: right; font-family: 'Poppins'; font-weight: 700; font-size: 13.5px; color: var(--fb-navy); }

/* Detail — SLA card, severity segmented, status steps, replies, export */
.fb-sla-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--fb-line); background: #FBFCFE; }
.fb-sla-card.breach { background: #FCECEC; border-color: #F5D5D5; }
.fb-sla-card.met { background: #E7F7F1; border-color: #CDEDE1; }
.fb-sla-item { display: flex; flex-direction: column; gap: 2px; }
.fb-sla-k { font-family: 'Poppins'; font-weight: 700; font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--fb-faint); }
.fb-sla-v { font-family: 'Poppins'; font-weight: 700; font-size: 13.5px; color: var(--fb-navy); }
.fb-sla-sla { font-family: 'Mulish'; font-weight: 600; font-size: 12px; color: var(--fb-faint); }
.fb-sev-seg, .fb-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-sev-opt { appearance: none; cursor: pointer; font-family: 'Poppins'; font-weight: 800; font-size: 13px; color: var(--fb-muted); background: #fff; border: 1.5px solid #E4E9F1; border-radius: 9px; padding: 8px 14px; }
.fb-sev-opt.active { color: #fff; border-color: transparent; }
.fb-step { appearance: none; cursor: pointer; font-family: 'Poppins'; font-weight: 600; font-size: 12.5px; color: var(--fb-muted); background: #fff; border: 1.5px solid #E4E9F1; border-radius: 999px; padding: 7px 13px; }
.fb-step.active { color: #fff; }
.fb-replies { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.fb-reply { background: #F6F8FC; border: 1px solid #E7EBF1; border-radius: 12px; padding: 11px 14px; }
.fb-reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.fb-reply-author { font-family: 'Poppins'; font-weight: 700; font-size: 13px; color: var(--fb-navy); }
.fb-reply-when { font-size: 12px; color: var(--fb-faint); }
.fb-reply-msg { font-size: 13.5px; color: var(--fb-ink); line-height: 1.5; white-space: pre-wrap; }
.fb-reply-compose { display: flex; flex-direction: column; gap: 8px; }
.fb-reply-input { width: 100%; font-family: 'Mulish'; font-size: 14px; color: var(--fb-navy); background: #F6F8FC; border: 1.6px solid #E4E9F1; border-radius: 11px; padding: 10px 12px; outline: none; resize: vertical; }
.fb-reply-input:focus { border-color: var(--fb-blue); background: #fff; }
.fb-reply-send { align-self: flex-end; appearance: none; border: none; background: var(--fb-blue); color: #fff; font-family: 'Poppins'; font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }
.fb-reply-send:hover { background: #2159c0; }
.fb-export { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-export-btn { appearance: none; cursor: pointer; font-family: 'Poppins'; font-weight: 700; font-size: 13px; color: var(--fb-navy); background: #fff; border: 1.5px solid #DCE1E9; border-radius: 10px; padding: 8px 16px; }
.fb-export-btn:hover { border-color: var(--fb-navy); }
.fb-export-note { font-size: 12.5px; color: #1FA97A; }

@media (max-width: 1000px) { .fb-kpi-grid { grid-template-columns: 1fr 1fr; } .fb-metric-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .fb-thead, .fb-row { grid-template-columns: 64px minmax(0,2fr) 120px 26px; }
  .fb-th.fb-col-cat, .fb-th.fb-col-sla, .fb-col-cat, .fb-col-sla { display: none; }
}
