:root{
    --bg: #0b1020;
    --bg-soft: #11182d;
    --surface: rgba(255,255,255,0.08);
    --surface-strong: rgba(255,255,255,0.12);
    --card: #ffffff;
    --card-2: #f8fafc;
    --text: #0f172a;
    --text-soft: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0284c7;
    --dark: #334155;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --sidebar-width: 280px;
    --transition: all .25s ease;
}

*{
    box-sizing: border-box;
}

html, body{
    margin: 0;
    padding: 0;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(37,99,235,.18), transparent 20%),
        radial-gradient(circle at top left, rgba(2,132,199,.18), transparent 20%),
        #f1f5f9;
    color: var(--text);
}

a{
    text-decoration: none;
    color: inherit;
}

button, input, select, textarea{
    font: inherit;
}

.app-shell{
    min-height: 100vh;
}

.topbar{
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    backdrop-filter: blur(18px);
    background: rgba(11,16,32,0.78);
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar-right,
.topbar-left{
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: rgba(255,255,255,0.10);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}

.topbar-title{
    font-size: 18px;
    font-weight: 800;
}

.topbar-subtitle{
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.user-chip{
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    padding: 8px 12px;
    border-radius: 18px;
}

.user-chip-avatar{
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.user-chip-name{
    font-size: 14px;
    font-weight: 700;
}

.user-chip-role{
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.layout{
    display: flex;
    min-height: calc(100vh - 79px);
}

.sidebar{
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #fff;
    padding: 20px 16px;
    border-left: 1px solid rgba(255,255,255,0.06);
    transition: var(--transition);
}

.sidebar-brand{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 20px;
}

.brand-logo{
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
}

.brand-title{
    font-weight: 800;
    font-size: 16px;
}

.brand-subtitle{
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.sidebar-nav{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 16px;
    color: rgba(255,255,255,.88);
    transition: var(--transition);
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active{
    background: rgba(255,255,255,0.10);
    color: #fff;
    transform: translateX(-2px);
}

.danger-link:hover{
    background: rgba(220,38,38,0.18);
}

.content{
    flex: 1;
    padding: 24px;
}

.hero-card{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #fff;
    border-radius: 28px;
    padding: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.hero-title{
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 900;
}

.hero-text{
    margin: 0;
    color: rgba(255,255,255,0.8);
    line-height: 1.8;
}

.stats-grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card{
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.45);
    box-shadow: var(--shadow);
    border-radius: 24px;
    padding: 18px;
}

.stat-label{
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 14px;
}

.stat-value{
    font-size: 30px;
    font-weight: 900;
    color: var(--text);
}

.grid-2{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.panel{
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.45);
}

.panel-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.panel-head h2{
    margin: 0;
    font-size: 18px;
}

.panel-head a{
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.list-cards{
    display: grid;
    gap: 12px;
}

.mini-card{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
}

.mini-card.vertical{
    display: block;
}

.mini-card-title{
    font-weight: 800;
    margin-bottom: 6px;
}

.mini-card-subtitle{
    color: var(--text-soft);
    font-size: 13px;
}

.mini-row-between{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
}

.stock-chip{
    min-width: 54px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 14px;
    background: #e2e8f0;
    font-weight: 800;
}

.stock-chip.danger{
    background: rgba(220,38,38,0.12);
    color: var(--danger);
}

.empty-state{
    text-align: center;
    color: var(--text-soft);
    padding: 22px 10px;
}

.flash{
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

.flash-success{
    background: rgba(22,163,74,.10);
    color: var(--success);
    border: 1px solid rgba(22,163,74,.18);
}

.flash-error{
    background: rgba(220,38,38,.10);
    color: var(--danger);
    border: 1px solid rgba(220,38,38,.18);
}

.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 800;
}

.btn:hover{
    transform: translateY(-1px);
}

.btn-primary{
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(37,99,235,.25);
}

.btn-block{
    width: 100%;
}

.auth-page{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(37,99,235,.24), transparent 25%),
        radial-gradient(circle at bottom left, rgba(6,182,212,.18), transparent 20%),
        linear-gradient(135deg, #0f172a, #1e293b);
}

.auth-card{
    width: 100%;
    max-width: 430px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 30px;
    padding: 30px;
    color: #fff;
    box-shadow: 0 30px 60px rgba(0,0,0,.24);
}

.auth-logo{
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
}

.auth-title{
    text-align: center;
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
}

.auth-subtitle{
    text-align: center;
    margin: 0 0 24px;
    color: rgba(255,255,255,0.72);
}

.auth-form{
    display: grid;
    gap: 16px;
}

.form-group{
    display: grid;
    gap: 8px;
}

.form-group label{
    font-size: 14px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea{
    width: 100%;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.10);
    color: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder{
    color: rgba(255,255,255,0.52);
}

.badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-gray{
    background: #e2e8f0;
    color: #334155;
}

.badge-orange{
    background: rgba(245,158,11,.16);
    color: #b45309;
}

.badge-blue{
    background: rgba(2,132,199,.12);
    color: #0369a1;
}

.badge-green{
    background: rgba(22,163,74,.12);
    color: #15803d;
}

.badge-red{
    background: rgba(220,38,38,.12);
    color: #b91c1c;
}

.badge-dark{
    background: #334155;
    color: #fff;
}

.muted{
    color: var(--text-soft);
    font-size: 12px;
}

@media (max-width: 1200px){
    .stats-grid{
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px){
    .sidebar{
        position: fixed;
        top: 79px;
        right: -100%;
        height: calc(100vh - 79px);
        z-index: 30;
        width: 290px;
    }

    .sidebar.open{
        right: 0;
    }

    .content{
        width: 100%;
    }

    .grid-2{
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px){
    .topbar{
        padding: 14px;
    }

    .content{
        padding: 16px;
    }

    .hero-card{
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }

    .hero-title{
        font-size: 22px;
    }

    .stats-grid{
        grid-template-columns: repeat(2, 1fr);
    }

    .user-chip{
        padding: 8px 10px;
    }

    .user-chip-name{
        font-size: 13px;
    }

    .user-chip-role{
        font-size: 11px;
    }
}

@media (max-width: 520px){
    .stats-grid{
        grid-template-columns: 1fr;
    }

    .topbar-title{
        font-size: 16px;
    }

    .topbar-subtitle{
        display: none;
    }

    .user-chip{
        gap: 8px;
    }

    .user-chip div:last-child{
        display: none;
    }

    .auth-card{
        padding: 22px;
        border-radius: 24px;
    }
}