* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}


/* HEADER */

.page-header {
    background: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.page-header p {
    margin: 6px 0 0;
    color: #6b7280;
}


/* MAIN */

main {
    padding: 24px;
}


/* FILTERS */

#filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

#filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;

    font-size: 14px;
    font-weight: 600;
}

#filters input,
#filters select {
    min-width: 180px;

    padding: 10px 12px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;

    font-size: 14px;
}


/* KPI */

#kpi-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 16px;

    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    padding: 20px;
}

.kpi-card h3 {
    margin: 0 0 10px;

    font-size: 14px;

    color: #6b7280;
}

.kpi-card p {
    margin: 0;

    font-size: 28px;

    font-weight: 700;

    color: #111827;
}


/* DASHBOARD PANEL */

.dashboard-panel {
    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    padding: 20px;

    margin-bottom: 24px;
}

.panel-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 16px;

    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 0;

    font-size: 20px;
}

.panel-header span {
    font-size: 13px;

    color: #6b7280;
}


/* SALES TREND */

#sales-trend-chart {
    width: 100%;

    min-height: 320px;

    overflow-x: auto;
}

.sales-chart-svg {
    width: 100%;

    min-width: 760px;

    height: auto;

    display: block;
}

.chart-grid-line {
    stroke: #e5e7eb;

    stroke-width: 1;
}

.chart-axis-label {
    fill: #6b7280;

    font-size: 12px;
}

.chart-line {
    fill: none;

    stroke: #2563eb;

    stroke-width: 3;

    stroke-linejoin: round;

    stroke-linecap: round;
}

.chart-point {
    fill: #ffffff;

    stroke: #2563eb;

    stroke-width: 3;
}


/* STORE PERFORMANCE */

#store-performance-chart {
    width: 100%;
}

.store-row {
    display: grid;

    grid-template-columns: 220px 1fr 140px;

    gap: 16px;

    align-items: center;

    margin-bottom: 13px;
}

.store-name {
    font-size: 14px;

    font-weight: 600;

    color: #374151;
}

.store-bar-track {
    height: 24px;

    background: #eef2f7;

    border-radius: 6px;

    overflow: hidden;
}

.store-bar {
    height: 100%;

    min-width: 2px;

    background: #2563eb;

    border-radius: 6px;

    transition: width 0.25s ease;
}

.store-value {
    text-align: right;

    font-size: 14px;

    font-weight: 600;

    color: #111827;
}


/* NO DATA */

.no-data {
    padding: 40px;

    text-align: center;

    color: #9ca3af;
}


/* RESPONSIVE */

@media (max-width: 1000px) {

    #kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .store-row {
        grid-template-columns: 180px 1fr 120px;
    }
}


@media (max-width: 650px) {

    main {
        padding: 16px;
    }

    #kpi-grid {
        grid-template-columns: 1fr;
    }

    #filters {
        flex-direction: column;
    }

    #filters input,
    #filters select {
        width: 100%;
    }

    .store-row {
        grid-template-columns: 1fr;
        gap: 6px;

        margin-bottom: 20px;
    }

    .store-value {
        text-align: left;
    }
}

/* PRODUCT PERFORMANCE */

#product-performance-chart {
    width: 100%;
}

.product-row {
    display: grid;
    grid-template-columns: 260px 1fr 140px;
    gap: 16px;
    align-items: center;
    margin-bottom: 13px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.product-bar-track {
    height: 24px;
    background: #eef2f7;
    border-radius: 6px;
    overflow: hidden;
}

.product-bar {
    height: 100%;
    min-width: 2px;
    background: #2563eb;
    border-radius: 6px;
    transition: width 0.25s ease;
}

.product-value {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

@media (max-width: 1000px) {
    .product-row {
        grid-template-columns: 220px 1fr 120px;
    }
}

@media (max-width: 650px) {
    .product-row {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 20px;
    }

    .product-value {
        text-align: left;
    }
}


/* =========================================================
   REPORT NAVIGATION
   ========================================================= */

.report-nav {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

.nav-button {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;

    padding: 10px 16px;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.nav-button:hover {
    background: #f3f4f6;
}

.nav-button.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

@media (max-width: 650px) {

    .report-nav {
        padding: 10px 16px;
    }

    .nav-button {
        padding: 9px 12px;
        font-size: 13px;
    }
}


/* =========================================================
   REPORT PAGES
   ========================================================= */

.report-page {
    display: none;
}

.report-page.active-page {
    display: block;
}

.page-title {
    margin-bottom: 20px;
}

.page-title h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #111827;
}

.page-title p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}


/* =========================================================
   SALES TREND DETAIL PAGE
   ========================================================= */

.detail-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.detail-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.detail-filters input,
.detail-filters select {
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
}

.detail-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

#sales-trend-detail-chart {
    width: 100%;
    min-height: 360px;
    overflow-x: auto;
}

@media (max-width: 1000px) {
    .detail-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .detail-filters {
        flex-direction: column;
    }

    .detail-filters input,
    .detail-filters select {
        width: 100%;
    }

    .detail-kpi-grid {
        grid-template-columns: 1fr;
    }
}
