:root {
    --primary: #1e5fce;
    --primary-dark: #164a9f;
    --bg: #f4f6fb;
    --sidebar-w: 250px;
    --topbar-h: 60px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    color: #1f2937;
    margin: 0;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1030;
}
.brand-icon {
    width: 34px; height: 34px;
    background: #fff;
    color: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.brand-text {
    color: #fff;
    font-weight: 700;
    letter-spacing: .5px;
}
.search-box {
    background: rgba(255,255,255,.15);
    border-radius: 8px;
    padding: 6px 12px;
    align-items: center;
    gap: 8px;
    width: 320px;
}
.search-box i { color: #cfe0ff; }
.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    width: 100%;
}
.search-box input::placeholder { color: #cfe0ff; }
.badge-dot {
    position: absolute;
    top: 0; right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
}
.avatar-circle {
    width: 30px; height: 30px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}

/* ===== LAYOUT ===== */
.app-body {
    display: flex;
    padding-top: var(--topbar-h);
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    top: var(--topbar-h); bottom: 0; left: 0;
    overflow-y: auto;
    padding: 16px 10px;
    z-index: 1020;
}
.sidebar .nav-section {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    padding: 14px 12px 6px;
    letter-spacing: .5px;
}
.sidebar .nav-link {
    color: #374151;
    padding: 9px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    margin-bottom: 2px;
}
.sidebar .nav-link i { font-size: 16px; width: 18px; }
.sidebar .nav-link:hover { background: #eff4ff; color: var(--primary); }
.sidebar .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.main-content {
    margin-left: var(--sidebar-w);
    padding: 22px;
    width: 100%;
}

@media (max-width: 767px) {
    .sidebar { transform: translateX(-100%); transition: .2s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #edf0f5;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
    height: 100%;
}
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
}
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { color: #6b7280; font-size: 13px; }
.stat-trend-up { color: #16a34a; font-size: 12.5px; }
.stat-trend-down { color: #ef4444; font-size: 12.5px; }

/* ===== CARD PANEL ===== */
.panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #edf0f5;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
    padding: 18px;
    margin-bottom: 22px;
}
.panel-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-title a { font-size: 13px; font-weight: 500; }

.alert-task-box {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

/* ===== TABLE ===== */
.table thead th {
    background: #f9fafb;
    font-size: 12.5px;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 600;
    border-bottom: none;
}
.table td { vertical-align: middle; font-size: 14px; }
.badge-status { font-weight: 500; padding: 5px 10px; border-radius: 6px; font-size: 12px; }
.badge-moi { background: #dbeafe; color: #1d4ed8; }
.badge-choxuly { background: #fef3c7; color: #b45309; }
.badge-danggiao { background: #e0e7ff; color: #4338ca; }
.badge-hoantat { background: #dcfce7; color: #15803d; }
.badge-dahuy { background: #fee2e2; color: #b91c1c; }

.product-thumb {
    width: 46px; height: 46px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
