/* ============================================
   Herbal Shop Admin Panel — Premium Redesign
   High-end, modern SaaS-grade design
   ============================================ */

/* ============ CSS Variables ============ */
:root {
    /* Brand Colors */
    --primary: #16A34A;
    --primary-light: #22C55E;
    --primary-dark: #15803D;
    --primary-50: rgba(22, 163, 74, 0.05);
    --primary-100: rgba(22, 163, 74, 0.1);
    --primary-200: rgba(22, 163, 74, 0.2);
    --secondary: #10B981;
    --accent: #34D399;
    --accent-light: #86EFAC;
    --accent-glow: rgba(16, 185, 129, 0.4);

    /* Semantic Colors */
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Neutrals */
    --bg-base: #F8FAF9;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-muted: #F1F5F3;
    --bg-hover: #F0F7F1;
    --text-primary: #0F1A11;
    --text-secondary: #5A6B5C;
    --text-tertiary: #8A9A8C;
    --text-inverse: #FFFFFF;
    --border-default: #E2E8E4;
    --border-subtle: #EEF2EF;
    --border-strong: #CBD5CE;

    /* Sidebar Dark Theme */
    --sidebar-bg-start: #0a1f0d;
    --sidebar-bg-end: #14331a;
    --sidebar-width: 260px;
    --sidebar-item-radius: 10px;

    /* Layout */
    --header-height: 64px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 26, 17, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 26, 17, 0.06), 0 1px 2px rgba(15, 26, 17, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 26, 17, 0.06), 0 2px 4px -2px rgba(15, 26, 17, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 26, 17, 0.08), 0 4px 6px -4px rgba(15, 26, 17, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 26, 17, 0.1), 0 8px 10px -6px rgba(15, 26, 17, 0.06);
    --shadow-2xl: 0 25px 50px -12px rgba(15, 26, 17, 0.2);
    --shadow-glow: 0 0 20px rgba(76, 175, 80, 0.15);
    --shadow-glow-strong: 0 0 30px rgba(76, 175, 80, 0.25);

    /* Radii */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.15s var(--ease-out);
    --transition: 0.25s var(--ease-out);
    --transition-slow: 0.4s var(--ease-out);
    --transition-page: 0.35s var(--ease-out);
}

/* ============ Reset & Base ============ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-base);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--secondary); }

/* ============ Custom Scrollbar ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Content scrollbar */
.content-area::-webkit-scrollbar { width: 8px; }
.content-area::-webkit-scrollbar-track { background: transparent; margin: 8px; }
.content-area::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}
.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
    background-clip: padding-box;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-wrapper {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1f0d 0%, #1B5E20 35%, #2E7D32 65%, #1B5E20 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated background texture */
.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(129, 199, 132, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(76, 175, 80, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(27, 94, 32, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

/* Grid pattern overlay */
.login-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* Floating leaves */
.login-leaves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.leaf {
    position: absolute;
    font-size: 24px;
    opacity: 0;
    animation: floatLeaf linear infinite;
}

.leaf-1 { left: 5%; font-size: 20px; animation-duration: 18s; animation-delay: 0s; }
.leaf-2 { left: 15%; font-size: 16px; animation-duration: 22s; animation-delay: 2s; }
.leaf-3 { left: 28%; font-size: 22px; animation-duration: 16s; animation-delay: 4s; }
.leaf-4 { left: 45%; font-size: 14px; animation-duration: 24s; animation-delay: 1s; }
.leaf-5 { left: 60%; font-size: 18px; animation-duration: 20s; animation-delay: 3s; }
.leaf-6 { left: 72%; font-size: 15px; animation-duration: 19s; animation-delay: 5s; }
.leaf-7 { left: 85%; font-size: 21px; animation-duration: 17s; animation-delay: 0.5s; }
.leaf-8 { left: 92%; font-size: 13px; animation-duration: 23s; animation-delay: 2.5s; }

@keyframes floatLeaf {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.2;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg) scale(1);
        opacity: 0;
    }
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: cardFadeIn 0.8s var(--ease-spring) both;
    overflow: hidden;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtle glow on card */
.login-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(76, 175, 80, 0.04) 0%, transparent 60%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.login-card .logo {
    font-size: 72px;
    margin-bottom: 8px;
    display: inline-block;
    animation: lobsterBounce 2s var(--ease-spring) infinite;
}

@keyframes lobsterBounce {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.12); }
    75% { transform: rotate(8deg) scale(1.12); }
}

.login-card h1 {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-card .subtitle {
    color: var(--text-tertiary);
    margin-bottom: 36px;
    font-size: 14px;
    font-weight: 400;
}
.login-shrimp {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    letter-spacing: 2px;
}

/* Floating label inputs */
.floating-group {
    position: relative;
    margin-bottom: 24px;
    text-align: left;
}

.floating-group input {
    width: 100%;
    height: 52px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 18px 16px 6px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: all var(--transition);
    outline: none;
    appearance: none;
}

.floating-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: all var(--transition);
    transform-origin: left center;
    font-weight: 400;
}

.floating-group input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label {
    top: 14px;
    transform: translateY(0) scale(0.75);
    color: var(--secondary);
    font-weight: 600;
}

.input-highlight {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    transition: all var(--transition);
    transform: translateX(-50%);
    border-radius: var(--radius-full);
}

.floating-group input:focus ~ .input-highlight {
    width: 100%;
}

/* Login Button */
.btn-login {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(27, 94, 32, 0.35);
    filter: brightness(1.05);
}

.btn-login:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(27, 94, 32, 0.3);
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.btn-login-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-login:hover .btn-login-shine {
    left: 100%;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 16px;
    min-height: 20px;
    font-weight: 500;
    animation: shakeError 0.4s ease;
}

.login-error:empty {
    animation: none;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ================================================================
   ADMIN LAYOUT
   ================================================================ */
.admin-layout {
    display: none;
    height: 100vh;
    overflow: hidden;
}

.admin-layout.active {
    display: flex;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Subtle glass effect */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 40%);
    pointer-events: none;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-header .brand-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: leafFloat 3s ease-in-out infinite;
}

@keyframes leafFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(3deg); }
}

.sidebar-header .brand-text {
    text-align: left;
}

.sidebar-header .brand-name {
    color: white;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.sidebar-header .brand-sub {
    color: var(--accent-light);
    font-size: 11px;
    margin-top: 1px;
    opacity: 0.6;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.sidebar-nav .nav-section {
    padding: 16px 12px 6px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.sidebar-nav .nav-section:first-child {
    padding-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13.5px;
    font-weight: 450;
    position: relative;
    user-select: none;
    border-radius: var(--sidebar-item-radius);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(76, 175, 80, 0.12);
    color: white;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.08) inset;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--secondary));
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    box-shadow: 0 0 8px rgba(129, 199, 132, 0.5);
}

.nav-item .nav-icon {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ================================================================
   MAIN WRAPPER
   ================================================================ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg-base);
}

/* ================================================================
   HEADER
   ================================================================ */
.header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(76, 175, 80, 0.1), transparent);
}

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

.header-left .page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right .admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right .admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--accent-light);
}

.btn-logout {
    background: transparent;
    border: 1.5px solid var(--border-default);
    padding: 7px 18px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.btn-logout:active {
    transform: translateY(0) scale(0.98);
}

/* ================================================================
   CONTENT AREA
   ================================================================ */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(76, 175, 80, 0.02) 0%, transparent 50%),
        var(--bg-base);
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    padding: 24px;
    margin-bottom: 24px;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.card-body {
    /* padding inside card content */
}

/* ================================================================
   DASHBOARD STATS
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--info), #60A5FA); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--success), var(--accent)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--danger), #F87171); }
.stat-card:nth-child(5)::before { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-card .stat-icon.blue { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); }
.stat-card .stat-icon.green { background: linear-gradient(135deg, #F0FDF4, #DCFCE7); }
.stat-card .stat-icon.orange { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); }
.stat-card .stat-icon.red { background: linear-gradient(135deg, #FEF2F2, #FEE2E2); }
.stat-card .stat-icon.purple { background: linear-gradient(135deg, #FAF5FF, #F3E8FF); }

.stat-card .stat-info .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -1px;
}

.stat-card .stat-info .stat-label {
    font-size: 12.5px;
    color: var(--text-tertiary);
    margin-top: 3px;
    font-weight: 500;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-toolbar .search-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg-muted);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom: 1px solid var(--border-default);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    transition: background var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(241, 245, 243, 0.4);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table thumbnail */
.table-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.1px;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(30%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    box-shadow: 0 4px 16px rgba(27, 94, 32, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #16A34A, var(--success));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #D97706, var(--warning));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #DC2626, var(--danger));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #2563EB, var(--info));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-info:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-default);
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius);
    padding: 0 14px;
    font-size: 13.5px;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
    background: var(--bg-surface);
    font-weight: 400;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238A9A8C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 400;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ================================================================
   STATUS BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #15803D;
}
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}
.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}
.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}
.badge-default {
    background: var(--bg-muted);
    color: var(--text-tertiary);
}
.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 450;
}

.pagination .page-btns {
    display: flex;
    gap: 4px;
}

.pagination .page-btns button {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--border-default);
    background: var(--bg-surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-btns button:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: var(--primary-50);
}

.pagination .page-btns button.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(27, 94, 32, 0.25);
}

.pagination .page-btns button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border-subtle);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 31, 13, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    animation: fadeIn 0.25s var(--ease-out);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-subtle);
    animation: modalScaleIn 0.35s var(--ease-spring);
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal.modal-lg {
    max-width: 800px;
}

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

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-muted);
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: var(--border-default);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-muted);
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    font-size: 14px;
    font-weight: 500;
    animation: toastSlideIn 0.4s var(--ease-spring);
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

/* Progress bar at bottom */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toastProgress 4s linear forwards;
}

.toast.success::after { background: linear-gradient(90deg, var(--success), var(--accent)); }
.toast.error::after { background: linear-gradient(90deg, var(--danger), #F87171); }
.toast.warning::after { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.toast.info::after { background: linear-gradient(90deg, var(--info), #60A5FA); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast .toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast .toast-msg { flex: 1; color: var(--text-primary); }

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
    flex-shrink: 0;
}

.toast .toast-close:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* ================================================================
   CONFIRM DIALOG
   ================================================================ */
.confirm-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 31, 13, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-box {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-subtle);
    animation: modalScaleIn 0.35s var(--ease-spring);
}

.confirm-box .confirm-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: inline-block;
}

.confirm-box h4 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.confirm-box p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
    font-weight: 450;
}

.confirm-box .confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.confirm-box .confirm-actions .btn {
    min-width: 88px;
}

/* ================================================================
   LOADING
   ================================================================ */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--radius-xl);
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    gap: 12px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state .empty-icon {
    font-size: 52px;
    margin-bottom: 16px;
    opacity: 0.5;
    display: inline-block;
    animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.empty-state p {
    font-size: 14px;
    font-weight: 450;
}

/* ================================================================
   DETAIL VIEW
   ================================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 28px;
}

.detail-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.detail-item .detail-label {
    color: var(--text-tertiary);
    font-size: 13px;
    white-space: nowrap;
    min-width: 70px;
    font-weight: 450;
}

.detail-item .detail-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.detail-full {
    grid-column: 1 / -1;
}

/* ================================================================
   TAB NAVIGATION
   ================================================================ */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-subtle);
    margin-bottom: 20px;
    gap: 4px;
}

.tab-nav .tab-item {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-weight: 500;
    border-radius: var(--radius) var(--radius) 0 0;
}

.tab-nav .tab-item:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.tab-nav .tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
}

/* ================================================================
   TOGGLE SWITCH
   ================================================================ */
.toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-strong);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page content animation class (applied via JS or CSS) */
.content-area > * {
    animation: contentFadeUp 0.4s var(--ease-out) both;
}

@keyframes contentFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 200;
        transition: left var(--transition-slow);
        box-shadow: var(--shadow-2xl);
    }
    .sidebar.open {
        left: 0;
    }
    .content-area {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .header {
        padding: 0 16px;
    }
    .modal {
        margin: 0 12px;
        max-height: calc(100vh - 60px);
    }
    .modal-overlay {
        padding-top: 30px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 36px 24px;
    }
    .login-card h1 {
        font-size: 22px;
    }
}

/* ================================================================
   UTILITY: Focus Visible (keyboard accessibility)
   ================================================================ */
:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* ================================================================
   PRINT: hide sidebar & header
   ================================================================ */
@media print {
    .sidebar, .header, .modal-overlay, .confirm-overlay, .toast-container {
        display: none !important;
    }
    .admin-layout {
        display: block !important;
    }
    .main-wrapper {
        width: 100% !important;
    }
}

/* ============ Analytics Page ============ */
.analytics-page {
    padding: 24px;
    animation: fadeInUp 0.4s ease;
}

.analytics-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #212121);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color, #E0E0E0);
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-card-blue::before { background: linear-gradient(90deg, #2196F3, #03A9F4); }
.stat-card-green::before { background: linear-gradient(90deg, #4CAF50, #8BC34A); }
.stat-card-orange::before { background: linear-gradient(90deg, #FF9800, #FFC107); }
.stat-card-purple::before { background: linear-gradient(90deg, #9C27B0, #E040FB); }
.stat-card-cyan::before { background: linear-gradient(90deg, #00BCD4, #26C6DA); }
.stat-card-teal::before { background: linear-gradient(90deg, #009688, #4DB6AC); }
.stat-card-indigo::before { background: linear-gradient(90deg, #3F51B5, #7986CB); }
.stat-card-pink::before { background: linear-gradient(90deg, #E91E63, #F48FB1); }

.stat-card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
}

.stat-card-content {
    flex: 1;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #212121);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary, #757575);
    margin-top: 4px;
}

.stat-card-trend {
    font-size: 12px;
    color: var(--text-light, #9E9E9E);
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Chart */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 8px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(180deg, #4CAF50, #81C784);
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: height 0.6s ease;
    min-height: 20px;
}

.chart-bar:hover {
    background: linear-gradient(180deg, #1B5E20, #4CAF50);
}

.chart-bar-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #212121);
}

.chart-bar-label {
    font-size: 12px;
    color: var(--text-secondary, #757575);
    margin-top: 8px;
}

.chart-empty {
    width: 100%;
    text-align: center;
    color: var(--text-light, #9E9E9E);
    padding: 40px;
}

/* Hot Products */
.hot-products-list {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.hot-product-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s ease;
}

.hot-product-item:last-child {
    border-bottom: none;
}

.hot-product-item:hover {
    background: #f9f9f9;
}

.hot-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #f5f5f5;
    color: var(--text-secondary, #757575);
    margin-right: 12px;
}

.hot-rank-top {
    background: linear-gradient(135deg, #FF9800, #FFC107);
    color: white;
}

.hot-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary, #212121);
}

.hot-views {
    font-size: 13px;
    color: var(--text-secondary, #757575);
}

/* Total Stats */
.total-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.total-stat-item {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.total-stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #1B5E20, #4CAF50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.total-stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary, #757575);
    margin-top: 8px;
}

/* Loading */
.analytics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
    color: var(--text-secondary, #757575);
}

.analytics-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f5f5f5;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .stat-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
    .total-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   V2 POLISH — 质感升级层（2026-08）
   页面动效 / 表格 / 按钮 / 弹窗 / 滚动条 等细节点缀
   ================================================================ */

/* 内容区切换渐入 */
.content-area { animation: pageFade .35s ease; }
@keyframes pageFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 卡片标题装饰条 */
.card-header h3 { position: relative; padding-left: 14px; }
.card-header h3::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

/* 统计数值：品牌渐变文字 */
.stat-card .stat-info .stat-value {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 统计卡悬浮强化 */
.stat-card:hover { box-shadow: var(--shadow-xl); }
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-5deg); }

/* 侧边栏导航微动效 */
.nav-item { transition: background .2s ease, transform .15s ease; }
.nav-item:hover { transform: translateX(3px); }

/* 待办角标脉冲 */
.nav-badge { animation: badgePulse 2s infinite; }
@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 表格强化 */
.data-table thead th {
    background: linear-gradient(180deg, var(--bg-hover), #E4F1E8);
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: .5px;
}
.data-table tbody tr { transition: background .15s ease; }

/* 按钮渐变质感 */
.btn { transition: all .2s ease; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--secondary));
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(22, 163, 74, 0.38); }
.btn-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }
.btn-warning:hover { filter: brightness(1.05); }
.btn-info { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.btn-info:hover { filter: brightness(1.05); }
.btn-danger { background: linear-gradient(135deg, #DC2626, #EF4444); }
.btn-danger:hover { filter: brightness(1.05); }

/* 弹窗/确认框入场动画 */
.modal-overlay, .confirm-overlay { animation: overlayIn .2s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal, .confirm-box { animation: modalIn .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to { opacity: 1; transform: none; }
}

/* 空状态图标浮动 */
.empty-state .empty-icon { animation: floatY 2.6s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(22, 163, 74, 0.32); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(22, 163, 74, 0.55); }
::-webkit-scrollbar-track { background: transparent; }

/* 管理员头像 */
.admin-avatar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* 登录 Logo 呼吸 */
.logo { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* 页面标题下划线 */
.page-title { position: relative; }
.page-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 100%; height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
}

/* Toast 平滑入场 */
.toast-container .toast { animation: toastIn .3s cubic-bezier(.16, 1, .3, 1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* ================================================================
   挂载商品选择器（视频/文章挂载商品）
   ================================================================ */
.picked-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 600;
}

.chip-x {
    margin-left: 6px;
    cursor: pointer;
    color: var(--danger);
    font-style: normal;
    font-weight: 800;
}

.chip-empty {
    color: var(--text-tertiary);
    font-size: 13px;
}

.picker-btn { margin-top: 6px; }

.picker-current {
    background: var(--bg-muted);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.picker-list {
    max-height: 360px;
    overflow-y: auto;
}

.picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.picker-name {
    font-size: 13.5px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.picker-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.picker-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-tertiary);
    font-size: 13px;
}
/* ================================================================
   分类管理（emoji 快捷选择等）
   ================================================================ */
.category-icon { font-size: 18px; margin-right: 4px; }

.emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.emoji-opt {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: var(--bg-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-opt:hover {
    background: var(--primary-100);
    border-color: var(--primary);
    transform: scale(1.12);
}
/* ================================================================
   规格编辑器 / 轮播缩略图 / 系统设置
   ================================================================ */
.spec-editor { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: flex; gap: 8px; align-items: center; }
.spec-row .form-control { flex: 1; min-width: 0; }
.spec-row .form-control[data-field="price"] { max-width: 110px; }
.spec-row .form-control[data-field="stock"] { max-width: 90px; }
.spec-row .btn { flex-shrink: 0; }

.banner-thumb { width: 110px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-default); }

.gzh-preview { max-width: 140px; border-radius: 8px; border: 1px solid var(--border-default); margin-top: 6px; display: block; }

.tip-box {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg-muted);
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 上传按钮组 */
.upload-hint { margin-top: 4px; font-size: 12px; color: var(--text-tertiary); }
/* 权限选择 */
.perm-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.perm-chip {
    padding: 6px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-default);
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.perm-chip.on { background: var(--primary-100); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.perm-all { margin-bottom: 6px; font-size: 13px; color: var(--text-primary); }/* 上传即时预览 */
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pv-img { width: 110px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-default); }
.pv-video { width: 180px; height: 96px; border-radius: 8px; background: #000; }/* ================================================================
   V3 PREMIUM — 高大上视觉层（2026-08）
   侧边栏 / 顶栏 / 卡片 / 表格 / 按钮 / 弹窗 质感统一升级
   ================================================================ */
:root {
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-premium: 0 12px 32px -8px rgba(15, 26, 17, 0.14), 0 4px 12px -4px rgba(15, 26, 17, 0.08);
}

body { background: linear-gradient(180deg, #F4F8F5 0%, #EAF1EC 100%); }

/* ===== 备案号页脚 ===== */
.footer-beian {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32rpx;
  background: rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9CA3AF;
  z-index: 50;
}
.footer-beian a {
  color: #9CA3AF;
  text-decoration: none;
}
.footer-beian a:hover {
  color: #15803D;
}
.content-area { animation: pageFade .35s ease; }

/* ---- 侧边栏 ---- */
.sidebar {
    background: linear-gradient(180deg, #0C2312 0%, #123A1D 55%, #0D3820 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.04), 6px 0 24px rgba(2, 10, 5, 0.25);
}
.sidebar-header { border-bottom: 1px solid rgba(255,255,255,0.07); }
.brand-icon {
    background: linear-gradient(135deg, #16A34A, #10B981);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.nav-section { color: rgba(255,255,255,0.38); letter-spacing: 1px; }
.nav-item {
    border-radius: 10px;
    transition: all .22s ease;
    color: rgba(255,255,255,0.72);
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; transform: translateX(3px); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.55), rgba(16, 185, 129, 0.18));
    color: #fff;
    box-shadow: inset 3px 0 0 #34D399, 0 8px 20px rgba(2, 10, 5, 0.3);
    font-weight: 600;
}

/* ---- 顶栏 ---- */
.header {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}
.page-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(120deg, #14532D, #15803D 60%, #0D9488);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.admin-avatar { box-shadow: 0 4px 12px rgba(22,163,74,0.35); }

/* ---- 卡片 ---- */
.card {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(226, 232, 228, 0.7);
    box-shadow: var(--shadow-premium);
    transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: 0 18px 44px -12px rgba(15, 26, 17, 0.2); }
.card-header h3 { letter-spacing: .3px; }

/* ---- 数据表格 ---- */
.data-table { border-radius: var(--radius-lg); overflow: hidden; }
.data-table thead th {
    background: linear-gradient(180deg, #F0F7F1, #E4F1E8);
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: .4px;
    border-bottom: 1px solid #D7E8DC;
}
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #F0FBF3; }

/* ---- 按钮 ---- */
.btn { border-radius: 10px; transition: all .2s ease; font-weight: 600; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--secondary));
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(22, 163, 74, 0.4); }
.btn-outline { border: 1px solid #D5E3DA; color: var(--primary-dark); }
.btn-outline:hover { background: #EFF8F1; border-color: #B7D5C2; }

/* ---- 徽章/标签 ---- */
.badge { border-radius: 8px; font-weight: 600; letter-spacing: .2px; }

/* ---- 统计卡（仪表盘） ---- */
.stat-card { border-radius: var(--radius-xl); border: 1px solid var(--border-subtle); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px -12px rgba(15, 26, 17, 0.22); }
.stat-card .stat-icon { border-radius: 14px; box-shadow: 0 6px 14px rgba(15,26,17,0.08); }

/* ---- 弹窗/确认框 ---- */
.modal, .confirm-box {
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(6, 16, 9, 0.35);
    overflow: hidden;
}
.modal-header, .confirm-box h4 { background: linear-gradient(120deg, #F0F8F2, #E4F1E8); }

/* ---- 分页 ---- */
.pagination .btn { border-radius: 8px; }
.pagination .btn.active { background: linear-gradient(135deg, #15803D, #16A34A); border-color: transparent; color: #fff; }

/* ---- 空态 ---- */
.empty-state .empty-icon { animation: floatY 2.6s ease-in-out infinite; }

/* ---- Toast ---- */
.toast { border-radius: 12px; box-shadow: 0 10px 28px rgba(6,16,9,.22); }

/* ---- 滚动条（侧栏深色内） ---- */
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
/* 大图预览灯箱 */
#imgLightbox { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; }
.lightbox-mask { position: absolute; inset: 0; background: rgba(6, 16, 9, 0.75); }
.lightbox-img { position: relative; max-width: 90vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); cursor: zoom-out; }

/* 客服聊天视图 */
.chat-box-view { max-height: 340px; overflow-y: auto; background: #F5F7F6; border-radius: 12px; padding: 12px; }
.chat-line { display: flex; margin-bottom: 10px; align-items: flex-start; }
.chat-line.admin { justify-content: flex-start; }
.chat-line.user { justify-content: flex-end; }
.chat-tag { flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin: 6px 6px 0 0; }
.chat-line.user .chat-tag { background: var(--primary-100); color: var(--primary-dark); order: 2; margin: 6px 0 0 6px; }
.chat-line.admin .chat-tag { background: #DBEAFE; color: #1D4ED8; }
.chat-bubble { max-width: 76%; font-size: 13px; line-height: 1.6; padding: 8px 12px; border-radius: 12px; background: #fff; color: var(--text-primary); box-shadow: 0 2px 8px rgba(15,26,17,.06); }
.chat-line.user .chat-bubble { background: linear-gradient(135deg, #15803D, #16A34A); color: #fff; }
.chat-time { font-size: 10px; opacity: 0.6; margin-top: 3px; }
/* ===== 列表缩略图：固定尺寸 ===== */
.pv-list {
  width: 60px !important;
  height: 60px !important;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #E2E8EQ;
  cursor: zoom-in;
  vertical-align: middle;
  display: inline-block;
}
/* 文章封面横图（80x56） */
.pv-cover {
  width: 80px !important;
  height: 56px !important;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  cursor: zoom-in;
  vertical-align: middle;
  display: inline-block;
}
/* 视频预览：封面 + 播放按钮 */
.pv-video-cell {
  position: relative;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  display: inline-block;
  cursor: pointer;
}
.pv-video-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pv-video-cell .pv-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  background: rgba(0,0,0,0.25);
}
/* 列表视频预览单元格 */
.pv-video-cell {
  position: relative;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  display: inline-block;
  cursor: pointer;
}
.pv-video-cell img { width:100%; height:100%; object-fit:cover; display:block; }
.pv-video-cell .pv-play {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:20px;
  background:rgba(0,0,0,.25);
}