/* ========================================
   ADMIN DASHBOARD — GLASSMORPHISM PURPLE
   Full Glassmorphism Design System
   ======================================== */

/* ═══ VARIABLES ═══ */
:root {
    /* Purple Palette */
    --p50:  #f5f3ff;
    --p100: #ede9fe;
    --p200: #ddd6fe;
    --p300: #c4b5fd;
    --p400: #a78bfa;
    --p500: #8b5cf6;
    --p600: #7c3aed;
    --p700: #6d28d9;
    --p800: #5b21b6;
    --p900: #4c1d95;
    --p950: #2e1065;

    /* Background */
    --bg-body: #080415;
    --bg-surface: #0c0820;

    /* Text */
    --tx-1: #f5f0ff;
    --tx-2: #b8aed4;
    --tx-3: #776e94;

    /* Glass Tokens */
    --glass-bg: rgba(124, 58, 237, 0.07);
    --glass-bg-strong: rgba(124, 58, 237, 0.12);
    --glass-border: rgba(139, 92, 246, 0.15);
    --glass-border-strong: rgba(139, 92, 246, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    --glass-shadow-hover: 0 12px 40px rgba(124, 58, 237, 0.2), inset 0 1px 0 rgba(255,255,255,0.06);
    --blur: blur(24px);
    --blur-heavy: blur(40px);

    /* Accent */
    --a-blue: #60a5fa;
    --a-green: #34d399;
    --a-pink: #f472b6;
    --a-orange: #fb923c;
    --a-red: #f87171;

    /* Layout */
    --sidebar-w: 272px;
    --topbar-h: 68px;

    /* Radius */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.2s var(--ease);
    --t-base: 0.3s var(--ease);
    --t-slow: 0.5s var(--ease);
}

/* ═══ RESET ═══ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--tx-1);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══ ANIMATED BACKGROUND ═══ */
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.bg-orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    top: -10%; right: -5%;
    animation: orbit1 22s ease-in-out infinite;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #6d28d9 0%, transparent 70%);
    bottom: -10%; left: -5%;
    animation: orbit2 28s ease-in-out infinite;
}
.bg-orb-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
    top: 40%; left: 30%;
    animation: orbit3 18s ease-in-out infinite;
}
.bg-orb-4 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    top: 60%; right: 20%;
    animation: orbit4 25s ease-in-out infinite;
    opacity: 0.2;
}
.bg-orb-5 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #5b21b6 0%, transparent 70%);
    top: 10%; left: 50%;
    animation: orbit5 30s ease-in-out infinite;
    opacity: 0.15;
}

@keyframes orbit1 {
    0%,100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(-40px, 60px) scale(1.1); }
    50% { transform: translate(30px, -30px) scale(0.95); }
    75% { transform: translate(-20px, -40px) scale(1.05); }
}
@keyframes orbit2 {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(50px, -40px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
}
@keyframes orbit3 {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(-60px, 40px) scale(1.15); }
}
@keyframes orbit4 {
    0%,100% { transform: translate(0,0); }
    50% { transform: translate(40px, -50px); }
}
@keyframes orbit5 {
    0%,100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(-30px, 50px) scale(1.1); }
    66% { transform: translate(50px, -20px) scale(0.95); }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--p700); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--p600); }

/* ═══ GLASS UTILITY ═══ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
}

.glass-panel-sm {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* ═════════════════════════════════════════
   SIDEBAR
   ═════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(8, 4, 21, 0.85);
    backdrop-filter: var(--blur-heavy);
    -webkit-backdrop-filter: var(--blur-heavy);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--t-base);
}

/* Glass shine effect on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.3), transparent);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--p600), var(--p400));
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--p300), white);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-close-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--tx-2);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}
.sidebar-close-btn:hover {
    background: var(--glass-bg-strong);
    color: var(--tx-1);
}

/* ═══ NAV ═══ */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

.nav-group { margin-bottom: 20px; }

.nav-group-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--tx-3);
    letter-spacing: 2px;
    padding: 0 14px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--tx-2);
    text-decoration: none;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--t-fast);
    position: relative;
    margin-bottom: 2px;
}

.nav-item i { font-size: 1.15rem; width: 22px; text-align: center; }

.nav-item:hover {
    background: var(--glass-bg-strong);
    color: var(--tx-1);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(139,92,246,0.12));
    color: var(--p300);
    border: 1px solid rgba(139,92,246,0.2);
    box-shadow: 0 0 25px rgba(124,58,237,0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 55%;
    background: linear-gradient(to bottom, var(--p400), var(--p600));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px var(--p500);
}

.nav-count {
    margin-left: auto;
    background: rgba(139,92,246,0.15);
    color: var(--p300);
    padding: 2px 10px;
    border-radius: var(--r-full);
    font-size: 0.68rem;
    font-weight: 700;
}
.nav-count.highlight {
    background: rgba(244,114,182,0.15);
    color: var(--a-pink);
}

/* ═══ SIDEBAR FOOTER ═══ */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--glass-border);
}

/* Storage Widget */
.storage-widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 12px;
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tx-2);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.storage-header i { color: var(--p400); }

.storage-bar {
    height: 6px;
    background: rgba(139,92,246,0.1);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: 6px;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--p600), var(--p400));
    border-radius: var(--r-full);
    position: relative;
    transition: width 1.5s ease;
}

.storage-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    background: white;
    border-radius: 50%;
    filter: blur(3px);
    opacity: 0.6;
}

.storage-text {
    font-size: 0.68rem;
    color: var(--tx-3);
}

/* Sidebar User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    transition: var(--t-fast);
}
.sidebar-user:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
}

.sidebar-user-avatar {
    position: relative; flex-shrink: 0;
}
.sidebar-user-avatar img {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--p500);
    box-shadow: 0 0 12px rgba(124,58,237,0.3);
}

.online-indicator {
    position: absolute;
    bottom: 0; right: 0;
    width: 10px; height: 10px;
    background: var(--a-green);
    border-radius: 50%;
    border: 2px solid var(--bg-body);
    box-shadow: 0 0 8px rgba(52,211,153,0.6);
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { display: block; font-size: 0.8rem; font-weight: 600; color: var(--tx-1); }
.sidebar-user-role { display: block; font-size: 0.68rem; color: var(--tx-3); }

.btn-logout {
    background: none; border: none;
    color: var(--tx-3);
    cursor: pointer; padding: 6px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
    font-size: 1rem;
}
.btn-logout:hover {
    background: rgba(248,113,113,0.12);
    color: var(--a-red);
}

/* ═══ SIDEBAR OVERLAY ═══ */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0; visibility: hidden;
    transition: all var(--t-base);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ═════════════════════════════════════════
   MAIN WRAPPER
   ═════════════════════════════════════════ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left var(--t-base);
}

/* ═══ TOPBAR ═══ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--tx-2);
    font-size: 1.35rem;
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.menu-toggle:hover { background: var(--glass-bg-strong); color: var(--tx-1); }

/* Search */
.search-wrapper {
    position: relative;
    width: 340px;
}
.search-wrapper > i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--tx-3);
    font-size: 0.9rem;
}
.search-wrapper input {
    width: 100%;
    padding: 10px 60px 10px 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    color: var(--tx-1);
    font-size: 0.84rem;
    font-family: inherit;
    transition: all var(--t-fast);
    outline: none;
}
.search-wrapper input::placeholder { color: var(--tx-3); }
.search-wrapper input:focus {
    border-color: var(--p500);
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
    background: rgba(124,58,237,0.1);
}
.search-wrapper kbd {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: rgba(139,92,246,0.1);
    border: 1px solid var(--glass-border);
    color: var(--tx-3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-family: inherit;
    pointer-events: none;
}

/* Topbar date */
.topbar-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tx-3);
    font-size: 0.78rem;
    padding: 0 12px;
}
.topbar-date i { color: var(--p400); }

/* Topbar buttons */
.topbar-btn {
    position: relative;
    width: 40px; height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    color: var(--tx-2);
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}
.topbar-btn:hover {
    background: var(--glass-bg-strong);
    color: var(--p300);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.15);
}

.notification-badge {
    position: absolute;
    top: 6px; right: 6px;
    min-width: 18px; height: 18px;
    background: linear-gradient(135deg, var(--a-pink), #e879f9);
    color: white;
    border-radius: var(--r-full);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 10px rgba(244,114,182,0.5);
    animation: pulse-badge 2s infinite;
}
.notification-badge.small { font-size: 0.55rem; min-width: 16px; height: 16px; }

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(var(--topbar-h) - 4px);
    right: 100px;
    width: 360px;
    border-radius: var(--r-lg);
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--t-base);
    z-index: 200;
}
.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--glass-border);
}
.notif-dropdown-header h3 { font-size: 0.9rem; font-weight: 700; }
.notif-dropdown-header a {
    font-size: 0.72rem;
    color: var(--p400);
    text-decoration: none;
}
.notif-dropdown-header a:hover { color: var(--p300); }

.notif-dropdown-list { max-height: 300px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    transition: var(--t-fast);
    cursor: pointer;
}
.notif-item:hover { background: var(--glass-bg-strong); }
.notif-item.unread { border-left: 3px solid var(--p500); }

.notif-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.notif-icon.green { background: rgba(52,211,153,0.12); color: var(--a-green); }
.notif-icon.blue { background: rgba(96,165,250,0.12); color: var(--a-blue); }
.notif-icon.orange { background: rgba(251,146,60,0.12); color: var(--a-orange); }
.notif-icon.purple { background: rgba(139,92,246,0.12); color: var(--p400); }

.notif-content p { font-size: 0.8rem; color: var(--tx-2); line-height: 1.4; margin: 0; }
.notif-content p strong { color: var(--tx-1); }
.notif-content span { font-size: 0.68rem; color: var(--tx-3); }

.notif-dropdown-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}
.notif-dropdown-footer a {
    font-size: 0.78rem; color: var(--p400);
    text-decoration: none; font-weight: 600;
}
.notif-dropdown-footer a:hover { color: var(--p300); }

/* Topbar Divider */
.topbar-divider {
    width: 1px; height: 32px;
    background: var(--glass-border);
    margin: 0 4px;
}

/* Topbar Profile */
.topbar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: all var(--t-fast);
}
.topbar-profile:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
}
.topbar-profile img {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--p500);
}
.topbar-profile-info { line-height: 1.2; }
.topbar-profile-name { display: block; font-size: 0.8rem; font-weight: 600; color: var(--tx-1); }
.topbar-profile-role { display: block; font-size: 0.65rem; color: var(--tx-3); }
.topbar-profile > i { font-size: 0.7rem; color: var(--tx-3); }

/* ═════════════════════════════════════════
   PAGE CONTENT
   ═════════════════════════════════════════ */
.page-content { padding: 24px; }

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--tx-3);
}
.breadcrumb-nav a {
    color: var(--p400);
    text-decoration: none;
}
.breadcrumb-nav a:hover { color: var(--p300); }
.breadcrumb-nav i { font-size: 0.6rem; }

.page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--r-full);
    font-size: 0.8rem;
    color: var(--tx-2);
    cursor: pointer;
    transition: var(--t-fast);
}
.date-filter:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-border-strong);
}
.date-filter i:first-child { color: var(--p400); }
.date-filter i:last-child { font-size: 0.65rem; }

/* ═══ BUTTONS ═══ */
.btn-glass-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    color: var(--tx-2);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-glass-outline:hover {
    background: var(--glass-bg-strong);
    color: var(--tx-1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-glass-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--p600), var(--p500));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: var(--r-sm);
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--t-fast);
    box-shadow: 0 4px 18px rgba(124,58,237,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}
.btn-glass-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -100%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: all 0.6s ease;
}
.btn-glass-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124,58,237,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-glass-primary:hover::after { left: 100%; }

.btn-glass-icon {
    background: none;
    border: none;
    color: var(--tx-3);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}
.btn-glass-icon:hover { color: var(--p300); background: var(--glass-bg); }
.btn-glass-icon.sm { font-size: 0.9rem; }

.link-all {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--p400);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all var(--t-fast);
}
.link-all:hover { color: var(--p300); gap: 8px; }

/* ═════════════════════════════════════════
   STAT CARDS
   ═════════════════════════════════════════ */
.stat-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 22px;
    overflow: hidden;
    transition: all var(--t-base);
}

/* Colored glow at the top */
.stat-card-glow {
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    transition: all var(--t-base);
}
.stat-card-glow.blue { background: var(--a-blue); }
.stat-card-glow.purple { background: var(--p500); }
.stat-card-glow.pink { background: var(--a-pink); }
.stat-card-glow.green { background: var(--a-green); }

.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border-strong);
    box-shadow: var(--glass-shadow-hover);
}
.stat-card:hover .stat-card-glow { opacity: 0.5; transform: scale(1.3); }

/* Glass reflection */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon-wrap {
    width: 48px; height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    position: relative;
}
.stat-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--t-fast);
}

.stat-icon-wrap.blue { background: rgba(96,165,250,0.12); color: var(--a-blue); }
.stat-icon-wrap.purple { background: rgba(139,92,246,0.12); color: var(--p400); }
.stat-icon-wrap.pink { background: rgba(244,114,182,0.12); color: var(--a-pink); }
.stat-icon-wrap.green { background: rgba(52,211,153,0.12); color: var(--a-green); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-full);
}
.stat-trend.up { color: var(--a-green); background: rgba(52,211,153,0.1); }
.stat-trend.down { color: var(--a-red); background: rgba(248,113,113,0.1); }
.stat-trend i { font-size: 1rem; }

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--tx-1);
    letter-spacing: -1.5px;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--tx-3);
    font-weight: 500;
    margin-bottom: 16px;
}

.stat-progress {
    height: 4px;
    background: rgba(139,92,246,0.08);
    border-radius: var(--r-full);
    overflow: hidden;
    margin-bottom: 12px;
}
.stat-progress-bar {
    height: 100%;
    border-radius: var(--r-full);
    transition: width 1.5s ease 0.5s;
    position: relative;
}
.stat-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 20px; height: 100%;
    background: rgba(255,255,255,0.3);
    filter: blur(4px);
}
.stat-progress-bar.blue { background: linear-gradient(90deg, var(--p600), var(--a-blue)); }
.stat-progress-bar.purple { background: linear-gradient(90deg, var(--p700), var(--p400)); }
.stat-progress-bar.pink { background: linear-gradient(90deg, var(--a-pink), #e879f9); }
.stat-progress-bar.green { background: linear-gradient(90deg, var(--a-green), #6ee7b7); }

.stat-footer {
    font-size: 0.7rem;
    color: var(--tx-3);
}
.stat-footer i { margin-right: 2px; }

/* ═════════════════════════════════════════
   GLASS CARD
   ═════════════════════════════════════════ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 22px;
    position: relative;
    transition: all var(--t-base);
}

/* Glass reflection */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.glass-card:hover {
    border-color: var(--glass-border-strong);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.glass-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.glass-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tx-1);
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.glass-card-subtitle {
    font-size: 0.72rem;
    color: var(--tx-3);
}

/* Period Buttons */
.btn-group-glass {
    display: flex;
    gap: 3px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    padding: 3px;
}

.btn-period {
    background: none;
    border: none;
    color: var(--tx-3);
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--t-fast);
}
.btn-period:hover { color: var(--tx-2); }
.btn-period.active {
    background: linear-gradient(135deg, var(--p600), var(--p500));
    color: white;
    box-shadow: 0 2px 10px rgba(124,58,237,0.35);
}

/* ═══ CHARTS ═══ */
.chart-box { position: relative; height: 280px; }
.chart-box-doughnut { height: 190px; }
.chart-box-bar { height: 200px; }

/* Legend */
.legend-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}
.legend-row:hover { background: var(--glass-bg); }
.legend-color {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color);
    flex-shrink: 0;
    box-shadow: 0 0 8px color-mix(in srgb, var(--color) 50%, transparent);
}
.legend-label { flex: 1; font-size: 0.8rem; color: var(--tx-2); }
.legend-val { font-size: 0.82rem; font-weight: 700; color: var(--tx-1); }

/* ═════════════════════════════════════════
   TABLE
   ═════════════════════════════════════════ */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.glass-table thead th {
    padding: 12px 14px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--tx-3);
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
    white-space: nowrap;
}

.glass-table tbody tr {
    transition: all var(--t-fast);
}
.glass-table tbody tr:hover {
    background: var(--glass-bg-strong);
}

.glass-table tbody td {
    padding: 14px;
    font-size: 0.82rem;
    color: var(--tx-2);
    border-bottom: 1px solid rgba(139,92,246,0.05);
    white-space: nowrap;
}

.id-tag {
    font-weight: 700;
    color: var(--p400);
    font-size: 0.78rem;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-cell img {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
}
.user-cell-name { display: block; font-weight: 600; color: var(--tx-1); font-size: 0.82rem; }
.user-cell-email { display: block; font-size: 0.68rem; color: var(--tx-3); }

.val-col { font-weight: 700; color: var(--tx-1); }
.date-col { color: var(--tx-3); }

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
}
.badge-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}
.badge-status.success { background: rgba(52,211,153,0.1); color: var(--a-green); }
.badge-status.success::before { background: var(--a-green); box-shadow: 0 0 6px var(--a-green); }
.badge-status.warning { background: rgba(251,146,60,0.1); color: var(--a-orange); }
.badge-status.warning::before { background: var(--a-orange); box-shadow: 0 0 6px var(--a-orange); }
.badge-status.info { background: rgba(96,165,250,0.1); color: var(--a-blue); }
.badge-status.info::before { background: var(--a-blue); box-shadow: 0 0 6px var(--a-blue); }
.badge-status.danger { background: rgba(248,113,113,0.1); color: var(--a-red); }
.badge-status.danger::before { background: var(--a-red); box-shadow: 0 0 6px var(--a-red); }

/* Table Footer / Pagination */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 0;
    margin-top: 4px;
    border-top: 1px solid var(--glass-border);
}
.table-info { font-size: 0.72rem; color: var(--tx-3); }
.table-pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
    width: 32px; height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--tx-3);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
}
.page-btn:hover:not(:disabled) { background: var(--glass-bg); color: var(--tx-1); border-color: var(--glass-border); }
.page-btn.active {
    background: linear-gradient(135deg, var(--p600), var(--p500));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-dots { color: var(--tx-3); font-size: 0.78rem; padding: 0 4px; }

/* ═════════════════════════════════════════
   ACTIVITY FEED (Timeline)
   ═════════════════════════════════════════ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    max-height: 420px;
}

.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 8px;
    position: relative;
    transition: var(--t-fast);
    border-radius: var(--r-sm);
}
.activity-entry:hover { background: var(--glass-bg); }

/* Timeline line */
.activity-line {
    position: absolute;
    left: 30px;
    top: 48px;
    bottom: -14px;
    width: 2px;
    background: var(--glass-border);
}
.activity-entry:last-child .activity-line { display: none; }

.activity-icon-wrap {
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.activity-icon-wrap.green { background: rgba(52,211,153,0.12); color: var(--a-green); }
.activity-icon-wrap.purple { background: rgba(139,92,246,0.12); color: var(--p400); }
.activity-icon-wrap.orange { background: rgba(251,146,60,0.12); color: var(--a-orange); }
.activity-icon-wrap.blue { background: rgba(96,165,250,0.12); color: var(--a-blue); }
.activity-icon-wrap.pink { background: rgba(244,114,182,0.12); color: var(--a-pink); }

.activity-dot { display: none; }

.activity-body { flex: 1; min-width: 0; }
.activity-body p {
    font-size: 0.8rem;
    color: var(--tx-2);
    line-height: 1.4;
    margin: 0 0 3px;
}
.activity-body p strong { color: var(--tx-1); }
.activity-body span { font-size: 0.68rem; color: var(--tx-3); }

/* ═════════════════════════════════════════
   TOP PRODUCTS
   ═════════════════════════════════════════ */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}
.product-row:hover { background: var(--glass-bg-strong); }

.product-rank {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--tx-2);
    flex-shrink: 0;
}
.product-rank.gold {
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.1));
    border-color: rgba(251,191,36,0.3);
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(251,191,36,0.15);
}
.product-rank.silver {
    background: linear-gradient(135deg, rgba(156,163,175,0.2), rgba(107,114,128,0.1));
    border-color: rgba(156,163,175,0.3);
    color: #9ca3af;
}
.product-rank.bronze {
    background: linear-gradient(135deg, rgba(217,119,6,0.2), rgba(180,83,9,0.1));
    border-color: rgba(217,119,6,0.3);
    color: #d97706;
}

.product-details { flex: 1; min-width: 0; }
.product-name { display: block; font-size: 0.82rem; font-weight: 600; color: var(--tx-1); }
.product-meta { display: block; font-size: 0.68rem; color: var(--tx-3); }

/* Mini sparkline charts */
.mini-chart {
    width: 60px; height: 24px; flex-shrink: 0;
}
.mini-chart svg {
    width: 100%; height: 100%;
}
.mini-chart polyline {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mini-chart.up polyline { stroke: var(--a-green); }
.mini-chart.down polyline { stroke: var(--a-red); }

/* ═════════════════════════════════════════
   TASKS
   ═════════════════════════════════════════ */
/* Circular progress ring */
.task-progress-ring { width: 48px; height: 48px; }
.circular-chart { display: block; width: 100%; height: 100%; }
.circle-bg {
    fill: none;
    stroke: rgba(139,92,246,0.1);
    stroke-width: 3;
}
.circle {
    fill: none;
    stroke: var(--p500);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
    filter: drop-shadow(0 0 4px rgba(124,58,237,0.4));
}
.percentage {
    fill: var(--tx-1);
    font-size: 0.55rem;
    font-weight: 700;
    text-anchor: middle;
    font-family: 'Inter', sans-serif;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 380px;
    overflow-y: auto;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(139,92,246,0.03);
    border: 1px solid rgba(139,92,246,0.05);
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
}
.task-row:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}
.task-row.done { opacity: 0.45; }
.task-row.done .task-title { text-decoration: line-through; }

/* Custom Checkbox */
.custom-check {
    display: flex;
    cursor: pointer;
    position: relative;
}
.custom-check input { display: none; }
.custom-check-mark {
    width: 20px; height: 20px;
    border: 2px solid rgba(139,92,246,0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    position: relative;
    overflow: hidden;
}
.custom-check input:checked + .custom-check-mark {
    background: linear-gradient(135deg, var(--p600), var(--p500));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(124,58,237,0.3);
}
.custom-check input:checked + .custom-check-mark::after {
    content: '✓';
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
}
.custom-check-mark:hover {
    border-color: var(--p500);
}

.task-body { flex: 1; min-width: 0; }
.task-title { display: block; font-size: 0.8rem; font-weight: 500; color: var(--tx-1); margin-bottom: 1px; }
.task-sub { display: block; font-size: 0.68rem; color: var(--tx-3); }

.priority-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.priority-tag.high { background: rgba(248,113,113,0.1); color: var(--a-red); }
.priority-tag.medium { background: rgba(251,146,60,0.1); color: var(--a-orange); }
.priority-tag.low { background: rgba(52,211,153,0.1); color: var(--a-green); }

/* ═══ Performance Stats ═══ */
.perf-stats {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.perf-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}
.perf-stat-item:hover { background: var(--glass-bg); }
.perf-stat-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.perf-stat-label { display: block; font-size: 0.78rem; color: var(--tx-2); }
.perf-stat-val { display: block; font-size: 0.72rem; font-weight: 700; color: var(--p300); }

/* ═══ FOOTER ═══ */
.dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 8px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 10px;
}
.footer-left span { font-size: 0.75rem; color: var(--tx-3); }
.footer-right { display: flex; gap: 20px; }
.footer-right a {
    font-size: 0.75rem;
    color: var(--tx-3);
    text-decoration: none;
    transition: color var(--t-fast);
}
.footer-right a:hover { color: var(--p400); }

/* ═════════════════════════════════════════
   ANIMATIONS
   ═════════════════════════════════════════ */
.animate-in {
    opacity: 0;
    transform: translateY(24px);
    animation: slideUp 0.6s var(--ease) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ═════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .search-wrapper { width: 220px; }
    .topbar-date { display: none; }
    .topbar-profile-info { display: none; }
}

@media (max-width: 767.98px) {
    .page-content { padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-right { width: 100%; flex-wrap: wrap; }
    .page-header-right .date-filter { flex: 1; }
    .topbar { padding: 0 14px; }
    .search-wrapper { width: 160px; }
    .search-wrapper kbd { display: none; }
    .stat-number { font-size: 1.6rem; }
    .chart-box { height: 220px; }
    .table-responsive { overflow-x: auto; }
    .table-footer { flex-direction: column; gap: 10px; }
}

@media (max-width: 575.98px) {
    .search-wrapper { display: none; }
    .page-header h1 { font-size: 1.35rem; }
    .page-header-right > * { flex: 1; min-width: 0; }
    .btn-glass-outline span,
    .btn-glass-primary span { display: none; }
    .topbar-btn:not(#sidebarOpen) { width: 36px; height: 36px; }
    .fullscreen-btn { display: none; }
}
