@use '../../styles/card' as card; @use '../../styles/state' as state; @use '../../styles/tokens' as t; :host { display: block; min-width: 0; } .summary-metric-card { --metric-accent: #{t.$color-text-secondary}; @include card.metric-card(default); min-height: 132px; &.compact { min-height: 108px; padding: 14px 16px; } &.size-sm { min-height: 96px; padding: 12px 14px; .metric-value-row strong { font-size: 22px; } } &.size-lg { min-height: 156px; padding: 22px 24px; .metric-value-row strong { font-size: 36px; } } &.size-xl { min-height: 148px; padding: 22px 24px; .metric-value-row strong { font-size: 40px; letter-spacing: -0.03em; } } &.variant-plain { box-shadow: none; background: t.$color-surface; border: 1px solid t.$color-border-soft; &::before { display: none; } } &.variant-elevated { box-shadow: t.$shadow-float; } &.variant-gradient-soft { background: linear-gradient(145deg, #ffffff 0%, t.$color-surface-muted 100%); } &.variant-warning { background: linear-gradient(135deg, rgba(t.$color-amber, 0.08), t.$color-surface 46%); border-color: rgba(t.$color-amber, 0.3); } &.variant-urgent { background: linear-gradient(135deg, rgba(t.$color-red, 0.11), t.$color-surface 58%); border-color: rgba(t.$color-red, 0.36); box-shadow: 0 14px 34px rgba(t.$color-red, 0.12); &::before { width: 4px; background: linear-gradient(180deg, rgba(t.$color-red, 0.98), rgba(t.$color-red, 0.42)); } .metric-icon { color: t.$color-red; background: rgba(t.$color-red, 0.1); box-shadow: none; } } &.emphasis-primary { .metric-value-row strong { color: var(--metric-accent); } } &.clickable { cursor: pointer; &::after { content: '›'; position: absolute; top: 16px; right: 14px; color: #94a3b8; font-size: 18px; line-height: 1; font-weight: 500; } &:hover { transform: translateY(-1px); background: t.$color-accent; border-color: t.$color-border; box-shadow: t.$shadow-elev-1; } &:focus-visible { @include t.focus-ring; } } &.tone-blue { --metric-accent: #{t.$color-blue}; @include card.metric-card(blue); } &.tone-green { --metric-accent: #{t.$color-green}; @include card.metric-card(green); } &.tone-amber { --metric-accent: #{t.$color-amber}; @include card.metric-card(amber); } &.tone-red { --metric-accent: #{t.$color-red}; @include card.metric-card(red); } &.tone-purple { --metric-accent: #{t.$color-purple}; @include card.metric-card(purple); } } .metric-secondary-value { margin-left: 6px; color: t.$color-text-muted; font-size: 13px; font-style: normal; font-weight: 700; } .metric-meta { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed t.$color-border-soft; color: t.$color-text-muted; font-size: 12px; strong { color: t.$color-text; font-weight: 700; font-variant-numeric: tabular-nums; } } .metric-meta-confidence { display: inline-flex; align-items: center; gap: 4px; .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; &.confidence-high { background: t.$color-green; } &.confidence-medium { background: t.$color-amber; } &.confidence-low { background: t.$color-red; } } } .metric-slot { position: relative; z-index: 1; &:empty { display: none; } } .metric-topline, .metric-value-row, .metric-footer { position: relative; z-index: 1; } .metric-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: t.$color-text-muted; font-size: 13px; font-weight: 700; } .metric-label { display: inline-flex; align-items: center; gap: 4px; } .metric-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid t.$color-border-soft; background: t.$color-surface-muted; color: t.$color-text-muted; font-size: 11px; font-weight: 600; cursor: help; position: relative; line-height: 1; &:hover, &:focus-visible { border-color: t.$color-blue; color: t.$color-blue; background: rgba(t.$color-blue, 0.08); .metric-tooltip { display: block; } } } .metric-tooltip { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.82); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 12px; font-weight: 400; line-height: 1.6; width: 260px; z-index: 1000; white-space: normal; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15); &::before { content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid rgba(0, 0, 0, 0.82); } } .metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 12px; background: t.$color-surface-muted; border: 1px solid t.$color-border-soft; box-shadow: t.$shadow-card-flat; } .metric-value-row { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; strong { color: t.$color-text; font-size: 30px; font-weight: t.$font-weight-metric; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.1; } span { color: t.$color-text-muted; font-size: 13px; font-weight: 700; } } .metric-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; color: t.$color-text-muted; font-size: 12px; line-height: 1.5; } .metric-trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; &.up { color: t.$color-green; } &.down { color: t.$color-red; } &.flat { color: t.$color-text-muted; } } .metric-skeleton { @include state.skeleton-line; position: relative; z-index: 1; &.title { width: 42%; } &.value { width: 58%; height: 30px; margin-top: 18px; } &.desc { width: 76%; margin-top: 18px; } } @media (max-width: 768px) { .summary-metric-card { min-height: 112px; padding: 14px; } .metric-topline { font-size: 12px; } .metric-icon { width: 28px; height: 28px; border-radius: 10px; } .metric-value-row { margin-top: 10px; strong { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; } } .metric-footer { margin-top: 10px; font-size: 12px; } }