* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
    max-width: 100vw;
}

.dashboard {
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
    padding: 46px 35px;
    background: #ffffff;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 46px;
}

.welcome-section {
    flex-grow: 1;
}

.welcome-text {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 32px;
    font-weight: bold;
    color: #000000;
}

.header-actions {
    display: flex;
    gap: 17px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
}

.icon-btn:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
}

.icon-btn img {
    width: 24px;
    height: 24px;
}

/* Main Content Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* Top Section Grid: Performance Metrics + Top Selling Products */
.top-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    margin-bottom: 35px;
}

/* Card Styles */
.card {
    background: linear-gradient(-90deg, #f0f0f0 0%, #dcdce6 100%);
    border-radius: 33px;
    padding: 46px;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
    height: fit-content;
}

.large-card {
    width: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 29px;
}

.card h3 {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
}

/* Button Styles */
.btn-secondary {
    background: linear-gradient(90deg, #303171 0%, #000000 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 2px 2px 8px rgba(121, 121, 175, 0.35);
}

.btn-secondary svg {
    width: 20px;
    height: 20px;
}

/* Top Selling Products Section */
.top-selling-section {
    position: relative;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: linear-gradient(90deg, #303171 0%, #000000 100%);
}

.products-table thead tr {
    height: 50px;
}

.products-table th {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    padding: 17px 23px;
}

.products-table th:last-child {
    text-align: right;
}

.products-table th:nth-child(2),
.products-table th:nth-child(3) {
    text-align: right;
}

.products-table tbody tr {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    height: 50px;
}

.products-table tbody tr:last-child {
    border-bottom: none;
}

.products-table td {
    padding: 17px 23px;
    font-size: 16px;
}

.products-table td:first-child {
    font-weight: normal;
}

.products-table td:nth-child(2),
.products-table td:nth-child(3),
.products-table td:nth-child(4) {
    text-align: right;
}

/* Performance Metrics Section */
.performance-metrics-section {
    height: 100%;
}


.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 17px;
}

.metric-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 29px;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
    cursor: pointer;
}

.metric-card:hover {
    transform: translateY(-18px) rotateX(8deg) rotateY(-5deg) scale(1.03);
    box-shadow: 0 20px 40px rgba(121, 121, 175, 0.4), 
                0 0 30px rgba(75, 192, 114, 0.2);
}

.primary-metric:hover {
    box-shadow: 0 20px 40px rgba(75, 192, 114, 0.4), 
                0 0 30px rgba(75, 192, 114, 0.3);
}
/* Revenue card spans full width */
.metric-card:first-child {
    grid-column: 1 / -1;
}

.primary-metric {
    background: linear-gradient(90deg, #303171 0%, #000000 100%);
    color: #ffffff;
}

.metric-header {
    margin-bottom: 14px;
}

.metric-label {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-metric .metric-label {
    color: #ffffff;
}

.metric-card:not(.primary-metric) .metric-label {
    color: #000000;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.metric-trend {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-trend.up {
    color: #4bc072;
}

.primary-metric .metric-trend.up {
    color: #ffffff;
}

.metric-bar {
    margin-bottom: 17px;
}

.bar-bg {
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 20px;
    height: 14px;
    overflow: hidden;
    position: relative;
}

.primary-metric .bar-bg {
    border-color: #ffffff;
}

.bar-fill {
    height: 100%;
    border-radius: 20px;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.5s ease;
}

.bar-fill.green {
    background: linear-gradient(90deg, #235a35 0%, #4bc072 100%);
    border: 1px solid #000000;
    width: 0%;
}

.primary-metric .bar-fill.green {
    border-color: #ffffff;
}
.metric-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 9px;
    font-size: 16px;
}

.metric-details > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-label {
    font-weight: normal;
}

.detail-value {
    font-weight: bold;
}

.metric-status {
    font-size: 16px;
    font-weight: bold;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 35px;
    margin: 23px 0;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    max-height: 350px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 23px;
}

.chart-legend.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 23px;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Stock Alerts Section */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 23px;
    margin-top: 35px;
}

.stock-card {
    background: #ffffff;
    border-radius: 25px;
    padding: 46px;
    box-shadow: 1px 1px 4px rgba(121, 121, 175, 0.25);
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.stock-card.critical {
    background: linear-gradient(135deg, #1a1a3e 0%, #0f0f1e 100%);
    color: #ffffff;
    grid-column: span 2;
}

.stock-card h4 {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

.stock-bar {
    width: 100%;
}

.stock-bar .bar-bg {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    height: 14px;
    overflow: hidden;
    position: relative;
}

.stock-card:not(.critical) .stock-bar .bar-bg {
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
}

.stock-card.critical .stock-bar .bar-bg {
    border-color: rgba(255, 255, 255, 0.3);
}

.bar-fill.critical-fill {
    background: linear-gradient(90deg, #7a2a2a 2.7%, #e04d4d 90.5%);
    border: none;
    width: 12%;
}

.bar-fill.low-fill {
    background: linear-gradient(90deg, #84401c 0%, #ea7232 100%);
    border: none;
    width: 38%;
}

.bar-fill.watch-fill {
    background: linear-gradient(90deg, #898942 0%, #efef73 100%);
    border: none;
    width: 52%;
}

.stock-status {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.stock-status.critical {
    color: #ff6b6b;
}

.stock-status.low {
    color: #ff9f43;
}

.stock-status.watch {
    color: #ffd93d;
}

.stock-card.critical .stock-status.critical {
    color: #ff6b6b;
}

.stock-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    font-size: 11px;
    margin-top: 8px;
}

.stock-card.critical .stock-details {
    font-size: 11px;
    color: #ffffff;
}

.stock-details > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-details .detail-label {
    font-weight: normal;
    font-size: 11px;
    opacity: 0.7;
}

.stock-details .detail-value {
    font-weight: bold;
    font-size: 16px;
}

.stock-card.critical .stock-details .detail-label {
    opacity: 0.8;
}

.stock-card.critical .stock-details .detail-value {
    font-size: 16px;
}

.view-all-card {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view-all {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
}

.btn-view-all svg {
    width: 44px;
    height: 44px;
    stroke: #000000;
}

.btn-view-all:hover svg {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1600px) {
    .dashboard {
        padding: 35px 35px;
    }
}

@media (max-width: 1400px) {
    .top-section-grid {
        grid-template-columns: 1fr;
    }
    
    .stock-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 23px;
    }
    
    .welcome-text {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .stock-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 23px;
    }
    
    .products-table {
        font-size: 14px;
    }
    
    .dashboard {
        padding: 23px;
    }
}
