/* Dashboard Custom Stylesheet */
.dashboard-wrapper {
    padding: 12px 16px;
    background-color: #f4f6f9;
    min-height: calc(100vh - 60px);
}

/* KPI Stat Cards Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #007bff;
}

.kpi-card.kpi-nhansu::before { background-color: #0284c7; }
.kpi-card.kpi-khachhang::before { background-color: #8b5cf6; }
.kpi-card.kpi-baogia::before { background-color: #f59e0b; }
.kpi-card.kpi-quy::before { background-color: #003399; }
.kpi-card.kpi-thu::before { background-color: #10b981; }
.kpi-card.kpi-chi::before { background-color: #ef4444; }
.kpi-card.kpi-thuchi::before { background-color: #0d9488; }

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.kpi-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin: 0;
}

.kpi-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.kpi-nhansu .kpi-icon-wrap { background: #e0f2fe; color: #0284c7; }
.kpi-khachhang .kpi-icon-wrap { background: #f3e8ff; color: #8b5cf6; }
.kpi-baogia .kpi-icon-wrap { background: #fef3c7; color: #d97706; }
.kpi-quy .kpi-icon-wrap { background: #e0e7ff; color: #003399; }
.kpi-thu .kpi-icon-wrap { background: #d1fae5; color: #059669; }
.kpi-chi .kpi-icon-wrap { background: #fee2e2; color: #dc2626; }
.kpi-thuchi .kpi-icon-wrap { background: #ccfbf1; color: #0d9488; }

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 4px 0 8px 0;
    line-height: 1.2;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.kpi-thuchi-body {
    margin: 4px 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-thuchi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-thuchi-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
}

.kpi-thuchi-val {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.kpi-thuchi-val.val-thu {
    color: #059669;
}

.kpi-thuchi-val.val-chi {
    color: #dc2626;
}

.kpi-thuchi-val small {
    font-size: 11px;
    font-weight: normal;
    color: #64748b;
}

.kpi-subdetails {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.kpi-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.kpi-badge-primary { background: #e0f2fe; color: #0369a1; }
.kpi-badge-pink { background: #fce7f3; color: #be185d; }
.kpi-badge-success { background: #dcfce7; color: #15803d; }
.kpi-badge-warning { background: #fef3c7; color: #b45309; }
.kpi-badge-danger { background: #fee2e2; color: #b91c1c; }

/* Content Cards Grid */
.dashboard-grid-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -8px;
    margin-left: -8px;
}

.dashboard-grid-col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 8px 16px 8px;
}

.dashboard-grid-col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 8px 16px 8px;
}

@media (max-width: 992px) {
    .dashboard-grid-col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.data-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 420px;
    overflow: hidden;
}

.data-card-full {
    height: auto;
    min-height: 380px;
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
}

.data-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-card-icon {
    font-size: 20px;
    color: #334155;
}

.data-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    font-family: Tahoma, 'Segoe UI', sans-serif;
}

.card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    flex-shrink: 0;
}

.card-action-btn:hover {
    background: #0284c7;
    color: #ffffff;
    transform: rotate(90deg);
}

.data-card-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.data-card-body-scroll {
    height: 100%;
    overflow: auto;
}

/* Syncfusion Grid Customizations inside Cards */
.data-card .e-grid {
    border: none !important;
}

.data-card .e-gridheader {
    border-top: none !important;
}

.data-card .maDanhMuc {
    font-weight: 600;
    color: #0369a1;
    cursor: pointer;
}

.top-product-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}
.top-product-badge.rank-1 { background: #ffd700; color: #854d0e; }
.top-product-badge.rank-2 { background: #e2e8f0; color: #475569; }
.top-product-badge.rank-3 { background: #fed7aa; color: #9a3412; }
.top-product-badge.rank-other { background: #f1f5f9; color: #64748b; }
