Files
dashboards/apps/business/src/components/DailyActivityChart.module.css
T

310 lines
4.8 KiB
CSS

.card {
background: var(--glass-bg);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--glass-border);
border-radius: var(--radius);
box-shadow: var(--glass-shadow);
padding: 24px;
height: 100%;
box-sizing: border-box;
overflow: visible;
}
.header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
margin-bottom: 24px;
}
.title {
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 4px;
}
.subtitle {
font-size: 13px;
color: var(--text-secondary);
}
.legend {
display: flex;
flex-wrap: wrap;
gap: 12px;
font-size: 12px;
color: var(--text-secondary);
}
.legendItem {
display: inline-flex;
align-items: center;
gap: 6px;
}
.legendDot {
width: 10px;
height: 10px;
border-radius: 3px;
}
.tonePrimary {
background: var(--primary);
}
.toneAccent {
background: var(--chart-accent, #a855f7);
}
.status,
.error {
font-size: 14px;
text-align: center;
padding: 40px 12px;
}
.status {
color: var(--text-muted);
}
.error {
color: #dc2626;
}
.chartPanel {
display: flex;
flex-direction: row;
align-items: flex-end;
gap: 8px;
direction: ltr;
unicode-bidi: isolate;
padding-top: 28px;
overflow: visible;
}
.yAxis {
display: flex;
flex-direction: column;
justify-content: space-between;
flex-shrink: 0;
width: 40px;
padding-bottom: 22px;
box-sizing: border-box;
direction: ltr;
}
.yTick {
font-size: 10px;
color: var(--text-muted);
font-weight: 500;
font-family: var(--font-ui);
line-height: 1;
text-align: right;
}
.chartWrap {
position: relative;
flex: 1;
min-width: 0;
overflow: visible;
}
.chartGrid {
position: absolute;
inset-inline: 0;
bottom: 22px;
pointer-events: none;
z-index: 0;
}
.gridLine {
position: absolute;
left: 0;
right: 0;
border-top: 1px dashed color-mix(in srgb, var(--text-muted) 28%, transparent);
}
.chart {
position: relative;
z-index: 1;
display: flex;
flex-direction: row;
align-items: flex-end;
width: 100%;
padding-bottom: 4px;
direction: ltr;
unicode-bidi: isolate;
}
.chartDay {
gap: 2px;
}
.chartMonth {
gap: 4px;
overflow: visible;
}
.group {
flex: 1 1 0;
min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.chartDay .group {
gap: 4px;
}
.chartMonth .group {
flex: 1 1 0;
min-width: 0;
}
.bars {
display: flex;
align-items: flex-end;
justify-content: center;
width: 100%;
height: 180px;
gap: 3px;
}
.barWrap {
position: relative;
display: flex;
flex: 1 1 0;
align-items: flex-end;
justify-content: center;
width: 100%;
min-width: 0;
height: 100%;
z-index: 1;
}
.chartMonth .barWrap {
flex: 0 0 auto;
width: auto;
}
.barWrap:hover,
.barWrap:focus-within {
z-index: 1000;
}
.barWrap:hover .barTooltip,
.barWrap:focus-within .barTooltip {
opacity: 1;
visibility: visible;
}
.barTooltip {
position: absolute;
bottom: calc(100% + 6px);
left: 50%;
transform: translateX(-50%);
padding: 4px 8px;
font-size: 11px;
font-weight: 500;
font-family: var(--font-ui);
line-height: 1.35;
color: var(--text-primary);
white-space: nowrap;
pointer-events: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.12s ease, visibility 0.12s;
background: var(--elevated-surface);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid var(--glass-border);
border-radius: 6px;
box-shadow: 0 6px 18px rgba(31, 38, 135, 0.18);
z-index: 10000;
}
.bar {
position: relative;
flex: none;
width: 80%;
max-width: 14px;
min-width: 8px;
border-radius: 3px 3px 1px 1px;
transition: height 0.3s ease;
cursor: default;
}
.chartMonth .bar {
width: 12px;
max-width: none;
min-width: 12px;
border-radius: 4px 4px 2px 2px;
}
.barWrap:hover .bar,
.barWrap:focus-within .bar {
filter: brightness(1.06);
}
.barMonth {
width: 12px;
max-width: 12px;
}
.label {
display: flex;
align-items: center;
justify-content: center;
font-size: 9px;
color: var(--text-muted);
font-weight: 500;
font-family: var(--font-ui);
line-height: 1;
text-align: center;
width: 100%;
overflow: hidden;
}
.chartMonth .label {
height: 68px;
}
.chartMonth .labelText {
writing-mode: vertical-rl;
transform: rotate(180deg);
white-space: nowrap;
max-height: 68px;
overflow: hidden;
text-overflow: ellipsis;
font-size: 10px;
line-height: 1.2;
letter-spacing: 0.04em;
}
.barPrimary {
background: linear-gradient(
180deg,
color-mix(in srgb, var(--primary) 55%, #ffffff) 0%,
var(--primary) 100%
);
}
.barAccent {
background: linear-gradient(
180deg,
color-mix(in srgb, var(--chart-accent, #a855f7) 55%, #ffffff) 0%,
var(--chart-accent, #a855f7) 100%
);
}
@media (max-width: 768px) {
.header {
flex-direction: column;
}
}