/* Builder Metrics Module — design system compliant */

.bm-page { padding: 20px 32px; max-width: 1400px; margin: 0 auto; }

/* Header */
.bm-header { margin-bottom: 16px; }
.bm-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bm-title { font-size: 22px; font-weight: 700; color: #1E293B; letter-spacing: -0.01em; }
.bm-org-pills { display: flex; gap: 4px; }
.bm-org-pill { padding: 5px 12px; border-radius: 6px; border: 1px solid #E2E8F0; background: #fff; font-size: 12px; font-weight: 500; color: #475569; cursor: pointer; transition: all 0.15s; }
.bm-org-pill:hover { background: #F8FAFC; }
.bm-org-pill.active { background: #0369A1; color: #fff; border-color: #0369A1; }
.bm-header-meta { display: flex; gap: 10px; align-items: center; }
.bm-meta-pill { font-size: 11px; padding: 3px 9px; border-radius: 9999px; background: #F1F5F9; color: #475569; font-weight: 500; }
.bm-meta-live { background: #F0FDF4; color: #16A34A; }
.bm-meta-live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #16A34A; margin-right: 5px; animation: bm-pulse 2s ease-in-out infinite; }
@keyframes bm-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Tab bar */
.bm-tab-bar { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 2px solid #E2E8F0; }
.bm-tab { padding: 10px 18px; font-size: 13px; font-weight: 500; color: #64748B; background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.bm-tab:hover { color: #1E293B; }
.bm-tab.active { color: #0369A1; border-bottom-color: #0369A1; font-weight: 600; }

/* Sections */
.bm-section { margin-bottom: 28px; }
.bm-section-title { font-size: 15px; font-weight: 600; color: #1E293B; margin-bottom: 4px; }
.bm-section-desc { font-size: 12px; color: #64748B; margin-bottom: 14px; line-height: 1.5; }
.bm-content { min-height: 300px; }

/* Table */
.bm-table-wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.bm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bm-table thead th { background: transparent; color: #64748B; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; text-align: right; border-bottom: 2px solid #CBD5E1; white-space: nowrap; }
.bm-table thead th:first-child { text-align: left; padding-left: 16px; }
.bm-table tbody tr { border-bottom: 1px solid #E2E8F0; transition: background 0.1s; }
.bm-table tbody tr:hover { background: rgba(3,105,161,.03); }
.bm-table tbody td { padding: 9px 12px; text-align: right; font-family: 'SF Mono','Cascadia Code','Fira Code',monospace; font-size: 12px; color: #475569; }
.bm-table tbody td:first-child { text-align: left; font-family: 'DM Sans',-apple-system,sans-serif; font-size: 13px; color: #1E293B; }
.bm-row-total { background: #E2E8F0; font-weight: 700; }
.bm-row-org { font-weight: 600; }
.bm-row-svc { font-weight: 400; }
.bm-indent-0 { padding-left: 16px !important; }
.bm-indent-1 { padding-left: 28px !important; }
.bm-indent-2 { padding-left: 44px !important; }
.bm-toggle { font-size: 10px; color: #94A3B8; margin-right: 4px; }
.bm-no-data { color: #CBD5E1; font-style: italic; }

/* Cell with arrow */
.bm-cell { display: inline-flex; align-items: center; gap: 4px; }
.bm-arrow { font-size: 9px; font-weight: 700; }
.bm-arrow-good { color: #16A34A; }
.bm-arrow-bad { color: #DC2626; }

/* KPI cards */
.bm-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bm-kpi-card { flex: 1; min-width: 160px; background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.bm-kpi-val { font-family: 'SF Mono','Cascadia Code',monospace; font-size: 20px; font-weight: 700; color: #1E293B; }
.bm-kpi-label { font-size: 11px; color: #64748B; margin-top: 4px; font-weight: 500; }

/* Charts */
.bm-chart-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px; }
.bm-chart-title { font-size: 14px; font-weight: 600; color: #1E293B; margin-bottom: 2px; }
.bm-chart-desc { font-size: 11px; color: #64748B; margin-bottom: 12px; }
.bm-chart-container { height: 180px; position: relative; }

/* Footer */
.bm-footer { margin-top: 24px; padding: 12px 0; font-size: 11px; color: #94A3B8; border-top: 1px solid #E2E8F0; }

/* Unavailable state */
.bm-unavailable { text-align: center; padding: 60px 20px; }
