:root {
    --blue: #3252DF;
    --blue-light: #eef1fd;
    --bg: #F5F6FA;
    --card: #ffffff;
    --text-dark: #21243D;
    --text-gray: #A4A6B3;
    --green: #16C098;
    --red: #F45B69;
    --purple-bg: #E4E1FB;
    --purple: #5B5BE8;
    --yellow-bg: #FDECC8;
    --yellow: #F5B22F;
    --mint-bg: #DAF6E8;
    --mint: #1BC48A;
    --peach-bg: #FBE0DB;
    --peach: #F97C6B;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(20, 20, 43, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
}

a { text-decoration: none; color: inherit; }

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--card);
    padding: 24px 18px;
    border-right: 1px solid #EEF0F5;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    margin: 4px 8px 28px;
}
.logo-dash { color: var(--blue); }
.logo-stack { color: var(--text-dark); }

.nav-section { display: flex; flex-direction: column; gap: 4px; }

.nav-label {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-gray);
    margin: 20px 12px 8px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    transition: background .15s ease;
}
.nav-item i { width: 18px; height: 18px; stroke-width: 2; }
.nav-item:hover { background: var(--blue-light); }
.nav-item.active {
    background: var(--blue);
    color: #fff;
}

.nav-bottom { margin-top: 28px; border-top: 1px solid #EEF0F5; padding-top: 16px; }

/* ---------------- MAIN ---------------- */
.main {
    flex: 1;
    padding: 22px 34px 40px;
    min-width: 0;
}

/* ---------------- TOPBAR ---------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border-radius: 10px;
    padding: 10px 16px;
    width: 320px;
    box-shadow: var(--shadow);
}
.search-box i { width: 17px; height: 17px; color: var(--text-gray); }
.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
}

.topbar-right { display: flex; align-items: center; gap: 22px; }

.icon-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
}
.icon-btn i { width: 22px; height: 22px; }
.bell-btn .badge {
    position: absolute;
    top: -6px; right: -8px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
}

.lang-select, .user-box {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.lang-select i, .user-box i { width: 16px; height: 16px; color: var(--text-gray); }
.flag { font-size: 18px; }

.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--purple);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: var(--text-gray); }

/* ---------------- PAGE TITLE ---------------- */
.page-title { font-size: 26px; font-weight: 800; margin: 0 0 22px; }

/* ---------------- GRID / CARDS ---------------- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.stat-card { display: flex; flex-direction: column; gap: 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 14px; color: var(--text-gray); font-weight: 500; }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.stat-icon i { width: 20px; height: 20px; }
.stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-icon.mint   { background: var(--mint-bg);   color: var(--mint); }
.stat-icon.peach  { background: var(--peach-bg);  color: var(--peach); }

.stat-value { font-size: 28px; font-weight: 800; }
.stat-delta { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.stat-delta i { width: 14px; height: 14px; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }
.stat-delta span.muted { color: var(--text-gray); font-weight: 500; }

/* ---------------- CHART CARD ---------------- */
.chart-card { margin-bottom: 22px; }
.chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}
.chart-title { font-size: 20px; font-weight: 800; }
.select-pill {
    border: 1px solid #E7E9F1;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--text-dark);
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    background: #fff;
}
.select-pill i { width: 14px; height: 14px; color: var(--text-gray); }
.chart-legend { display: flex; gap: 22px; justify-content: center; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------------- TABLE ---------------- */
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th {
    text-align: left;
    font-size: 13px;
    color: var(--text-gray);
    font-weight: 600;
    padding: 12px 14px;
    background: #FAFAFC;
}
.table-card td {
    padding: 16px 14px;
    font-size: 14px;
    border-top: 1px solid #F1F2F6;
}
.status-pill {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}
.status-Delivered { background: #DEF7EC; color: var(--mint); }
.status-Pending    { background: var(--yellow-bg); color: #B5810A; }
.status-Cancelled  { background: #FCE4E4; color: var(--red); }

/* ---------------- CUSTOMERS / DONUT ---------------- */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.donut-canvas-box { width: 190px; height: 190px; position: relative; }
.donut-stats { display: flex; gap: 34px; }
.donut-stat { text-align: center; }
.donut-stat .num { font-size: 22px; font-weight: 800; }
.donut-stat .lbl { font-size: 12px; color: var(--text-gray); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dot-blue { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); display: inline-block; }
.dot-light { width: 9px; height: 9px; border-radius: 50%; background: #C7D2FE; display: inline-block; }

/* ---------------- FEATURED PRODUCT ---------------- */
.featured-wrap { display: flex; align-items: center; gap: 14px; }
.featured-img {
    flex: 1;
    height: 190px;
    border-radius: 14px;
    background: linear-gradient(160deg, #C9A9F5, #A992F0);
}
.carousel-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid #ECEDF3;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.carousel-btn i { width: 16px; height: 16px; }
.featured-info { text-align: center; margin-top: 16px; }
.featured-name { font-weight: 700; font-size: 15px; }
.featured-price { color: var(--blue); font-weight: 700; margin-top: 4px; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { display: none; }
    .grid-4 { grid-template-columns: 1fr; }
    .search-box { width: 200px; }
}
