/* ================= ROOT ================= */
:root{
    --primary:#7a1c2c;
    --primary-dark:#4a0c12;
    --accent:#ff6b6b;

    --bg:#f4f6fb;
    --card:#ffffff;
    --text:#1e293b;
    --muted:#64748b;
    --border:#e2e8f0;

    --glass:rgba(255,255,255,0.65);
    --shadow:0 10px 30px rgba(0,0,0,0.08);
}

/* ================= DARK MODE ================= */
body.dark{
    --bg:#0f172a;
    --card:#1e293b;
    --text:#e2e8f0;
    --muted:#94a3b8;
    --border:#334155;
    --glass:rgba(30,41,59,0.7);
}

/* ================= RESET ================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    transition:all 0.2s ease;
    transform-origin:center;
}

html, body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
}

body{
    font-family:'Inter','Segoe UI',sans-serif;
    background:var(--bg);
    color:var(--text);
}

/* ================= APP ================= */
.app{
    display:flex;
    width:100%;
    overflow-x:hidden;
}

/* ================= SIDEBAR ================= */
.sidebar{
    width:270px;
    height:100vh;
    position:fixed;
    left:0;
    top:0;
    background:linear-gradient(180deg,#7a1c2c,#5c0f1c,#3a0911);
    color:#fff;
    padding:20px 12px;
    display:flex;
    flex-direction:column;
    z-index:1000;
    overflow:hidden;
}

/* COLLAPSE */
.sidebar.collapsed{width:80px;}
.sidebar.collapsed span,
.sidebar.collapsed .menu-title{display:none;}

/* ================= BIG LOGO ================= */
.logo{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    margin-bottom:5px;
    text-align:center;
}

/* BIG LOGO IMAGE */
.logo-img{
    width:200px;
    height:100px;
    object-fit:contain;
    background:#fff;
    padding:10px;
    border-radius:16px;
    box-shadow:0 5px 20px rgba(0,0,0,0.2);
}

/* APP NAME */
.logo span{
    margin-top:10px;
    font-size:16px;
    font-weight:600;
}

/* COLLAPSED LOGO */
.sidebar.collapsed .logo-img{
    width:50px;
    height:25px;
    padding:5px;
}

.sidebar.collapsed .logo span{
    display:none;
}

/* ================= MENU ================= */
.menu{
    flex:1;
    overflow-y:auto;
}

.menu::-webkit-scrollbar{width:4px;}
.menu::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,0.2);
}

/* TITLE */
.menu-title{
    font-size:11px;
    color:rgba(255,255,255,0.5);
    margin:18px 10px 8px;
    text-transform:uppercase;
}

/* NAV */
.nav-link{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 14px;
    border-radius:10px;
    color:rgba(255,255,255,0.85);
    text-decoration:none;
    margin-bottom:6px;
    font-weight:500;
}

.nav-link i{
    width:20px;
    text-align:center;
}

/* HOVER */
.nav-link:hover{
    background:rgba(255,255,255,0.12);
    color:#fff;
}

/* ACTIVE */
.nav-link.active{
    background:linear-gradient(45deg,#ff6b6b,#7a1c2c);
    color:#fff;
    box-shadow:0 5px 20px rgba(255,107,107,0.4);
}

/* ================= FOOTER ================= */
.sidebar-footer{
    border-top:1px solid rgba(255,255,255,0.2);
    padding-top:15px;
    text-align:center;
}

.user-box{
    width:48px;
    height:48px;
    background:#fff;
    color:var(--primary);
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:auto;
    font-weight:600;
}

.user-name{
    margin-top:8px;
    font-size:13px;
}

/* ================= MAIN ================= */
.main{
    margin-left:270px;
    padding:20px;
    width:100%;
    max-width:calc(100vw - 270px);
    overflow-x:hidden;
}

.sidebar.collapsed + .main{
    margin-left:80px;
    max-width:calc(100vw - 80px);
}

/* ================= HEADER ================= */
.header{
    background:var(--glass);
    backdrop-filter:blur(12px);
    border-radius:14px;
    padding:12px 20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    box-shadow:var(--shadow);
}

/* SEARCH */
.search{
    background:#fff;
    padding:8px 12px;
    border-radius:8px;
    display:flex;
    gap:8px;
    align-items:center;
}

.search input{
    border:none;
    outline:none;
}

/* ================= BUTTON ================= */
.btn{
    padding:10px 16px;
    border-radius:10px;
    cursor:pointer;
}

.btn-primary{
    background:linear-gradient(45deg,#ff6b6b,#7a1c2c);
    color:#fff;
    border:none;
}

/* ================= KPI ================= */
.kpi-row{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:18px;
    margin-top:15px;
}

.kpi-card{
    background:var(--glass);
    backdrop-filter:blur(12px);
    border-radius:16px;
    padding:20px;
    position:relative;
    box-shadow:var(--shadow);
    overflow:hidden;
}

.kpi-card:hover{
    transform:translateY(-3px);
}

.kpi-card::before{
    content:'';
    position:absolute;
    left:0;
    top:0;
    height:100%;
    width:5px;
}

.sales::before{background:#3b82f6;}
.profit::before{background:#10b981;}
.alert::before{background:#ef4444;}

/* ================= GRID ================= */
.dashboard{
    display:flex;
    flex-direction:column;
    gap:15px;
}

.row-flex{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
}

.col-6{
    flex:1;
    min-width:320px;
}

/* ================= BLOCK ================= */
.block{
    background:var(--glass);
    backdrop-filter:blur(12px);
    border-radius:16px;
    padding:18px;
    box-shadow:var(--shadow);
    overflow:hidden;
}

.block-content{
    overflow-x:auto;
}

/* ================= TABLE ================= */
table{
    width:100%;
    border-collapse:separate;
    border-spacing:0 8px;
}

tr{
    background:#fff;
    box-shadow:var(--shadow);
}

td,th{
    padding:12px;
}

th{
    color:var(--muted);
    font-size:13px;
    text-align:left;
}

tr td:first-child{
    border-radius:10px 0 0 10px;
}

tr td:last-child{
    border-radius:0 10px 10px 0;
}

tr:hover{
    transform:none;
}

/* ================= INPUT ================= */
input,select{
    width:100%;
    padding:10px;
    border-radius:8px;
    border:1px solid var(--border);
    background:#fff;
}

/* ================= NOTIFICATION ================= */
.notif{
    position:relative;
    cursor:pointer;
}

#notifCount{
    position:absolute;
    top:-5px;
    right:-5px;
    background:red;
    color:#fff;
    font-size:10px;
    padding:2px 6px;
    border-radius:50%;
}

.notif-box{
    position:absolute;
    right:0;
    top:50px;
    width:300px;
    background:#fff;
    border-radius:14px;
    box-shadow:var(--shadow);
    display:none;
}

/* ================= CHART ================= */
.chart-box{
    height:300px;
    width:100%;
    overflow:hidden;
}

canvas{
    max-width:100% !important;
}

/* ================= FILTER ================= */
.filter{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

/* ================= MOBILE ================= */
@media(max-width:900px){

    .sidebar{
        left:-100%;
    }

    .sidebar.active{
        left:0;
    }

    .main{
        margin-left:0;
        max-width:100%;
    }

    .row-flex{
        flex-direction:column;
    }

    .col-6{
        width:100%;
        min-width:100%;
    }

}