/* ===== CSS VARIABLES ===== */
:root {
    --bg-main: #d7bda6;
    --bg-card: #fffcf2;
    --text-dark: #4c2b08;
    --text-brown: #6d3914;
    --accent-red: #bc5449;
    --accent-orange: #d9a05b;
    --accent-tan: #b8957f;
    --accent-brown: #ab7843;
    --accent-dark-brown: #4c2b08;
    --accent-green: #86a364;
    --accent-pink: #cd7f6d;
    --bar-brown: #6d3914;
    --white: #fffcf2;
    --watch-green: #87BE56;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 30px;
}

/* ===== HEADER ===== */
.header {
    margin-bottom: 20px;
}

.header h1 {
    font-family: 'Domine', serif;
    font-size: 48px;
    color: var(--white);
    font-weight: 400;
}

.section-title {
    font-family: 'Domine', serif;
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 400;
}

/* ===== FINANCIAL SECTION - FULL WIDTH AT TOP ===== */
.financial-section {
    margin-bottom: 20px;
}

.financial-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.metric-card-svg {
    width: 100%;
    height: auto;
    border-radius: 30px;
}

/* ===== MAIN DASHBOARD GRID ===== */
.dashboard {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== REVIEWS SECTION ===== */
.reviews-section {
    background: var(--bg-card);
    border-radius: 30px;
    padding: 20px;
}

.rating-display {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.rating-number {
    font-family: 'Domine', serif;
    font-size: 64px;
    color: var(--text-dark);
    line-height: 1;
}

.rating-star {
    color: #d9a05b;
    font-size: 40px;
}

.rating-bars {
    flex: 1;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
    font-size: 12px;
}

.rating-bar-row span:first-child {
    width: 15px;
}

.rating-bar-bg {
    width: 120px;
    height: 8px;
    background: #e0d5c9;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--accent-tan);
    border-radius: 4px;
}

.sort-dropdown {
    display: inline-block;
    background: var(--accent-tan);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 12px;
    color: var(--text-dark);
    margin-bottom: 10px;
    cursor: pointer;
}

.review-card {
    background: var(--accent-tan);
    border-radius: 30px;
    padding: 15px 20px;
    margin-bottom: 10px;
}

.review-stars {
    color: #d9a05b;
    font-size: 14px;
    margin-bottom: 8px;
}

.review-text {
    font-size: 12px;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ===== STOCK ALERTS ===== */
.stock-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stock-card {
    border-radius: 30px;
    padding: 15px 20px;
    color: var(--white);
}

.stock-card.critical {
    background: var(--accent-red);
}

.stock-card.low {
    background: var(--accent-orange);
}

.stock-card.watch {
    background: #87BE56;
}

.stock-card h4 {
    font-family: 'Domine', serif;
    font-size: 24px;
    font-weight: 400;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    margin-bottom: 15px;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.stock-item {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin-bottom: 5px;
    align-items: center;
}

/* ===== WEEKLY CHART WITH SVG ===== */
.weekly-chart {
    background: transparent;
}

.chart-wrapper {
    position: relative;
    width: 100%;
}

.weekly-chart-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 30px;
}

/* Chart tooltip points - invisible hit areas */
.chart-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.chart-point:hover {
    background: rgba(109, 57, 20, 0.2);
}

.profit-point:hover {
    background: rgba(171, 120, 67, 0.2);
}

.expenses-point:hover {
    background: rgba(76, 43, 8, 0.2);
}

/* Chart tooltip */
.chart-tooltip {
    display: none;
    position: absolute;
    background: #6D3914;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

.chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #6D3914;
}

/* ===== BOTTOM SECTION ===== */
.bottom-section {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
    align-items: end;
}

/* ===== TOP PRODUCTS ===== */
.top-products {
    background: var(--bg-card);
    border-radius: 30px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.product-row {
    display: grid;
    grid-template-columns: 120px 140px 1fr;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.product-name {
    font-size: 18px;
    color: var(--text-dark);
}

.product-bar {
    height: 19px;
    background: var(--bar-brown);
}

.product-stats {
    font-size: 14px;
    color: var(--text-brown);
}

/* ===== PAYMENT METHODS ===== */
.payment-methods {
    background: var(--bg-card);
    border-radius: 30px;
    padding: 25px;

}

.donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 10px;
}

.donut-chart {
    width: 280px;
    height: 280px;
    margin-top: 20px;
    margin-bottom: 50px;
}

.donut-segment {
    cursor: pointer;
    transition: opacity 0.2s;
}

.donut-segment:hover {
    opacity: 0.85;
}

/* Payment SVG tooltip - centered in donut */
.payment-tooltip {
    display: none;
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translate(-45%, -30%);
    z-index: 100;
    pointer-events: none;
}

.payment-tooltip img {
    width: 155px;
    height: auto;
    display: block;
}

.payment-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.payment-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.legend-color {
    width: 22px;
    height: 13px;
}

.legend-color.credit { background: #ab7843; }
.legend-color.cash { background: #4c2b08; }
.legend-color.debit { background: #b8957f; }
.legend-color.mobile { background: #86a364; }
.legend-color.gift { background: #cd7f6d; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .financial-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .financial-overview {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 32px;
    }
    
    body {
        padding: 15px;
    }
}