﻿/* revenue-metrics.css
   Page-specific styles for Revenue & Financial Metrics page.
   Complements site.css (central stylesheet).
*/

.rev-metrics-page,
.rev-metrics-page * {
    box-sizing: border-box;
}

/* ── Hero ─────────────────────────────────────────────── */
.rev-hero {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 3rem 5%;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

    .rev-hero h1 {
        font-size: 2.5rem;
        font-weight: 700;
        color: #f0f4f8;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .rev-hero .description {
        color: #cae4f0;
        max-width: 720px;
        margin: 0 auto;
        line-height: 1.8;
        font-size: 0.95rem;
        text-align: center;
    }

/* ── KPI Strip ────────────────────────────────────────── */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 5%;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    padding: 1.2rem 1.4rem 1.1rem;
    box-shadow: 0 4px 18px rgba(12, 18, 30, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.07);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.kpi-icon {
    font-size: 1.3rem;
    font-weight: 700;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

    .kpi-icon.green {
        background: rgba(16, 185, 129, 0.12);
        color: #10b981;
    }

    .kpi-icon.blue {
        background: rgba(59, 130, 246, 0.12);
        color: #3b82f6;
        font-size: 1rem;
    }

    .kpi-icon.amber {
        background: rgba(245, 158, 11, 0.12);
        color: #f59e0b;
        font-size: 1rem;
    }

    .kpi-icon.purple {
        background: rgba(139, 92, 246, 0.12);
        color: #8b5cf6;
        font-size: 1rem;
    }

.kpi-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
}

    .kpi-badge.green {
        background: rgba(16, 185, 129, 0.12);
        color: #10b981;
    }

    .kpi-badge.blue {
        background: rgba(59, 130, 246, 0.12);
        color: #3b82f6;
    }

    .kpi-badge.amber {
        background: rgba(245, 158, 11, 0.12);
        color: #f59e0b;
    }

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.2rem;
}

.kpi-label {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ── Dashboard Section ────────────────────────────────── */
.dashboard-section {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 5%;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 1.6rem;
    box-shadow: 0 6px 28px rgba(12, 18, 30, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.07);
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .dash-header h2 {
        font-size: 1.25rem;
        font-weight: 700;
        color: #1f2937;
        margin: 0;
    }

.period-tabs {
    display: flex;
    gap: 0.3rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.25rem;
}

.period-tab {
    border: none;
    background: transparent;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

    .period-tab.active,
    .period-tab:hover {
        background: white;
        color: #1f2937;
        box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }

.dash-nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 1.2rem;
}

.dash-nav {
    border: none;
    background: transparent;
    padding: 0.5rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

    .dash-nav.active {
        color: #3b82f6;
        border-bottom-color: #3b82f6;
    }

    .dash-nav:hover:not(.active) {
        color: #64748b;
    }

/* Chart */
.chart-container {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem 1rem 0.4rem;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.8rem;
}

#revenueBarChart {
    height: 180px !important;
    width: 100% !important;
}

.chart-x-labels {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.2rem 0;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Sub Stats */
.sub-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.sub-stat {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* label badge */
.sub-stat-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    width: fit-content;
}

    /* COLORS */

    .sub-stat-icon.green {
        background: rgba(16, 185, 129, 0.15);
        color: #10b981;
    }

    .sub-stat-icon.blue {
        background: rgba(59, 130, 246, 0.15);
        color: #3b82f6;
    }

    .sub-stat-icon.purple {
        background: rgba(139, 92, 246, 0.15);
        color: #8b5cf6;
    }

/* value */
.sub-stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1f2937;
    margin-left: 2px;
}

/* hide old label */
.sub-stat-label {
    display: none;
}

.sub-stat {
    transition: transform 0.2s ease;
}

    .sub-stat:hover {
        transform: translateY(-2px);
    }

/* ── Financial Intelligence Features ─────────────────── */
.features-section {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 1.8rem 5%;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.section-heading {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f0f4f8;
    margin-bottom: 1.4rem;
}

.fi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fi-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 1.3rem 1rem;
    box-shadow: 0 4px 18px rgba(12, 18, 30, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-align: left;
}

    .fi-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    }

.fi-icon {
    font-size: 1.6rem;
    margin-bottom: 0.7rem;
}

.fi-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.45rem;
}

.fi-card p {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.55;
    margin: 0;
}

/* ── CTA Card ─────────────────────────────────────────── */
.cta-card {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 4rem 2rem 2.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    position: relative;
    width: calc(100% - 10%);
}

.cta-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
}

.cta-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #f0f4f8;
    margin-bottom: 0.8rem;
    line-height: 1.35;
}

.cta-card p {
    color: #cae4f0;
    max-width: 500px;
    margin: 0 auto 1.6rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.cta-btn {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
    transition: all 0.2s ease;
}

    .cta-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.55);
        color: #fff;
    }


/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .fi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rev-hero h1 {
        font-size: 1.75rem;
    }

    .kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .fi-grid {
        grid-template-columns: 1fr;
    }

    .sub-stats {
        grid-template-columns: 1fr;
    }

    .cta-card {
        width: calc(100% - 6%);
    }
}

.best-seller-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.best-col {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
}

.seller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.seller-rank {
    font-weight: 700;
    color: #94a3b8;
    width: 40px;
}

.seller-info {
    flex: 1;
}

.seller-name {
    font-weight: 600;
    color: #1f2937;
}

.seller-units {
    font-size: 12px;
    color: #64748b;
}

.seller-revenue {
    font-weight: 700;
}

.seller-growth {
    font-size: 12px;
    color: #22c55e;
    margin-left: 6px;
}

/* Needs Attention */
.attention-item {
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.item-name {
    font-weight: 600;
    color: #1f2937;
}

.item-revenue {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.attention-bar {
    height: 6px;
    background: linear-gradient(90deg,#f59e0b,#ef4444);
    border-radius: 6px;
    margin-top: 8px;
    width: 70%;
}

.best-seller-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}
/* progress bar container */
.seller-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
}

/* green progress */
.seller-progress-bar {
    height: 100%;
    background: #22c55e;
    border-radius: 6px;
    transition: width 0.4s ease;
}

.seller-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.seller-info {
    flex: 1;
}

.icon-green svg {
    color: #22c55e;
}

.icon-orange svg {
    color: #f97316;
}

.icon-green svg,
.icon-orange svg {
    margin-right: 10px;
    vertical-align: middle;
}

.best-col h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.best-col {
    padding: 20px;
}

/* CATEGORY SECTION */

.category-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    align-items: center;
    margin-top: 20px;
}

/* DONUT CHART */

.category-chart-box {
    position: relative;
    width: 260px;
    height: 260px;
    margin: auto;
}

#categoryChart {
    width: 100% !important;
    height: 100% !important;
}

.category-total {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    text-align: center;
}

.total-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.total-label {
    font-size: 13px;
    color: #94a3b8;
}


/* CATEGORY LIST */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.category-item {
    background: #f8fafc;
    padding: 16px 18px;
    border-radius: 12px;
}

/* header */

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1f2937;
}

.cat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* progress */

.cat-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    margin-top: 10px;
    overflow: hidden;
}

.cat-progress-bar {
    height: 100%;
    border-radius: 6px;
}

/* colors */

.green {
    background: #22c55e;
}

.blue {
    background: #3b82f6;
}

.amber {
    background: #f59e0b;
}

.purple {
    background: #8b5cf6;
}

.cat-percent {
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}
