/* ==========================================================================
   HUVI Design System - Analytics Dashboard Styles (Stitch Design f47a6e656592428a96511dbee4dda6fe)
   KPI Metric Cards, Curved Area Chart & Top Sources Progress Bars
   ========================================================================== */

.material-dashboard-container {
    margin-bottom: 28px;
}

/* 4 Thẻ KPI Metrics Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px 22px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 20px -2px rgba(12, 97, 58, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -2px rgba(12, 97, 58, 0.1);
}

.kpi-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-green {
    background: #ecfdf5;
    color: #00a657;
}

.kpi-icon-amber {
    background: #fef3c7;
    color: #d97706;
}

.kpi-body {
    margin-top: 10px;
}

.kpi-val-bold {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    color: #0c613a;
    letter-spacing: -0.02em;
}

.kpi-sub-active {
    margin: 6px 0 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #00a657;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot-green {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #00a657;
    display: inline-block;
}

.kpi-sub-text {
    margin: 6px 0 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.kpi-val-truncate {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.kpi-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.kpi-clicks-badge-red {
    background: rgba(218, 31, 38, 0.1);
    color: #da1f26;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

.kpi-sub-muted {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}

/* Charts Grid (2 Cols Left + 1 Col Right) */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 960px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 20px -2px rgba(12, 97, 58, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chart-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-title-text {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0c613a;
}

.chart-desc-text {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

.chart-badge-realtime {
    background: #ecfdf5;
    color: #00a657;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid #d1fae5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.04em;
}

.realtime-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: #00a657;
}

.chart-body {
    padding: 20px 24px;
    flex: 1;
}

.chart-main .chart-body {
    position: relative !important;
    height: 240px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Side Stats: Country Progress Bars & Referrers */
.side-sub-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.side-empty-notice {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 0;
}

.country-bars-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.country-bar-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 10px 14px;
}

.country-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.country-code-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-code-pill {
    font-weight: 800;
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 6px;
}

.country-code-pill.code-vn {
    background: #e6f7ef;
    color: #0c613a;
}

.country-code-pill.code-other {
    background: #e2e8f0;
    color: #334155;
}

.country-name-text {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.country-clicks-count {
    font-size: 14px;
    font-weight: 800;
    color: #00a657;
}

.country-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.country-progress-fill {
    height: 100%;
    background: #00a657;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.referrers-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.referrer-item-stitch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}

.referrer-domain-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ref-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    flex-shrink: 0;
}

.ref-domain-name {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.ref-count-badge {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}
