/* ==========================================================
Project : Counter Doodle
Module  : Page
File    : dashboard.css
Grafik mengikuti panduan dataviz: satu seri (tanpa legend),
kolom maks 24px dengan ujung membulat 4px, grid tipis,
nilai tertinggi disebut di subjudul, tooltip per kolom.
========================================================== */

.dash-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-16);
}

.dash-head h2 { margin-bottom: var(--space-4); }

.dash-head .event-meta { align-items: center; }

.dash-full,
.dash-next {
    flex: 1 1 100%;
}

.dash-next {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.dash-next-item {
    display: flex;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-8) var(--space-12);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-sm);
}

.dash-next-item:hover { border-color: var(--color-primary); }

/* ---- angka utama ---- */

.dash-kpis {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-20);
    align-items: center;
}

.dash-hero span {
    display: block;
    color: var(--color-text-secondary);
    font-weight: var(--font-semibold);
}

.dash-hero strong {
    display: block;
    margin: var(--space-4) 0;
    font-size: var(--font-size-display);
    font-weight: var(--font-bold);
    line-height: var(--line-tight);
    letter-spacing: var(--tracking-tight);
}

.dash-hero em {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-style: normal;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.dash-delta.is-up { color: var(--color-success); }
.dash-delta.is-down { color: var(--color-danger); }

.dash-tiles { margin-top: 0; }

/* ---- grafik per jam ---- */

.hour-chart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-8);
    height: calc(var(--chart-height) + var(--space-24));
}

.hour-grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: var(--chart-height);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.hour-cols {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    height: var(--chart-height);
    border-bottom: var(--border-width) solid var(--color-border-strong);
    background:
        linear-gradient(var(--color-border), var(--color-border)) top / 100% var(--border-width) no-repeat,
        linear-gradient(var(--color-border), var(--color-border)) center / 100% var(--border-width) no-repeat;
}

.hour-col {
    position: relative;
    flex: 1 1 0;
    display: flex;
    justify-content: center;
    height: 100%;
    outline: none;
    cursor: default;
}

.hour-bar {
    width: 100%;
    max-width: var(--chart-bar-max);
    height: 100%;
    overflow: visible;
}

.hour-bar rect { fill: var(--color-chart-1); }

.hour-col:hover .hour-bar rect,
.hour-col:focus-visible .hour-bar rect {
    fill: var(--color-primary-hover);
}

.hour-col:focus-visible {
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-xs);
}

.hour-label {
    position: absolute;
    top: calc(100% + var(--space-4));
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.hour-tip {
    position: absolute;
    bottom: calc(100% + var(--space-8));
    left: 50%;
    z-index: var(--z-dropdown);
    display: none;
    flex-direction: column;
    min-width: max-content;
    padding: var(--space-8) var(--space-10);
    transform: translateX(-50%);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.hour-tip strong {
    color: var(--color-text);
    font-size: var(--font-size-md);
}

.hour-col:hover .hour-tip,
.hour-col:focus-visible .hour-tip {
    display: flex;
}

.dash-table {
    margin-top: var(--space-24);
    font-size: var(--font-size-sm);
}

.dash-table summary {
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: var(--font-semibold);
}

/* ---- daftar batang (per bank, terlaris) ---- */

.bar-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    list-style: none;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    gap: var(--space-12);
    margin-bottom: var(--space-4);
    font-variant-numeric: tabular-nums;
}

.bar-track {
    display: block;
    width: 100%;
    height: var(--bar-height-lg);
}

.bar-bg { fill: var(--color-chart-track); }
.bar-fill { fill: var(--color-chart-1); }

@media (max-width: 768px) {
    .dash-kpis { grid-template-columns: minmax(0, 1fr); }
    .dash-hero strong { font-size: var(--font-size-4xl); }
    .hour-label { font-size: var(--font-size-2xs); }
    .hour-col:nth-child(even) .hour-label { visibility: hidden; }
}
