/* ============================================================
   Business Dashboard — scoped styles (.db-*)
   ============================================================ */

.db-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1180px) { .db-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .db-kpis { grid-template-columns: 1fr 1fr; } }

.db-kpi {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 15px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden;
}
.db-kpi.hero { background: linear-gradient(135deg, #0c1322 0%, #1e2b52 100%); border-color: #1e2b52; color: #fff; }
.db-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.db-kpi-label { font-size: 12px; color: var(--text-muted); }
.db-kpi.hero .db-kpi-label { color: #9fb3c8; }
.db-kpi-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--bg-muted); color: var(--text-soft); flex-shrink: 0; }
.db-kpi.hero .db-kpi-ic { background: rgba(255,255,255,0.1); color: #c3c4ff; }
.db-kpi-val { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-feature-settings: 'tnum'; line-height: 1.1; }
.db-kpi-val .cur { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.db-kpi.hero .db-kpi-val .cur { color: #9fb3c8; }
.db-kpi-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.db-kpi.hero .db-kpi-sub { color: #9fb3c8; }
.db-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-family: var(--font-mono); font-size: 11.5px; }
.db-delta.up { color: var(--ok-fg); } .db-delta.down { color: var(--crit-fg); }
.db-kpi.hero .db-delta.up { color: #6fe0a0; } .db-kpi.hero .db-delta.down { color: #f4a0a0; }
.db-spark { height: 30px; width: 100%; margin-top: 2px; }

.db-main { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .db-main { grid-template-columns: 1fr; } }

.db-chart-totals { display: flex; gap: 22px; margin-bottom: 6px; }
.db-chart-total .k { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.db-chart-total .v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-feature-settings: 'tnum'; margin-top: 2px; }
.db-chart-svg { width: 100%; height: 200px; display: block; }
.db-legend { display: flex; gap: 16px; margin-top: 6px; }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.db-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.db-legend i.dot { width: 9px; height: 9px; border-radius: 999px; }

/* profit structure */
.db-break-bar { display: flex; height: 32px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.db-break-bar > span { display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; min-width: 0; overflow: hidden; }
.db-break-list { display: flex; flex-direction: column; margin-top: 12px; }
.db-break-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.db-break-row:first-child { border-top: 0; }
.db-break-row .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.db-break-row .nm { flex: 1; color: var(--text-soft); }
.db-break-row .pct { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); width: 44px; text-align: right; }
.db-break-row .amt { font-family: var(--font-mono); font-size: 13px; font-weight: 600; width: 92px; text-align: right; }
.db-break-row.profit { border-top: 1.5px solid var(--border-strong); margin-top: 2px; }
.db-break-row.profit .nm, .db-break-row.profit .amt { font-weight: 700; color: var(--ok-fg); }

.db-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .db-cols { grid-template-columns: 1fr; } }

.db-rank { width: 20px; height: 20px; border-radius: 6px; background: var(--bg-muted); border: 1px solid var(--border); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-muted); font-family: var(--font-mono); }
.db-bar-mini { height: 5px; border-radius: 999px; background: var(--bg-active); overflow: hidden; margin-top: 5px; }
.db-bar-mini > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

.db-risk-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.db-risk-row:first-child { border-top: 0; }
.db-risk-days { font-family: var(--font-mono); font-weight: 700; font-size: 15px; width: 56px; flex-shrink: 0; }
.db-risk-days.crit { color: var(--crit-fg); } .db-risk-days.warn { color: var(--warn-fg); } .db-risk-days.ok { color: var(--ok-fg); }
.db-risk-info { flex: 1; min-width: 0; }
.db-risk-info .t { font-size: 13px; font-weight: 500; }
.db-risk-info .s { font-size: 11.5px; color: var(--text-muted); }

/* ops strip */
.db-ops { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .db-ops { grid-template-columns: 1fr; } }
.db-attn-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.db-attn-row:first-child { border-top: 0; }
.db-attn-row .txt { flex: 1; min-width: 0; }
.db-attn-row .txt .t { font-size: 13px; }
.db-attn-row .txt .s { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.db-health { display: flex; flex-direction: column; gap: 0; }
.db-health-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.db-health-row:first-child { border-top: 0; }
.db-health-row .k { color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.db-health-row .v { font-family: var(--font-mono); font-size: 12.5px; }
