        /* ========== CSS VARIABLES ========== */
        :root {
            --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-mono: 'JetBrains Mono', monospace;
            --radius: 16px;
            --radius-sm: 8px;
            --radius-lg: 24px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --shadow-glow: 0 0 60px var(--primary-alpha);
        }

        /* Color Schemes */
        [data-color="emerald"] {
            --primary: #10b981;
            --primary-light: #34d399;
            --primary-dark: #059669;
            --primary-alpha: rgba(16, 185, 129, 0.3);
            --gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
        }
        [data-color="violet"] {
            --primary: #8b5cf6;
            --primary-light: #a78bfa;
            --primary-dark: #7c3aed;
            --primary-alpha: rgba(139, 92, 246, 0.3);
            --gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        }
        [data-color="rose"] {
            --primary: #f43f5e;
            --primary-light: #fb7185;
            --primary-dark: #e11d48;
            --primary-alpha: rgba(244, 63, 94, 0.3);
            --gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
        }
        [data-color="amber"] {
            --primary: #f59e0b;
            --primary-light: #fbbf24;
            --primary-dark: #d97706;
            --primary-alpha: rgba(245, 158, 11, 0.3);
            --gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        }
        [data-color="cyan"] {
            --primary: #06b6d4;
            --primary-light: #22d3ee;
            --primary-dark: #0891b2;
            --primary-alpha: rgba(6, 182, 212, 0.3);
            --gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
        }
        [data-color="indigo"] {
            --primary: #6366f1;
            --primary-light: #818cf8;
            --primary-dark: #4f46e5;
            --primary-alpha: rgba(99, 102, 241, 0.3);
            --gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
        }

        /* Dark Theme */
        [data-theme="dark"] {
            --bg-primary: #09090b;
            --bg-secondary: #0f0f12;
            --bg-card: rgba(18, 18, 24, 0.8);
            --bg-card-hover: rgba(24, 24, 32, 0.9);
            --bg-input: rgba(255, 255, 255, 0.05);
            --border: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(255, 255, 255, 0.15);
            --text-primary: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.7);
            --text-muted: rgba(255, 255, 255, 0.4);
            --text: var(--text-primary);
            --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
            /* Sticky column solid colors */
            --sticky-bg: #121218;
            --sticky-header-bg: #1a1a22;
            --sticky-hover-bg: #1f1f28;
        }

        /* Light Theme */
        [data-theme="light"] {
            --bg-primary: #f8fafc;
            --bg-secondary: #ffffff;
            --bg-card: rgba(255, 255, 255, 0.9);
            --bg-card-hover: rgba(255, 255, 255, 1);
            --bg-input: rgba(0, 0, 0, 0.05);
            --border: rgba(0, 0, 0, 0.08);
            --border-hover: rgba(0, 0, 0, 0.15);
            --text-primary: #0f172a;
            --text-secondary: rgba(15, 23, 42, 0.7);
            --text-muted: rgba(15, 23, 42, 0.4);
            --text: var(--text-primary);
            --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
            /* Sticky column solid colors */
            --sticky-bg: #ffffff;
            --sticky-header-bg: #f5f5f5;
            --sticky-hover-bg: #f0f0f0;
        }

        /* ========== RESET & BASE ========== */
        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
            overflow-x: hidden;
        }

        body {
            font-family: var(--font-main);
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
            transition: var(--transition);
        }

        .app-container {
            overflow-x: hidden;
            width: 100%;
        }

        /* ========== ANIMATED BACKGROUND ========== */
        .bg-animation {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
            width: 100vw;
            height: 100vh;
        }

        .bg-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.5;
            animation: float 20s ease-in-out infinite;
            will-change: transform;
        }

        .bg-orb-1 {
            width: 600px;
            height: 600px;
            background: var(--primary-alpha);
            top: -200px;
            right: -100px;
        }

        .bg-orb-2 {
            width: 400px;
            height: 400px;
            background: var(--primary-alpha);
            bottom: -100px;
            left: -100px;
            animation-delay: -10s;
            animation-direction: reverse;
        }

        .bg-orb-3 {
            width: 300px;
            height: 300px;
            background: var(--primary-alpha);
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            animation-delay: -5s;
        }

        .bg-grid {
            position: absolute;
            inset: 0;
            background-image: 
                linear-gradient(var(--border) 1px, transparent 1px),
                linear-gradient(90deg, var(--border) 1px, transparent 1px);
            background-size: 60px 60px;
            opacity: 0.5;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(30px, -50px) scale(1.05); }
            66% { transform: translate(-20px, 30px) scale(0.95); }
        }

        /* ========== LAYOUT ========== */
        .app-container {
            display: flex;
            min-height: 100vh;
            position: relative;
        }

        /* ========== SIDEBAR ========== */
        .sidebar {
            width: 280px;
            height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            z-index: 1;
            transition: var(--transition);
        }

        .sidebar.collapsed {
            width: 80px;
        }

        .sidebar-header {
            padding: 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .logo-icon {
            width: 46px;
            height: 46px;
            background: var(--gradient);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-glow);
            flex-shrink: 0;
        }

        .logo-icon svg {
            width: 26px;
            height: 26px;
            color: white;
        }

        .logo-text {
            overflow: hidden;
            transition: var(--transition);
        }

        .collapsed .logo-text {
            width: 0;
            opacity: 0;
        }

        .logo-text h1 {
            font-size: 22px;
            font-weight: 800;
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: -0.5px;
        }

        .logo-text span {
            font-size: 10px;
            color: var(--text-muted);
            letter-spacing: 2px;
            font-weight: 600;
        }

        .sidebar-nav {
            flex: 1;
            padding: 20px 12px;
            overflow-y: auto;
        }

        .nav-section {
            margin-bottom: 24px;
        }

        .nav-section-title {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 1.5px;
            padding: 0 16px;
            margin-bottom: 8px;
            text-transform: uppercase;
            transition: var(--transition);
        }

        .collapsed .nav-section-title {
            opacity: 0;
            height: 0;
            margin: 0;
            overflow: hidden;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            border: none;
            background: transparent;
            width: 100%;
            text-align: left;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 14px;
            font-weight: 500;
            text-decoration: none;
        }

        .collapsed .nav-item {
            justify-content: center;
            padding: 14px;
        }

        .nav-item:hover {
            background: var(--bg-input);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
            color: var(--primary);
        }

        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 24px;
            background: var(--gradient);
            border-radius: 0 4px 4px 0;
        }

        .nav-item svg {
            width: 20px;
            height: 20px;
            flex-shrink: 0;
        }

        .nav-item-text {
            flex: 1;
            transition: var(--transition);
        }

        .collapsed .nav-item-text {
            display: none;
        }

        .nav-badge {
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            background: var(--primary);
            color: white;
        }

        .collapsed .nav-badge {
            display: none;
        }

        .sidebar-footer {
            padding: 16px;
            border-top: 1px solid var(--border);
        }

        .collapse-btn {
            width: 100%;
            padding: 12px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-family: inherit;
            font-size: 13px;
            font-weight: 500;
            transition: var(--transition);
        }

        .collapse-btn:hover {
            background: var(--bg-input);
            border-color: var(--border-hover);
        }

        .collapse-btn svg {
            transition: var(--transition);
        }

        .collapsed .collapse-btn svg {
            transform: rotate(180deg);
        }

        .collapsed .collapse-btn span {
            display: none;
        }

        /* ========== MAIN CONTENT ========== */
        .main-content {
            flex: 1;
            margin-left: 280px;
            transition: var(--transition);
            max-width: 100%;
            overflow-x: hidden;
            position: relative;
            z-index: 1;
        }

        .sidebar.collapsed + .main-content {
            margin-left: 80px;
        }

        /* ========== PAGE CONTENT ========== */
        .page-content {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            height: calc(100vh - 73px); /* Viewport - Header height */
            position: relative;
        }

        /* ========== HEADER ========== */
        .header {
            position: sticky;
            top: 0;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border);
            padding: 16px 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 1000;
            gap: 16px;
            overflow: visible;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 24px;
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .header-title h2 {
            font-size: 24px;
            font-weight: 700;
            letter-spacing: -0.5px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .header-title p {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .search-box {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 20px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            min-width: 280px;
            max-width: 100%;
            transition: var(--transition);
            flex-shrink: 1;
            overflow: hidden;
            cursor: pointer;
            font-family: inherit;
        }

        .search-box:hover {
            border-color: var(--primary);
            background: var(--bg-card-hover);
        }

        .search-box:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-alpha);
        }

        .search-box svg {
            color: var(--text-muted);
            width: 18px;
            height: 18px;
            flex-shrink: 0;
        }

        .search-placeholder {
            flex: 1;
            color: var(--text-muted);
            font-size: 14px;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .search-box kbd {
            padding: 4px 8px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 6px;
            font-family: var(--font-mono);
            font-size: 11px;
            color: var(--text-muted);
            flex-shrink: 0;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            position: relative;
            z-index: 100;
        }

        .header-btn {
            width: 44px;
            height: 44px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: var(--transition);
        }

        .header-btn:hover {
            background: var(--bg-card-hover);
            border-color: var(--border-hover);
            color: var(--text-primary);
        }

        .header-btn svg {
            width: 20px;
            height: 20px;
        }

        .header-btn .badge {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 8px;
            height: 8px;
            background: var(--primary);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--primary);
        }

        .user-menu {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 16px 8px 8px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
        }

        .user-menu:hover {
            background: var(--bg-card-hover);
            border-color: var(--border-hover);
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: var(--gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: white;
            font-size: 14px;
        }

        .user-info {
            text-align: left;
        }

        .user-info .name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .user-info .role {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* ========== DASHBOARD CONTENT ========== */
        .dashboard {
            padding: 32px;
            max-width: 100%;
            overflow-x: hidden;
            position: relative;
            z-index: 1;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 24px;
            margin-bottom: 32px;
            max-width: 100%;
        }

        .stat-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 24px;
            position: relative;
            overflow: hidden;
            transition: var(--transition);
            animation: slideUp 0.5s ease forwards;
            opacity: 0;
            max-width: 100%;
            z-index: 1;
        }

        .stat-card:nth-child(1) { animation-delay: 0.1s; }
        .stat-card:nth-child(2) { animation-delay: 0.2s; }
        .stat-card:nth-child(3) { animation-delay: 0.3s; }
        .stat-card:nth-child(4) { animation-delay: 0.4s; }

        .stat-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-card);
            border-color: var(--border-hover);
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--gradient);
            opacity: 0;
            transition: var(--transition);
        }

        .stat-card:hover::before {
            opacity: 1;
        }

        .stat-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .stat-icon {
            width: 48px;
            height: 48px;
            border-radius: var(--radius);
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
        }

        .stat-icon svg {
            width: 24px;
            height: 24px;
        }

        .stat-trend {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .stat-trend.up {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }

        .stat-trend.down {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        .stat-trend svg {
            width: 14px;
            height: 14px;
        }

        .stat-value {
            font-size: 32px;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 4px;
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-muted);
            font-weight: 500;
        }

        .stat-chart {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            opacity: 0.3;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Main Grid */
        .main-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 24px;
            margin-bottom: 32px;
            max-width: 100%;
        }

        .card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: var(--transition);
            max-width: 100%;
            position: relative;
            z-index: 1;
        }

        .card:hover {
            box-shadow: var(--shadow-card);
        }

        .card-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .card-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .card-title h3 {
            font-size: 16px;
            font-weight: 700;
        }

        .card-title-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
        }

        .card-title-icon svg {
            width: 18px;
            height: 18px;
        }

        .card-actions {
            display: flex;
            gap: 8px;
        }

        .card-action-btn {
            padding: 8px 16px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
        }

        .card-action-btn:hover {
            background: var(--bg-input);
            border-color: var(--border-hover);
        }

        .card-action-btn.primary {
            background: var(--gradient);
            border: none;
            color: white;
        }

        .card-action-btn.primary:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        .card-body {
            padding: 24px;
        }

        /* Chart Container */
        .chart-container {
            height: 300px;
            position: relative;
        }

        /* Bar Chart */
        .bar-chart {
            height: 100%;
            display: flex;
            flex-direction: column;
            padding: 20px 0;
        }

        .bar-chart-bars {
            flex: 1;
            display: flex;
            align-items: flex-end;
            justify-content: space-around;
            gap: 12px;
            padding: 0 10px;
        }

        .bar-chart-bars .bar {
            flex: 1;
            max-width: 60px;
            height: var(--height, 50%);
            background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
            border-radius: 6px 6px 0 0;
            position: relative;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .bar-chart-bars .bar:hover {
            filter: brightness(1.1);
            transform: scaleY(1.02);
            transform-origin: bottom;
        }

        .bar-chart-bars .bar.active {
            background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
            box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4);
        }

        .bar-chart-bars .bar .bar-value {
            position: absolute;
            top: -28px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 12px;
            font-weight: 600;
            color: var(--text-primary);
            opacity: 0;
            transition: opacity 0.2s ease;
            white-space: nowrap;
        }

        .bar-chart-bars .bar:hover .bar-value {
            opacity: 1;
        }

        .bar-chart-labels {
            display: flex;
            justify-content: space-around;
            padding: 16px 10px 0;
            border-top: 1px solid var(--border);
            margin-top: 12px;
        }

        .bar-chart-labels span {
            font-size: 12px;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* Donut Chart */
        .donut-chart {
            position: relative;
            width: 160px;
            height: 160px;
            margin: 0 auto;
        }

        .donut-chart .donut {
            width: 100%;
            height: 100%;
            transform: rotate(-90deg);
        }

        .donut-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .donut-total {
            display: block;
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .donut-label {
            display: block;
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* Marketplace Grid */
        .marketplace-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            max-width: 100%;
        }

        .marketplace-card {
            padding: 20px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            transition: var(--transition);
            cursor: pointer;
            overflow: hidden;
            max-width: 100%;
        }

        .marketplace-card:hover {
            background: var(--bg-card-hover);
            border-color: var(--primary);
            transform: translateY(-2px);
        }

        .marketplace-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
            overflow: hidden;
        }

        .marketplace-logo {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            background: var(--bg-card);
            flex-shrink: 0;
        }

        .marketplace-name {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .marketplace-name h4 {
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .marketplace-name span {
            font-size: 11px;
            color: var(--text-muted);
        }

        .marketplace-status {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #10b981;
            box-shadow: 0 0 10px #10b981;
            flex-shrink: 0;
        }

        .marketplace-stats {
            display: flex;
            justify-content: space-between;
        }

        .marketplace-stat {
            text-align: center;
        }

        .marketplace-stat-value {
            font-size: 16px;
            font-weight: 700;
            color: var(--primary);
        }

        .marketplace-stat-label {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Orders Table */
        .orders-section {
            margin-bottom: 32px;
            max-width: 100%;
            overflow: hidden;
        }

        .table-container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            max-width: 100%;
        }

        .orders-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px;
        }

        .orders-table th {
            text-align: left;
            padding: 14px 20px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid var(--border);
        }

        .orders-table td {
            padding: 16px 20px;
            font-size: 14px;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }

        .orders-table tbody tr {
            transition: var(--transition);
        }

        .orders-table tbody tr:hover {
            background: var(--bg-input);
        }

        .order-id {
            font-family: var(--font-mono);
            font-weight: 600;
            color: var(--primary);
        }

        .customer-cell {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .customer-avatar {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: var(--gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 13px;
        }

        .customer-name {
            font-weight: 500;
        }

        .marketplace-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--bg-input);
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }

        .marketplace-badge-icon {
            font-size: 14px;
        }

        .amount-cell {
            font-weight: 700;
            font-family: var(--font-mono);
        }

        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .status-badge.processing {
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
        }

        .status-badge.shipped {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
        }

        .status-badge.delivered {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }

        .status-badge.cancelled {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }

        .time-cell {
            color: var(--text-muted);
            font-size: 13px;
        }

        /* Bottom Grid */
        .bottom-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
            max-width: 100%;
        }

        /* Inventory Donut */
        .inventory-chart {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 200px;
            max-width: 100%;
        }

        .inventory-legend {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 20px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .legend-color {
            width: 12px;
            height: 12px;
            border-radius: 4px;
        }

        .legend-label {
            flex: 1;
            font-size: 13px;
            color: var(--text-secondary);
        }

        .legend-value {
            font-weight: 700;
            font-family: var(--font-mono);
        }

        /* Quick Actions */
        .quick-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .quick-action-btn {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 16px 20px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
            text-align: left;
            color: var(--text-primary);
        }

        .quick-action-btn:hover {
            background: var(--bg-card-hover);
            border-color: var(--primary);
            transform: translateX(4px);
        }

        .quick-action-btn svg {
            width: 20px;
            height: 20px;
            color: var(--primary);
        }

        .quick-action-text {
            flex: 1;
        }

        .quick-action-text h4 {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .quick-action-text p {
            font-size: 12px;
            color: var(--text-muted);
        }

        .quick-action-arrow {
            color: var(--text-muted);
        }

        /* Sync Status */
        .sync-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            max-width: 100%;
        }

        .sync-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            background: var(--bg-input);
            border-radius: var(--radius);
            overflow: hidden;
        }

        .sync-icon {
            font-size: 20px;
            flex-shrink: 0;
        }

        .sync-info {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .sync-info h4 {
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sync-info p {
            font-size: 11px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sync-status {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            font-weight: 600;
            color: #10b981;
            flex-shrink: 0;
        }

        .sync-status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #10b981;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(1.2); }
        }

        /* ========== SETTINGS PANEL ========== */
        .settings-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 200;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
        }

        .settings-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .settings-panel {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border);
            z-index: 201;
            display: flex;
            flex-direction: column;
            transition: var(--transition);
        }

        .settings-panel.active {
            right: 0;
        }

        .settings-header {
            padding: 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .settings-header h2 {
            font-size: 20px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .settings-header h2 svg {
            color: var(--primary);
        }

        .settings-close {
            width: 40px;
            height: 40px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .settings-close:hover {
            background: var(--bg-input);
            color: var(--text-primary);
        }

        .settings-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        .settings-section {
            margin-bottom: 32px;
        }

        .settings-section-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            margin-bottom: 16px;
        }

        /* Theme Toggle */
        .theme-toggle {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .theme-option {
            padding: 20px;
            border-radius: var(--radius);
            border: 2px solid var(--border);
            background: var(--bg-input);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .theme-option:hover {
            border-color: var(--border-hover);
        }

        .theme-option.active {
            border-color: var(--primary);
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
        }

        .theme-option-icon {
            width: 48px;
            height: 48px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .theme-option-icon.light {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            color: #f59e0b;
        }

        .theme-option-icon.dark {
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
            color: #a5b4fc;
        }

        .theme-option-icon svg {
            width: 24px;
            height: 24px;
        }

        .theme-option-label {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }

        /* Color Scheme */
        .color-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .color-option {
            padding: 16px;
            border-radius: var(--radius);
            border: 2px solid var(--border);
            background: var(--bg-input);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .color-option:hover {
            border-color: var(--border-hover);
            transform: translateY(-2px);
        }

        .color-option.active {
            border-color: currentColor;
        }

        .color-swatch {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .color-option-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
        }

        /* Border Radius Slider */
        .radius-slider-container {
            padding: 20px;
            background: var(--bg-input);
            border-radius: var(--radius);
            border: 1px solid var(--border);
        }

        .radius-preview {
            display: flex;
            justify-content: center;
            gap: 16px;
            margin-bottom: 20px;
        }

        .radius-preview-box {
            width: 60px;
            height: 60px;
            background: var(--gradient);
            transition: var(--transition);
        }

        .radius-slider-wrapper {
            position: relative;
        }

        .radius-slider {
            width: 100%;
            height: 8px;
            border-radius: 4px;
            background: var(--border);
            -webkit-appearance: none;
            appearance: none;
            cursor: pointer;
        }

        .radius-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--gradient);
            cursor: pointer;
            box-shadow: 0 2px 10px var(--primary-alpha);
            transition: var(--transition);
        }

        .radius-slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
        }

        .radius-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 12px;
        }

        .radius-labels span {
            font-size: 11px;
            color: var(--text-muted);
            font-weight: 500;
        }

        .radius-value {
            text-align: center;
            margin-top: 16px;
            font-size: 24px;
            font-weight: 700;
            color: var(--primary);
            font-family: var(--font-mono);
        }

        /* Language Selector */
        .language-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
        }

        .language-option {
            padding: 16px 20px;
            border-radius: var(--radius);
            border: 2px solid var(--border);
            background: var(--bg-input);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .language-option:hover {
            border-color: var(--border-hover);
        }

        .language-option.active {
            border-color: var(--primary);
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
        }

        .language-flag {
            font-size: 24px;
        }

        .language-info h4 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .language-info p {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* Settings Footer */
        .settings-footer {
            padding: 20px 24px;
            border-top: 1px solid var(--border);
        }

        .reset-btn {
            width: 100%;
            padding: 14px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .reset-btn:hover {
            background: rgba(239, 68, 68, 0.1);
            border-color: #ef4444;
            color: #ef4444;
        }

        /* ========== MOBILE BOTTOM NAVIGATION ========== */
        .mobile-bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 80px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
            backdrop-filter: blur(20px);
            z-index: 200;
            padding: 8px 16px;
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
        }

        .mobile-bottom-nav-inner {
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 100%;
            max-width: 500px;
            margin: 0 auto;
        }

        .mobile-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 8px 16px;
            border-radius: var(--radius);
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            min-width: 64px;
            font-family: inherit;
        }

        .mobile-nav-item:active {
            transform: scale(0.95);
        }

        .mobile-nav-item.active {
            color: var(--primary);
        }

        .mobile-nav-item.active .mobile-nav-icon {
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
        }

        .mobile-nav-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .mobile-nav-item svg {
            width: 24px;
            height: 24px;
        }

        .mobile-nav-label {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .mobile-nav-badge {
            position: absolute;
            top: 4px;
            right: 12px;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            border-radius: 9px;
            background: var(--primary);
            color: white;
            font-size: 10px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px var(--primary-alpha);
        }

        .mobile-nav-dot {
            position: absolute;
            top: 8px;
            right: 16px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #ef4444;
            box-shadow: 0 0 8px #ef4444;
            animation: pulse 2s infinite;
        }

        /* Mobile Account Popup */
        .mobile-account-popup {
            position: fixed;
            bottom: 100px;
            left: 16px;
            right: 16px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
            z-index: 199;
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: var(--transition);
            max-height: calc(100vh - 140px);
            overflow-y: auto;
            overflow-x: hidden;
            max-width: calc(100vw - 32px);
        }

        .mobile-account-popup.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .mobile-account-header {
            padding: 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .mobile-account-avatar {
            width: 56px;
            height: 56px;
            border-radius: var(--radius);
            background: var(--gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            font-weight: 700;
            color: white;
            flex-shrink: 0;
        }

        .mobile-account-info {
            flex: 1;
        }

        .mobile-account-info h4 {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .mobile-account-info p {
            font-size: 13px;
            color: var(--text-muted);
        }

        .mobile-account-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
            font-size: 11px;
            font-weight: 600;
        }

        .mobile-account-status span {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }

        .mobile-account-body {
            padding: 16px;
        }

        .mobile-account-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 16px;
        }

        .mobile-account-stat {
            padding: 16px 12px;
            background: var(--bg-input);
            border-radius: var(--radius);
            text-align: center;
        }

        .mobile-account-stat-value {
            font-size: 20px;
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 4px;
        }

        .mobile-account-stat-label {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .mobile-account-actions {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .mobile-account-action {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 16px;
            border-radius: var(--radius);
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            text-align: left;
            width: 100%;
        }

        .mobile-account-action:hover,
        .mobile-account-action:active {
            background: var(--bg-input);
            color: var(--text-primary);
        }

        .mobile-account-action svg {
            width: 20px;
            height: 20px;
        }

        .mobile-account-action.danger {
            color: #ef4444;
        }

        .mobile-account-action.danger:active {
            background: rgba(239, 68, 68, 0.1);
        }

        .mobile-account-footer {
            padding: 16px 20px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .mobile-account-version {
            font-size: 11px;
            color: var(--text-muted);
        }

        .mobile-theme-toggle {
            display: flex;
            gap: 8px;
        }

        .mobile-theme-btn {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .mobile-theme-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        .mobile-theme-btn svg {
            width: 18px;
            height: 18px;
        }

        /* Mobile Account Backdrop */
        .mobile-account-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 198;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
        }

        .mobile-account-backdrop.active {
            opacity: 1;
            visibility: visible;
        }

        /* Mobile Menu Button */
        .mobile-menu-btn {
            display: none;
            width: 40px;
            height: 40px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .mobile-menu-btn svg {
            width: 20px;
            height: 20px;
        }

        /* Mobile Sidebar Backdrop */
        .sidebar-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
        }

        .sidebar-backdrop.active {
            opacity: 1;
            visibility: visible;
        }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 1400px) {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .main-grid {
                grid-template-columns: 1fr;
            }
            .bottom-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
                z-index: 101;
            }
            .sidebar.mobile-open,
            .mobile-sidebar-open .sidebar {
                transform: translateX(0);
            }
            .sidebar-backdrop {
                display: block;
            }
            .main-content {
                margin-left: 0 !important;
            }
            .mobile-menu-btn {
                display: flex;
            }
            .search-box {
                min-width: auto;
                flex: 1;
            }
            .bottom-grid {
                grid-template-columns: 1fr;
            }
            .header-title h2 {
                font-size: 20px;
            }
        }

        /* Mobile Overlay */
        .mobile-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 100;
            backdrop-filter: blur(2px);
        }

        @media (max-width: 1024px) {
            .mobile-overlay {
                display: block;
            }
        }

        @media (max-width: 768px) {
            /* Prevent all overflow on mobile */
            html, body {
                overflow-x: hidden !important;
                width: 100% !important;
                max-width: 100vw !important;
            }

            .app-container {
                width: 100%;
                max-width: 100vw;
                overflow-x: hidden;
            }

            .main-content {
                width: 100%;
                max-width: 100vw;
                overflow-x: hidden;
            }

            /* Show mobile bottom nav */
            .mobile-bottom-nav {
                display: block;
            }

            /* Add padding for bottom nav */
            .dashboard {
                padding: 16px;
                padding-bottom: 100px;
                max-width: 100%;
                overflow-x: hidden;
            }

            /* Header adjustments */
            .header {
                padding: 12px 16px;
                gap: 12px;
            }

            .header-left {
                flex: 1;
                gap: 12px;
            }

            .header-title {
                display: none;
            }

            .search-box {
                flex: 1;
                min-width: auto;
                padding: 10px 16px;
            }

            .search-box kbd {
                display: none;
            }

            .header-right {
                gap: 6px;
            }

            .header-btn {
                width: 40px;
                height: 40px;
            }

            /* Hide settings and user menu on mobile - use bottom nav instead */
            #settingsBtn,
            .user-menu-wrapper {
                display: none;
            }

            /* Dashboard adjustments */
            .dashboard {
                padding: 16px;
            }

            .stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 12px;
            }

            .stat-card {
                padding: 16px;
            }

            .stat-value {
                font-size: 24px;
            }

            .stat-icon {
                width: 40px;
                height: 40px;
            }

            .stat-icon svg {
                width: 20px;
                height: 20px;
            }

            /* Card adjustments */
            .card-header {
                padding: 16px;
                flex-wrap: wrap;
                gap: 12px;
            }

            .card-body {
                padding: 16px;
            }

            .card-actions {
                width: 100%;
                justify-content: flex-end;
            }

            /* Marketplace grid */
            .marketplace-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .marketplace-card {
                padding: 16px;
            }

            /* Orders table - hide some columns */
            .orders-table th:nth-child(3),
            .orders-table td:nth-child(3) {
                display: none;
            }

            .orders-table th,
            .orders-table td {
                padding: 12px 10px;
                font-size: 13px;
            }

            .customer-avatar {
                width: 30px;
                height: 30px;
                font-size: 11px;
            }

            /* Quick actions */
            .quick-action-btn {
                padding: 14px 16px;
            }

            /* Search modal - full screen */
            .search-modal {
                width: 100%;
                max-width: 100%;
                margin: 0;
                border-radius: 0;
                height: 100vh;
                max-height: 100vh;
            }

            .search-modal-overlay {
                padding-top: 0;
            }

            .search-modal-header {
                padding: 16px;
            }

            .search-modal-header input {
                font-size: 16px;
            }

            .search-section {
                padding: 12px 16px;
            }

            /* Notifications dropdown - full screen on mobile */
            .notifications-dropdown {
                position: fixed !important;
                top: 70px !important;
                left: 8px !important;
                right: 8px !important;
                width: auto !important;
                max-width: calc(100vw - 16px) !important;
                max-height: calc(100vh - 170px);
                border-radius: var(--radius-lg) !important;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .notifications-dropdown .notifications-body {
                max-height: calc(100vh - 320px);
            }

            .notifications-dropdown .notification-item {
                padding: 14px 16px;
            }

            .notifications-dropdown .notification-content {
                min-width: 0;
                overflow: hidden;
            }

            .notifications-dropdown .notification-title {
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .notifications-dropdown .notification-text {
                white-space: normal;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }

            /* Settings panel - full width */
            .settings-panel {
                width: 100%;
                right: -100%;
            }

            .settings-panel.active {
                right: 0;
            }

            /* Charts */
            .chart-container {
                height: 250px;
            }

            /* Inventory */
            .inventory-chart {
                height: 180px;
            }

            /* Bottom grid */
            .bottom-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 10px;
            }

            .stat-card {
                display: flex;
                align-items: center;
                gap: 16px;
                padding: 14px;
            }

            .stat-header {
                margin-bottom: 0;
                flex-direction: column;
                align-items: center;
                gap: 8px;
            }

            .stat-trend {
                padding: 2px 8px;
                font-size: 11px;
            }

            .stat-value {
                font-size: 22px;
            }

            .stat-label {
                font-size: 12px;
            }

            .header-btn {
                width: 36px;
                height: 36px;
            }

            .header-btn svg {
                width: 18px;
                height: 18px;
            }

            .mobile-menu-btn {
                width: 36px;
                height: 36px;
            }

            .search-box {
                padding: 8px 12px;
            }

            .search-box svg {
                width: 16px;
                height: 16px;
            }

            .search-placeholder {
                font-size: 13px;
            }

            .orders-table {
                font-size: 12px;
            }

            /* Hide more columns on very small screens */
            .orders-table th:nth-child(6),
            .orders-table td:nth-child(6) {
                display: none;
            }

            .color-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .marketplace-stats {
                flex-wrap: wrap;
                gap: 12px;
            }

            .marketplace-stat {
                flex: 1;
                min-width: 60px;
            }

            .main-grid,
            .bottom-grid {
                gap: 16px;
            }

            .mobile-account-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 6px;
            }

            .mobile-account-stat {
                padding: 12px 8px;
            }

            .mobile-account-stat-value {
                font-size: 18px;
            }
        }

        /* Safe area for notched phones */
        @supports (padding: max(0px)) {
            .mobile-bottom-nav {
                padding-bottom: max(8px, env(safe-area-inset-bottom));
                height: calc(72px + env(safe-area-inset-bottom));
            }
            
            .dashboard {
                padding-bottom: max(100px, calc(88px + env(safe-area-inset-bottom)));
            }

            .mobile-account-popup {
                bottom: calc(88px + env(safe-area-inset-bottom));
            }
        }

        /* ========== SEARCH MODAL ========== */
        .search-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 300;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding-top: 10vh;
        }

        .search-modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .search-modal {
            width: 600px;
            max-width: 90vw;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            transform: translateY(-20px) scale(0.95);
            transition: var(--transition);
            overflow: hidden;
        }

        .search-modal-overlay.active .search-modal {
            transform: translateY(0) scale(1);
        }

        .search-modal-header {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
        }

        .search-modal-header svg {
            width: 24px;
            height: 24px;
            color: var(--text-muted);
        }

        .search-modal-header input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            font-size: 18px;
            font-family: inherit;
            color: var(--text-primary);
        }

        .search-modal-header input::placeholder {
            color: var(--text-muted);
        }

        .search-modal-header kbd {
            padding: 6px 10px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 12px;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .search-modal-body {
            max-height: 400px;
            overflow-y: auto;
        }

        .search-section {
            padding: 16px 24px;
        }

        .search-section-title {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            margin-bottom: 12px;
        }

        .search-results {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .search-result-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 16px;
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
        }

        .search-result-item:hover {
            background: var(--bg-input);
        }

        .search-result-item.active {
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
        }

        .search-result-icon {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-sm);
            background: var(--bg-input);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        .search-result-icon svg {
            width: 20px;
            height: 20px;
            color: var(--primary);
        }

        .search-result-content {
            flex: 1;
        }

        .search-result-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .search-result-subtitle {
            font-size: 12px;
            color: var(--text-muted);
        }

        .search-result-badge {
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            background: var(--primary);
            color: white;
        }

        .search-result-arrow {
            color: var(--text-muted);
        }

        .search-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            color: var(--text-muted);
            text-align: center;
        }

        .search-empty svg {
            margin-bottom: 16px;
            opacity: 0.5;
        }

        .search-empty p {
            font-size: 14px;
        }

        .search-shortcuts {
            display: flex;
            gap: 24px;
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            background: var(--bg-input);
        }

        .search-shortcut {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .search-shortcut kbd {
            padding: 4px 8px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 6px;
            font-family: var(--font-mono);
            font-size: 11px;
        }

        /* ========== NOTIFICATIONS DROPDOWN ========== */
        .notifications-dropdown {
            position: absolute;
            top: calc(100% + 12px);
            right: 0;
            width: 400px;
            max-width: calc(100vw - 32px);
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: var(--transition);
            z-index: 9999;
            overflow: hidden;
        }

        .notifications-dropdown.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .notifications-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            gap: 12px;
            flex-wrap: wrap;
        }

        .notifications-header h3 {
            font-size: 16px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .notifications-count {
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            background: var(--primary);
            color: white;
        }

        .notifications-mark-read {
            padding: 8px 14px;
            border-radius: var(--radius-sm);
            border: none;
            background: var(--bg-input);
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .notifications-mark-read:hover {
            background: var(--primary);
            color: white;
        }

        .notifications-body {
            max-height: 350px;
            overflow-y: auto;
            overflow-x: hidden;
        }

        .notification-item {
            display: flex;
            gap: 14px;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: var(--transition);
            overflow: hidden;
        }

        .notification-item:hover {
            background: var(--bg-input);
        }

        .notification-item.unread {
            background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
        }

        .notification-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .notification-icon.order {
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
        }

        .notification-icon.success {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }

        .notification-icon.warning {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
        }

        .notification-icon.error {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        .notification-icon.sync {
            background: rgba(139, 92, 246, 0.15);
            color: #8b5cf6;
        }

        .notification-icon svg {
            width: 22px;
            height: 22px;
        }

        .notification-content {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .notification-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .notification-text {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .notification-time {
            font-size: 11px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .notification-time svg {
            width: 12px;
            height: 12px;
        }

        .notification-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary);
            flex-shrink: 0;
            margin-top: 6px;
        }

        .notifications-footer {
            padding: 16px 20px;
            border-top: 1px solid var(--border);
            text-align: center;
        }

        .notifications-footer a {
            color: var(--primary);
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            transition: var(--transition);
        }

        .notifications-footer a:hover {
            text-decoration: underline;
        }

        /* ========== USER DROPDOWN ========== */
        .user-dropdown {
            position: absolute;
            top: calc(100% + 12px);
            right: 0;
            width: 280px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: var(--transition);
            z-index: 9999;
        }

        .user-dropdown.active {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .user-dropdown-header {
            padding: 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .user-dropdown-avatar {
            width: 52px;
            height: 52px;
            border-radius: var(--radius);
            background: var(--gradient);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: 700;
            color: white;
        }

        .user-dropdown-info h4 {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .user-dropdown-info p {
            font-size: 13px;
            color: var(--text-muted);
        }

        .user-dropdown-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            padding: 4px 10px;
            border-radius: 20px;
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
            font-size: 11px;
            font-weight: 600;
        }

        .user-dropdown-status span {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
        }

        .user-dropdown-body {
            padding: 12px;
        }

        .user-dropdown-section {
            margin-bottom: 8px;
        }

        .user-dropdown-section:last-child {
            margin-bottom: 0;
        }

        .user-dropdown-section-title {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 1.5px;
            text-transform: uppercase;
            padding: 8px 12px;
        }

        .user-dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
            color: var(--text-secondary);
            text-decoration: none;
            width: 100%;
            border: none;
            background: transparent;
            font-family: inherit;
            font-size: inherit;
            text-align: left;
        }

        .user-dropdown-item:hover {
            background: var(--bg-input);
            color: var(--text-primary);
        }

        .user-dropdown-item svg {
            width: 18px;
            height: 18px;
        }

        .user-dropdown-item span {
            flex: 1;
            font-size: 14px;
            font-weight: 500;
        }

        .user-dropdown-item .shortcut {
            font-size: 11px;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .user-dropdown-item.danger {
            color: #ef4444;
            margin-top: 8px;
            border-top: 1px solid var(--border);
            padding-top: 16px;
            border-radius: 0 0 var(--radius) var(--radius);
        }

        .user-dropdown-item.danger:hover {
            background: rgba(239, 68, 68, 0.15);
            color: #dc2626;
        }

        .user-dropdown-item.danger svg {
            color: #ef4444;
        }

        .user-dropdown-footer {
            padding: 16px 20px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .user-dropdown-version {
            font-size: 11px;
            color: var(--text-muted);
        }

        .user-dropdown-theme-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .theme-toggle-btn {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .theme-toggle-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .theme-toggle-btn.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        .theme-toggle-btn svg {
            width: 16px;
            height: 16px;
        }

        /* Position relative for dropdowns */
        .header-btn-wrapper {
            position: relative;
            z-index: 9998;
        }

        .user-menu-wrapper {
            position: relative;
            z-index: 9998;
        }

        /* ========== SCROLLBAR ========== */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--border-hover);
        }

/* ========== CUSTOM CHECKBOX ========== */
.custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

.custom-checkbox .checkmark {
    position: absolute;
    inset: 0;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--primary);
    background: var(--primary-alpha, rgba(16, 185, 129, 0.1));
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox .checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 50%;
    top: 45%;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

/* ========== SWITCH FIELD ========== */
.switch-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.switch-field:hover {
    border-color: var(--primary);
}

.switch-field-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-field-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.switch-field-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== SWITCH TOGGLE ========== */
.switch {
    position: relative;
    display: inline-flex;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.switch:hover .switch-slider {
    border-color: var(--primary);
}

.switch input:checked ~ .switch-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.switch input:checked ~ .switch-slider::before {
    transform: translateY(-50%) translateX(24px);
    background: white;
}

.switch input:focus ~ .switch-slider {
    box-shadow: 0 0 0 3px var(--primary-alpha, rgba(16, 185, 129, 0.2));
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    border-color: #16a34a;
}

.btn-resend {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: white;
}

.btn-resend:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-resend svg {
    width: 16px;
    height: 16px;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-input);
    color: var(--text);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0;
}

.btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon.success:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-icon.primary:hover {
    background: var(--primary-alpha);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-loading {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ========== BULK ACTIONS ========== */
.bulk-actions {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.bulk-actions-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.bulk-actions-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .bulk-actions {
        left: 16px;
        right: 16px;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
    }

    .bulk-actions-info {
        width: 100%;
        text-align: center;
    }
}

/* ========== FORM FIELD ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled,
.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-input:read-only {
    background: var(--bg-secondary);
}

.form-input.error,
.form-group.has-error .form-input,
.form-group.has-error .searchable-select-container {
    border-color: #ef4444;
}

.form-input.error:focus,
.form-group.has-error .form-input:focus,
.form-group.has-error .searchable-select-container:focus-within {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-group.has-error label {
    color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.form-group.has-error .form-input,
.form-group.has-error .searchable-select-container {
    animation: shake 0.4s ease-in-out;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-input-number {
    text-align: right;
    font-family: var(--font-mono);
}

.form-help {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
}

/* Error Message Box */
.error-message {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: #ef4444;
    font-size: 13px;
    margin-top: 16px;
}

/* Form Layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

/* Custom width form rows */
.form-row-30-70 {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row-30 {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row-30 > .form-col:only-child {
    grid-column: 1;
}

/* Remove margin from form-groups inside form rows */
.form-row .form-group,
.form-row-3 .form-group,
.form-row-30 .form-group,
.form-row-30-70 .form-group {
    margin-bottom: 0;
}

/* Step header with title and action on same row */
.step-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.step-header-row .step-title {
    margin: 0 !important;
}

.step-header-row .header-action {
    min-width: 250px;
}

@media (max-width: 640px) {
    .form-row,
    .form-row-3,
    .form-row-30-70,
    .form-row-30 {
        grid-template-columns: 1fr;
    }

    .step-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .step-header-row .header-action {
        min-width: auto;
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-section-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    border-radius: var(--radius);
    color: var(--primary);
}

.form-section-icon svg {
    width: 20px;
    height: 20px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.form-section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(-20px) scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* Modal Sizes */
.modal-sm {
    width: 400px;
}

.modal-lg {
    width: 900px;
}

.modal-xl {
    width: 1200px;
    height: 85vh;
    max-height: 85vh;
}

.modal-fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* Modal responsive */
@media (max-width: 768px) {
    .modal {
        width: 100%;
        max-width: 100%;
        margin: 16px;
    }

    .modal-sm,
    .modal-lg,
    .modal-xl {
        width: calc(100% - 32px);
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
    }
}

/* =====================================================
   DataTable Component
   ===================================================== */

/* Data Card Container */
.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--text-primary);
}

.sort-icon {
    margin-left: 4px;
    font-size: 10px;
}

.th-checkbox {
    width: 50px;
}

.th-actions {
    width: 100px;
    text-align: center;
}

.data-table td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

.data-table tbody tr.selected {
    background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
}

/* Sticky Columns */
.sticky-col {
    position: sticky !important;
    z-index: 2;
}

.data-table tbody .sticky-col {
    background: var(--sticky-bg) !important;
}

.data-table thead .sticky-col {
    background: var(--sticky-header-bg) !important;
    z-index: 3;
}

.data-table .th-checkbox,
.data-table tbody tr td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--sticky-bg) !important;
}

.data-table thead .th-checkbox {
    background: var(--sticky-header-bg) !important;
    z-index: 3;
}

.sticky-col-2 {
    left: 50px !important;
}

.sticky-col-3 {
    left: 110px !important;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

.sticky-col-right {
    right: 0 !important;
    border-left: 1px solid var(--border);
    box-shadow: -2px 0 8px rgba(0,0,0,0.06);
}

.data-table tbody tr:hover .sticky-col,
.data-table tbody tr:hover td:first-child {
    background: var(--sticky-hover-bg) !important;
}

.data-table tbody tr.selected .sticky-col,
.data-table tbody tr.selected td:first-child {
    background: var(--primary-alpha) !important;
}

/* Table Badges */
.code-badge {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary);
    padding: 4px 10px;
    background: var(--primary-alpha);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.rate-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
}

.date-value {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-path {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sort-order-badge {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.priority-badge {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.currency-badge {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #059669;
    padding: 4px 10px;
    background: rgba(5, 150, 105, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* Attribute Name Cell */
.attribute-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attribute-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.attribute-type-icon.icon-select {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.attribute-type-icon.icon-color {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.attribute-type-icon.icon-text {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.attribute-type-icon.icon-number {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.attribute-type-icon.icon-boolean {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.attribute-type-icon.icon-date {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Type Badge */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.type-badge.type-select {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.type-badge.type-color {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.type-badge.type-text {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.type-badge.type-number {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.type-badge.type-boolean {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.type-badge.type-date {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Attribute Badge */
.attribute-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

/* Product Page */
.sku-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
}

.product-name {
    font-weight: 500;
    color: var(--text-primary);
}

.category-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.price-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.form-check-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.form-check-wrapper .check-label {
    font-size: 14px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

.form-group-spaced {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.switch-field-aligned {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.switch-field-aligned .switch-field {
    margin-top: auto;
    padding-top: 8px;
}

/* Value Cell */
.value-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

/* Color Preview */
.color-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.color-code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sort Badge */
.sort-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 4px;
}

/* Color Input Group */
.color-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker {
    width: 48px;
    height: 40px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-text {
    flex: 1;
    font-family: var(--font-mono);
}

/* ========== COLOR PICKER COMPONENT ========== */
.color-picker-container {
    position: relative;
}

.color-picker-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}

.color-picker-current:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.color-preview-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.color-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.color-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    flex: 1;
}

.dropdown-chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.dropdown-chevron.rotated {
    transform: rotate(180deg);
}

.color-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
}

.color-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card), 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 999;
    padding: 12px;
    backdrop-filter: blur(20px);
}

.color-palette {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.color-row {
    display: flex;
    gap: 4px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.color-swatch:hover {
    transform: scale(1.15);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-swatch.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-alpha);
}

.color-swatch svg {
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Light colors need dark check mark */
.color-swatch[style*="#FFFFFF"] svg,
.color-swatch[style*="#F5F5F5"] svg,
.color-swatch[style*="#E0E0E0"] svg,
.color-swatch[style*="#FFFDE7"] svg,
.color-swatch[style*="#FFF9C4"] svg,
.color-swatch[style*="#FFF59D"] svg,
.color-swatch[style*="#FFEBEE"] svg,
.color-swatch[style*="#FCE4EC"] svg,
.color-swatch[style*="#F3E5F5"] svg,
.color-swatch[style*="#E3F2FD"] svg,
.color-swatch[style*="#E0F7FA"] svg,
.color-swatch[style*="#E8F5E9"] svg,
.color-swatch[style*="#FFF3E0"] svg,
.color-swatch[style*="#EFEBE9"] svg {
    color: #333;
    filter: none;
}

.color-custom-section {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.custom-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.custom-color-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-color-input .native-picker {
    width: 40px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.custom-color-input .native-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-color-input .native-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.custom-color-input .hex-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
}

.custom-color-input .hex-input:focus {
    outline: none;
    border-color: var(--primary);
}

.custom-color-input .btn-apply {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.custom-color-input .btn-apply:hover {
    background: var(--primary-dark);
}

.btn-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.currency-symbol {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

/* Exchange Rate Modal */
.exchange-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.rate-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.rate-date svg {
    color: var(--text-muted);
}

.rate-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.btn-link:hover {
    background: var(--primary-alpha);
}

.rate-actions .separator {
    color: var(--border);
}

.exchange-rate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.rate-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rate-card:hover {
    border-color: var(--primary-alpha);
    background: var(--surface-alt);
}

.rate-card.selected {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.rate-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rate-checkbox {
    display: flex;
    align-items: center;
}

.rate-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.rate-code {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.rate-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    text-transform: uppercase;
}

.rate-tag.exists {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.rate-tag.new {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.rate-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rate-name {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rate-value-large {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.selection-summary {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--primary-alpha);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--primary);
    text-align: center;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-state-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Pagination */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-buttons .btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-select {
    padding: 6px 28px 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: var(--transition);
}

.page-size-select:hover {
    border-color: var(--border-hover);
}

.page-size-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.page-size-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Page Container & Header (for list pages) */
.page-container {
    padding: 32px;
    max-width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    padding: 16px 0;
    margin: -32px -32px 16px -32px;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
}

.page-header-left h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header-left p {
    font-size: 14px;
    color: var(--text-muted);
}

.page-header-actions {
    display: flex;
    gap: 12px;
}

/* Filters Card */
.filters-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.filters-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-actions {
    margin-left: auto;
}

.filter-clear {
    display: flex;
    align-items: flex-end;
}

/* Modal Loading State */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.modal-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Text helpers */
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* DataTable Responsive */
@media (max-width: 768px) {
    .page-container {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
    }

    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .data-table th,
    .data-table td {
        padding: 12px 14px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* =====================================================
   Reconnect Modal - Visibility States (Global)
   ===================================================== */
#components-reconnect-modal .components-reconnect-first-attempt-visible,
#components-reconnect-modal .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal .components-reconnect-failed-visible,
#components-reconnect-modal .components-pause-visible,
#components-reconnect-modal .components-resume-failed-visible,
#components-reconnect-modal .components-reconnect-retrying-visible {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-retrying-visible,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: flex;
}

/* =====================================================
   Category Tree Component
   ===================================================== */

/* Tree Container */
.category-tree {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Tree Loading State */
.tree-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Tree Empty State */
.tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
}

.tree-empty svg {
    color: var(--text-muted);
    opacity: 0.5;
}

.tree-empty h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.tree-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Tree Header (Select All) */
.tree-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.tree-header-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tree Nodes Container */
.tree-nodes {
    padding: 8px 0;
}

/* Individual Tree Node */
.tree-node {
    position: relative;
}

.tree-node-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    padding-left: calc(20px + (var(--level, 0) * 28px));
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.tree-node-row:hover {
    background: var(--bg-input);
}

.tree-node.selected > .tree-node-row {
    background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
    border-left-color: var(--primary);
}

/* Expand/Collapse Toggle */
.tree-toggle {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.tree-toggle:hover {
    background: var(--primary-alpha);
    border-color: var(--primary);
    color: var(--primary);
}

.tree-toggle.invisible {
    visibility: hidden;
    pointer-events: none;
}

/* Chevron Icon Animation */
.chevron-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chevron-icon.rotated {
    transform: rotate(90deg);
}

/* Tree Node Content */
.tree-node-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tree-node-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Child Count Badge */
.child-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* Tree Node Actions */
.tree-node-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-node-row:hover .tree-node-actions {
    opacity: 1;
}

/* Drag Handle */
.tree-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 4px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: grab;
    opacity: 0.6;
    transition: all 0.2s ease;
    margin-right: 6px;
    flex-shrink: 0;
}

.tree-node-row:hover .tree-drag-handle {
    opacity: 1;
    background: var(--bg-surface);
    border-color: var(--border-hover, var(--border));
}

.tree-drag-handle:hover {
    opacity: 1 !important;
    color: var(--primary);
    background: var(--primary-alpha);
    border-color: var(--primary);
}

.tree-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Drag States */
.tree-node.dragging > .tree-node-row {
    opacity: 0.5;
    background: var(--bg-input);
}

.tree-node.drag-over > .tree-node-row {
    background: var(--primary-alpha);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.tree-node.drag-over > .tree-node-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 2px 0 0 2px;
}

/* Children Container with Animation */
.tree-children {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.tree-children.collapsed {
    max-height: 0;
    opacity: 0;
}

.tree-children.expanded {
    max-height: 5000px;
    opacity: 1;
}

/* Status Badge in Tree */
.tree-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.tree-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tree-status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tree-status-badge .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* Sort Order Badge */
.tree-sort-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tree-node-row {
        padding: 10px 12px;
        padding-left: calc(12px + (var(--level, 0) * 20px));
    }

    .tree-node-actions {
        opacity: 1;
    }

    .tree-node-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .child-count-badge {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .tree-toggle {
        width: 24px;
        height: 24px;
    }

    .tree-toggle svg {
        width: 14px;
        height: 14px;
    }
}

/* ========== MODAL TABS ========== */
.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.modal-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.modal-tab.active {
    background: var(--primary-alpha);
    color: var(--primary);
}

.modal-tab svg {
    flex-shrink: 0;
}

.modal-tab-content {
    min-height: 300px;
}

/* ========== ATTRIBUTE ASSIGNMENT ========== */
.attribute-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.attribute-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.attribute-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Variant Rows - 4 Fixed Dimension Selectors */
.variant-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.variant-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.variant-row:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.variant-row:nth-child(1) {
    border-left: 4px solid var(--primary);
}

.variant-row:nth-child(2) {
    border-left: 4px solid #10b981;
}

.variant-row:nth-child(3) {
    border-left: 4px solid #f59e0b;
}

.variant-row:nth-child(4) {
    border-left: 4px solid #8b5cf6;
}

.variant-label {
    min-width: 120px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.variant-row:nth-child(1) .variant-label { color: var(--primary); }
.variant-row:nth-child(2) .variant-label { color: #10b981; }
.variant-row:nth-child(3) .variant-label { color: #f59e0b; }
.variant-row:nth-child(4) .variant-label { color: #8b5cf6; }

.variant-select {
    flex: 1;
    min-width: 0;
}

/* Attribute List Styles */
.attribute-available {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attribute-search {
    width: 100%;
}

.attribute-search .form-input {
    width: 100%;
}

.attribute-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
}

.attribute-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.attribute-item:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.attribute-item.selected {
    background: var(--primary-alpha);
    border-color: var(--primary);
}

.attribute-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.attribute-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attribute-type {
    font-size: 12px;
    color: var(--text-muted);
}

.required-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.attribute-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Attribute Add Row */
.attribute-add-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.attribute-add-select {
    flex: 1;
    min-width: 0;
}

/* Assigned Attributes List */
.assigned-attributes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.assigned-attribute-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: grab;
}

.assigned-attribute-item:hover {
    border-color: var(--primary);
    background: var(--bg-card);
}

.assigned-attribute-item.dragging {
    opacity: 0.5;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.assigned-attribute-item:active {
    cursor: grabbing;
}

/* Drag Handle */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    cursor: grab;
    flex-shrink: 0;
    transition: var(--transition);
}

.drag-handle:hover {
    color: var(--text-primary);
}

.assigned-attribute-item:active .drag-handle {
    cursor: grabbing;
}

/* Sort Order Badge */
.sort-order-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-alpha);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Assigned Attribute Info */
.assigned-attribute-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.assigned-attribute-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assigned-attribute-type {
    font-size: 12px;
    color: var(--text-muted);
}

/* Inline Switch */
.switch-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.switch-inline input {
    display: none;
}

.switch-inline .switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 20px;
    transition: var(--transition);
}

.switch-inline .switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-inline input:checked + .switch-track {
    background: var(--primary);
}

.switch-inline input:checked + .switch-track::after {
    transform: translateX(16px);
}

.switch-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Empty State */
.assigned-attributes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.assigned-attributes-empty svg {
    opacity: 0.5;
}

.assigned-attributes-empty p {
    font-size: 14px;
    margin: 0;
}

/* Form input sm variant */
.form-input-sm {
    padding: 6px 12px !important;
    font-size: 13px !important;
}

@media (max-width: 768px) {
    .modal-tabs {
        flex-wrap: wrap;
    }

    .modal-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }

    .variant-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    .variant-label {
        min-width: unset;
    }

    .variant-select {
        width: 100%;
    }

    .attribute-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .required-checkbox {
        width: 100%;
        margin-top: 4px;
    }

    .attribute-add-row {
        flex-direction: column;
    }

    .attribute-add-row .btn {
        width: 100%;
    }

    .assigned-attribute-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .assigned-attribute-info {
        flex: 1 1 calc(100% - 80px);
        order: 1;
    }

    .switch-inline {
        order: 2;
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        margin-top: 4px;
    }
}

/* ========== PRODUCT WIZARD ========== */

/* Fullscreen Wizard Modal */
.wizard-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wizard-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.wizard-container {
    position: relative;
    z-index: 1;
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

.wizard-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.wizard-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.wizard-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Wizard Stepper */
.wizard-stepper-container {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

.wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
    cursor: default;
}

.wizard-step.active {
    background: var(--primary);
    color: white;
}

.wizard-step.completed {
    background: var(--success-alpha, rgba(16, 185, 129, 0.15));
    color: var(--success);
    cursor: pointer;
}

.wizard-step.completed:hover {
    background: var(--success-alpha, rgba(16, 185, 129, 0.25));
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: 600;
}

.wizard-step.completed .step-indicator {
    background: var(--success);
    color: white;
}

.step-title {
    font-weight: 500;
}

.step-connector {
    width: 32px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

.step-connector.completed {
    background: var(--success);
}

/* Wizard Content */
.wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 48px;
}

.wizard-step-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Variant List Step - Full width for table */
.wizard-step-content.wizard-step-wide {
    max-width: 100%;
}

.wizard-step-content h3.step-title {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.step-description {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.wizard-step-fullheight {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wizard-step-fullheight .rich-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Wizard Footer */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.wizard-footer-left,
.wizard-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-error {
    font-size: 13px;
    color: var(--error);
}

/* Wizard Loading/Empty states */
.wizard-loading,
.wizard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Variant Dimensions */
.variant-dimension {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.dimension-title {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox-item:hover {
    border-color: var(--primary);
}

.checkbox-item.selected {
    background: var(--primary-alpha);
    border-color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.color-swatch-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin-right: 6px;
}

.variant-preview {
    margin-top: 20px;
    padding: 16px;
    background: var(--success-alpha, rgba(16, 185, 129, 0.1));
    border-radius: var(--radius-sm);
    text-align: center;
}

.variant-count {
    font-size: 15px;
    font-weight: 600;
    color: var(--success);
}

/* Rich Text Editor */
.rich-editor-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toolbar-btn:active {
    background: var(--primary-alpha);
    color: var(--primary);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.editor-content {
    min-height: 300px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    outline: none;
}

.editor-content:focus {
    background: var(--bg-input);
}

.editor-content ul,
.editor-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.editor-content a {
    color: var(--primary);
    text-decoration: underline;
}

/* Image Uploader - Inline Style */
.image-uploader-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.image-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    flex-shrink: 0;
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.image-thumb:hover .image-thumb-remove {
    opacity: 1;
}

.image-thumb-remove:hover {
    background: var(--error);
}

.upload-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.upload-thumb:hover,
.upload-thumb.dragover {
    border-color: var(--primary);
    background: var(--primary-alpha);
    color: var(--primary);
}

.upload-thumb.processing {
    pointer-events: none;
}

.upload-thumb .upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.spinner-sm {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Image Section */
.image-section {
    margin-bottom: 32px;
}

.image-section h4 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.color-image-group {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.color-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Color Image Section (Step 5) */
.color-image-section {
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.color-image-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.color-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.image-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
}

.color-image-section .image-uploader-inline {
    padding: 12px 0;
}

/* Preview Section */
.preview-section {
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
}

.preview-section h4 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.preview-table-container {
    overflow-x: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.preview-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
}

.preview-table td {
    color: var(--text-primary);
}

.preview-more {
    margin-top: 12px;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

/* Wizard Responsive */
@media (max-width: 768px) {
    .wizard-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .wizard-stepper {
        flex-wrap: wrap;
        gap: 6px;
    }

    .wizard-step {
        padding: 6px 12px;
        font-size: 12px;
    }

    .step-indicator {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .step-title {
        display: none;
    }

    .step-connector {
        display: none;
    }

    .wizard-content {
        padding: 16px;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        gap: 8px;
    }

    .checkbox-item {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ========================================
   Attributes Grid (Step 2)
   ======================================== */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.attribute-card {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s ease;
}

.attribute-card.missing-required {
    border-color: var(--danger);
    background: rgba(var(--danger-rgb, 239, 68, 68), 0.05);
}

.attribute-card.has-value {
    border-color: var(--success);
}

.attribute-card .form-group {
    margin: 0;
}

/* ========================================
   Variant Dimension Sections (Step 3)
   ======================================== */
.dim-section {
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.dim-section.dim-main {
    border-color: var(--primary);
}

.dim-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.dim-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dim-type-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dim-type-badge.badge-main {
    background: var(--primary);
    color: white;
}

.dim-type-badge.badge-dim1 {
    background: #06b6d4;
    color: white;
}

.dim-type-badge.badge-dim2 {
    background: #f59e0b;
    color: white;
}

.dim-type-badge.badge-dim3 {
    background: #10b981;
    color: white;
}

.dim-attr-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.dim-counter {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--surface);
    border-radius: 4px;
}

.dim-section-actions {
    display: flex;
    gap: 8px;
}

.dim-values-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
}

.dim-value-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.dim-value-chip:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.dim-value-chip.selected {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.dim-value-chip input[type="checkbox"] {
    display: none;
}

.chip-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.chip-text {
    font-size: 13px;
    font-weight: 500;
}

.variant-result-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 16px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--primary);
    font-size: 15px;
}

.variant-result-box strong {
    font-size: 20px;
}

/* Button Styles */
.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface);
    color: var(--text);
}

/* ========================================
   Variant List Step (Step 6)
   ======================================== */
.variant-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}

.variant-list-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.selection-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.selection-count strong {
    color: var(--primary);
    font-size: 18px;
}

.selection-actions {
    display: flex;
    gap: 8px;
}

.variant-list-actions {
    display: flex;
    gap: 12px;
}

/* Bulk Assign Section */
.bulk-assign-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-assign-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
}

.bulk-assign-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-assign-item label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bulk-assign-item .input-with-btn {
    width: 140px;
}

.bulk-assign-item .form-input-sm {
    width: 100%;
}

.variant-list-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.variant-list-table {
    width: 100%;
    border-collapse: collapse;
}

.variant-list-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
}

.variant-list-table th:first-child {
    width: 50px;
    text-align: center;
}

.variant-list-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.variant-list-table tr:last-child td {
    border-bottom: none;
}

.variant-list-table tr:hover {
    background: var(--bg);
}

.variant-list-table tr.unselected {
    opacity: 0.5;
    background: var(--bg);
}

.variant-list-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.variant-list-table .checkbox-cell {
    text-align: center;
}

.variant-sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.variant-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-name .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.variant-name span {
    font-size: 14px;
    color: var(--text);
}

.barcode-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.barcode-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s ease;
}

.barcode-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.barcode-input:disabled {
    background: var(--bg);
    color: var(--text-secondary);
}

.barcode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.barcode-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.barcode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-variants-message {
    padding: 60px 20px;
    text-align: center;
}

.no-variants-message .icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.no-variants-message p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Responsive variant list */
@media (max-width: 768px) {
    .variant-list-header {
        flex-direction: column;
        gap: 16px;
    }

    .variant-list-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .variant-list-table th:nth-child(3),
    .variant-list-table td:nth-child(3) {
        display: none;
    }

    .barcode-cell {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-btn {
        width: 100%;
    }
}

/* ========================================
   Attribute Sections (Step 2)
   ======================================== */
.attr-section {
    margin-bottom: 24px;
}

.attr-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.attr-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.attr-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attr-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.attr-item.missing label {
    color: var(--danger);
}

/* ========================================
   Variant List Table Enhancements
   ======================================== */
.th-number,
.td-number {
    width: 100px;
    text-align: right;
}

.input-number {
    width: 90px;
    text-align: right;
}

/* ========================================
   Light Theme Button Fixes
   ======================================== */
[data-theme="light"] .btn {
    color: var(--text-primary);
}

[data-theme="light"] .btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    color: #0f172a;
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .btn-primary:hover:not(:disabled) {
    color: white;
}

[data-theme="light"] .btn-danger {
    color: #ef4444;
}

[data-theme="light"] .btn-danger:hover,
[data-theme="light"] .btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

[data-theme="light"] .btn-success {
    background: #22c55e;
    color: white;
}

[data-theme="light"] .btn-success:hover,
[data-theme="light"] .btn-success:hover:not(:disabled) {
    background: #16a34a;
}

[data-theme="light"] .btn-ghost {
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] .btn-ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

[data-theme="light"] .btn-icon {
    color: rgba(15, 23, 42, 0.7);
}

[data-theme="light"] .btn-icon:hover,
[data-theme="light"] .btn-icon:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

[data-theme="light"] .btn-icon.danger:hover,
[data-theme="light"] .btn-icon.danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

[data-theme="light"] .dim-action-btn:hover {
    color: #0f172a;
}

[data-theme="light"] .btn-link:hover,
[data-theme="light"] .btn-link:hover:not(:disabled) {
    color: var(--primary);
}

/* Input with button inside */
.input-with-btn {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-btn input {
    padding-right: 36px;
    width: 100%;
    min-width: 140px;
}

.input-with-btn .input-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.input-with-btn .input-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.input-with-btn .input-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========================================
   Tabs Component
   ======================================== */
.tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-primary);
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon svg {
    width: 16px;
    height: 16px;
}

.tab-title {
    font-weight: 500;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border-radius: 10px;
}

.tabs-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Modal içindeki tab'lar için */
.modal-body .tabs-container {
    margin: -20px;
    height: calc(100% + 40px);
}

.modal-body .tabs-header {
    border-radius: 0;
    padding: 0 16px;
}

.modal-body .tabs-content {
    padding: 24px;
}

/* Responsive */
@media (max-width: 640px) {
    .tabs-header {
        padding: 0;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 13px;
    }

    .tab-icon {
        display: none;
    }
}

/* ================================================
   ProductEdit Modal Styles
   ================================================ */

.tab-content-inner {
    padding: 4px;
}

.tab-content-description {
    height: 100%;
    min-height: 400px;
}

.tab-content-description .rich-text-editor-container {
    height: 100%;
}

.tab-content-wide {
    padding: 0;
}

/* Form Input Readonly */
.form-input-readonly {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.form-input-readonly small {
    font-size: 12px;
}

/* Attribute Grid */
.attr-section {
    margin-bottom: 24px;
}

.attr-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.attr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.attr-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attr-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Color-Specific Attribute Rows */
.attr-row {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.attr-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.attr-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.attr-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.color-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.color-mode-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.color-mode-toggle .toggle-text {
    font-size: 12px;
    color: var(--text-muted);
}

.attr-input-single {
    max-width: 400px;
}

.attr-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.attr-color-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attr-color-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.color-swatch-mini {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Variant Toolbar */
.variant-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.variant-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.bulk-assign-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bulk-assign-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.bulk-assign-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-item-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.bulk-input {
    width: 100px;
}

/* Variant Edit Table */
.variant-table-container {
    overflow-x: auto;
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.variant-edit-table {
    width: 100%;
}

.variant-edit-table th,
.variant-edit-table td {
    padding: 10px 8px;
    vertical-align: middle;
}

.variant-edit-table th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.variant-edit-table .th-checkbox,
.variant-edit-table .td-checkbox {
    width: 40px;
    text-align: center;
}

.variant-edit-table .th-number,
.variant-edit-table .td-number {
    width: 100px;
    text-align: right;
}

.variant-edit-table .th-status,
.variant-edit-table .td-status {
    width: 28px;
    padding: 4px !important;
    text-align: center;
}

/* SKU Input */
.variant-edit-table .sku-input {
    width: 280px;
}

.variant-edit-table .sku-input-narrow {
    width: 140px;
}

.variant-edit-table .th-sku,
.variant-edit-table .td-sku {
    width: 160px;
}


.variant-edit-table .input-number {
    width: 80px;
    text-align: right;
}

.variant-edit-table .input-with-btn {
    width: 160px;
}

.variant-edit-table .input-with-btn.barcode-input {
    width: 200px;
}

.variant-edit-table .row-dim {
    opacity: 0.5;
}

/* Sortable Headers */
.variant-edit-table .th-sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.variant-edit-table .th-sortable:hover {
    color: var(--primary);
}

.variant-edit-table .th-sortable.sorted {
    color: var(--primary);
}

.sort-icon {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

/* Barcode Input */
.barcode-input {
    width: 150px;
}

/* Variant Name */
.variant-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Variant Pagination */
.variant-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-text {
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Variant Info Cell */
.variant-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-swatch-small {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Color Image Section */
.color-image-section {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.color-image-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--border);
}

.color-name {
    font-weight: 500;
    color: var(--text-primary);
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 32px;
    background: var(--bg-input);
}

.image-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-input);
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.image-item:hover {
    border-color: var(--primary);
}

.image-item.is-primary {
    border-color: var(--success);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .primary-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    background: #22c55e;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.image-item .image-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0.8;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .image-actions {
    opacity: 1;
}

.image-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.image-action-btn.set-primary-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #ffc107;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.image-action-btn.set-primary-btn:hover {
    background: #ffc107;
    color: #000;
}

.image-action-btn.delete-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #ff4d4f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.image-action-btn.delete-btn:hover {
    background: #ff4d4f;
    color: white;
}

.image-item .drag-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: grab;
}

.image-item:hover .drag-handle {
    opacity: 0.7;
}

.image-item:active .drag-handle {
    cursor: grabbing;
    opacity: 1;
}

.image-item[draggable="true"] {
    cursor: grab;
}

.image-item[draggable="true"]:active {
    cursor: grabbing;
    opacity: 0.7;
}

/* Modal Error */
.modal-error {
    color: var(--error);
    font-size: 13px;
    margin-right: auto;
}

/* Form Input Small */
.form-input-sm {
    padding: 6px 10px;
    font-size: 13px;
    height: 32px;
}

/* Small Button */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    gap: 6px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state svg {
    opacity: 0.5;
}

/* Responsive - ProductEdit */
@media (max-width: 768px) {
    .variant-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bulk-assign-section {
        width: 100%;
        justify-content: space-between;
    }

    .attr-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Stores Page Styles
   ========================================= */

/* Connection Status Badge */
.connection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.connection-status-badge .status-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.connection-status-badge.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.connection-status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.connection-status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.connection-status-badge.suspended {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

/* Platform Badge */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Sync Indicators */
.sync-indicators {
    display: flex;
    gap: 4px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.sync-badge svg {
    width: 12px;
    height: 12px;
}

.sync-badge.sync-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.sync-badge.sync-inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Store Name */
.store-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-name-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* Date Text */
.date-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Sync Options in Modal */
.sync-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Platform Selector Modal */
.platform-selector-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.platform-section {
    margin-bottom: 24px;
}

.platform-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-card:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.platform-logo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.platform-logo.has-image {
    background-color: transparent !important;
}

.platform-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.platform-initials {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.platform-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* Selected Platform Display */
.selected-platform-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.platform-logo-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.platform-logo-sm.has-image {
    background-color: transparent !important;
}

.platform-logo-sm img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.platform-initials-sm {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.selected-platform-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================
   Bulk Import Wizard - Value Mappings
   ======================================== */
.value-mappings {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.value-mappings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.value-mappings-header:hover {
    color: var(--text-primary);
}

.value-toggle {
    display: flex;
    align-items: center;
}

.value-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.value-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
}

.value-chip.matched {
    background: var(--success-alpha, rgba(16, 185, 129, 0.1));
    border-color: var(--success);
    color: var(--success);
}

.value-chip.more {
    background: var(--primary-alpha);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.value-mappings-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.value-mapping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    gap: 12px;
}

.value-mapping-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.value-mapping-label .platform-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.value-mapping-label .variant-count {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.value-mapping-action {
    flex-shrink: 0;
    min-width: 180px;
}

.mapping-matched {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--success);
}

.mapping-will-create {
    font-size: 12px;
    color: var(--warning);
    font-style: italic;
}

/* ========== BULK PRODUCT IMPORT WIZARD ========== */

/* Attribute Mapping Cards - 2 Column Grid */
.attribute-mappings-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.attribute-mapping-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
}

.attribute-mapping-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.attribute-mapping-card.ignored {
    opacity: 0.6;
    background: var(--bg);
}

.attribute-mapping-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.attribute-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attribute-info .attribute-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.attribute-info .attribute-count {
    font-size: 12px;
    color: var(--text-muted);
}

.attribute-dimension select {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.attribute-mapping-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mode-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.mode-pill input {
    display: none;
}

.mode-pill:hover {
    border-color: var(--primary);
}

.mode-pill.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.mode-pill-ignore.selected {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.mapping-auto-matched {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--success-alpha, rgba(16, 185, 129, 0.1));
    border-radius: 6px;
    font-size: 13px;
    color: var(--success);
}

.create-info, .ignore-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.ignore-info {
    background: rgba(107, 114, 128, 0.1);
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
    .attribute-mappings-list {
        grid-template-columns: 1fr;
    }
}

/* ========== PREVIEW STEP STYLES ========== */

/* Preview Header Banner */
.preview-header-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    color: white;
}

.preview-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.preview-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.preview-header-content h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.preview-header-content p {
    margin: 4px 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Hero Stats Cards */
.preview-stats-hero {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.hero-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hero-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.hero-stat-card.products::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.hero-stat-card.variants::before { background: linear-gradient(90deg, #10b981, #34d399); }
.hero-stat-card.categories::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hero-stat-card.brands::before { background: linear-gradient(90deg, #ec4899, #f472b6); }

.hero-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.hero-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border-radius: 12px;
}

.hero-stat-card.products .hero-stat-icon { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.hero-stat-card.variants .hero-stat-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.hero-stat-card.categories .hero-stat-icon { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.hero-stat-card.brands .hero-stat-icon { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

.hero-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.hero-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Preview Section */
.preview-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mapping Summary Grid */
.mapping-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.mapping-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.summary-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.summary-icon.category { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.summary-icon.brand { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

.summary-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.summary-count {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 10px;
}

.summary-card-body {
    padding: 12px 16px;
}

.summary-item {
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
    border-bottom: none;
}

.item-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.item-badge.matched {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.item-badge.new {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.summary-more {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 8px;
}

/* Attributes Preview Grid */
.attributes-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.attr-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.attr-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.attr-preview-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.attr-preview-card.variant .attr-preview-icon { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.attr-preview-card.product .attr-preview-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.attr-preview-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attr-preview-title span:first-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.attr-count-badge {
    font-size: 11px;
    color: var(--text-muted);
}

.attr-preview-body {
    padding: 16px;
}

.attr-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attr-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
}

.chip-name {
    color: var(--text-primary);
    font-weight: 500;
}

.chip-dim {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.chip-dim.main { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.chip-dim.dim1 { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.chip-dim.dim2 { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.chip-dim.dim3 { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

.chip-required {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 4px;
    font-weight: 500;
}

.chip-values {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 600;
}

.attr-chip.more {
    background: var(--primary-alpha);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.no-attrs {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 20px;
}

/* Settings Summary */
.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.setting-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 8px;
}

.setting-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Confirm Notice Card */
.confirm-notice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius);
    margin-top: 24px;
}

.notice-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border-radius: 10px;
    flex-shrink: 0;
}

.notice-content strong {
    display: block;
    font-size: 14px;
    color: #f59e0b;
    margin-bottom: 4px;
}

.notice-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Import Result Styles */
.import-result-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.import-result-banner.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.import-result-banner.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.import-result-banner.success .result-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.import-result-banner.error .result-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.result-content h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
}

.import-result-banner.success .result-content h2 { color: #10b981; }
.import-result-banner.error .result-content h2 { color: #ef4444; }

.result-content p {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
}

/* Result Stats Grid */
.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-stat-card {
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.result-stat-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-stat-card.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-stat-card.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.result-stat-card .stat-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.result-stat-card.success .stat-number { color: #10b981; }
.result-stat-card.error .stat-number { color: #ef4444; }
.result-stat-card.warning .stat-number { color: #f59e0b; }

.result-stat-card .stat-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* Mappings Created Card */
.mappings-created-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.mappings-created-card .card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 10px;
    flex-shrink: 0;
}

.mappings-created-card .card-content h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.mapping-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mapping-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 500;
}

.mapping-tag.category { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.mapping-tag.brand { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.mapping-tag.attribute { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.mapping-tag.value { background: rgba(16, 185, 129, 0.1); color: #10b981; }

/* Responsive */
@media (max-width: 1024px) {
    .preview-stats-hero {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .preview-stats-hero {
        grid-template-columns: 1fr;
    }
    .mapping-summary-grid,
    .attributes-preview-grid {
        grid-template-columns: 1fr;
    }
    .settings-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== PRODUCT MERGE WIZARD ========== */
.merge-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.merge-product-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.merge-product-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.merge-product-card.selected {
    border-color: var(--primary);
    background: var(--primary-alpha);
    box-shadow: 0 0 20px var(--primary-alpha);
}

.product-select-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-input);
    color: var(--primary);
    flex-shrink: 0;
}

.merge-product-card.selected .product-select-indicator {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.merge-product-card .product-image {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    flex-shrink: 0;
}

.merge-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merge-product-card .product-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.merge-product-card .product-details {
    flex: 1;
    min-width: 0;
}

.merge-product-card .product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-product-card .product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.merge-product-card .product-meta .sku {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--primary-alpha);
    color: var(--primary);
    border-radius: 4px;
    font-family: var(--font-mono);
}

.merge-product-card .product-meta .variant-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.merge-product-card .product-category {
    font-size: 12px;
    color: var(--text-muted);
}

.main-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Merge Stats */
.merge-stats {
    display: flex;
    gap: 24px;
    margin: 20px 0;
}

.merge-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.merge-stat .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.merge-stat .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Variant List Container */
.variant-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.variant-list-container .data-table {
    margin: 0;
}

.variant-list-container tr.row-highlight {
    background: var(--primary-alpha);
}

.variant-list-container .source-product {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-list-container .source-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.variant-list-container .source-badge.main {
    background: var(--success);
    color: white;
}

.variant-list-container .source-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.variant-list-container .variant-name,
.variant-list-container .sku-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.variant-list-container .barcode-text,
.variant-list-container .price-text,
.variant-list-container .stock-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Preview Summary Card */
.preview-summary-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--primary-alpha);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.preview-summary-card .preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
}

.preview-summary-card .preview-icon.success {
    background: var(--success);
}

.preview-summary-card .preview-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.preview-summary-card .preview-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Preview Details */
.preview-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.preview-section {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.preview-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.preview-item .item-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-item .item-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.preview-delete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--error);
    font-size: 13px;
}

.preview-delete-item:last-child {
    border-bottom: none;
}

.preview-delete-item .variant-info {
    color: var(--text-muted);
    font-size: 12px;
}

/* Confirm Notice Card */
.confirm-notice-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius);
}

.confirm-notice-card.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.confirm-notice-card .notice-icon {
    color: #f59e0b;
    flex-shrink: 0;
}

.confirm-notice-card .notice-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 4px;
}

.confirm-notice-card .notice-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Wizard stepper container for merge wizard */
.wizard-stepper-container {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
}

.wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition);
}

.wizard-step .step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    background: var(--border);
    color: var(--text-muted);
}

.wizard-step .step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.wizard-step.active {
    background: var(--primary-alpha);
}

.wizard-step.active .step-indicator {
    background: var(--primary);
    color: white;
}

.wizard-step.active .step-label {
    color: var(--primary);
}

.wizard-step.completed .step-indicator {
    background: var(--success);
    color: white;
}

.wizard-step.completed .step-label {
    color: var(--success);
}

/* Wizard Body */
.wizard-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Modal Error */
.modal-error {
    font-size: 13px;
    color: var(--error);
    margin-right: auto;
}

/* Modal Loading */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .preview-details {
        grid-template-columns: 1fr;
    }
    .merge-stats {
        flex-direction: column;
        gap: 12px;
    }
    .merge-stat {
        padding: 16px;
    }
}

/* ========== ATTRIBUTE MAPPING PANEL ========== */
.attribute-mapping-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mapping-header-info {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.mapping-header-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mapping-header-info .info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.mapping-header-info .info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.mapping-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.mapping-stats {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Attribute Mapping Header */
.attr-mapping-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 40px;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Attribute List */
.attribute-mapping-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 8px;
}

.attribute-mapping-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 40px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.attribute-mapping-row:hover {
    border-color: var(--border-hover);
}

.attribute-mapping-row.required {
    background: rgba(245, 158, 11, 0.03);
}

.attribute-mapping-row.mapped {
    background: rgba(16, 185, 129, 0.05);
}

.attribute-mapping-row.mapped .col-platform .required-icon {
    color: var(--success);
}

/* Column Styles */
.col-platform,
.col-local,
.col-default,
.col-values {
    min-width: 0;
}

.col-platform .platform-attr-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.col-platform .required-icon {
    color: #f59e0b;
    flex-shrink: 0;
}

.col-platform .attr-details {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.col-platform .attr-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.col-platform .attr-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.col-platform .attr-badge.variant {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.col-local,
.col-default {
    min-width: 180px;
}

.col-values {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-values {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-values:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-values.active {
    border-color: var(--primary);
    background: var(--primary-alpha);
    color: var(--primary);
}

.btn-values .value-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Value Mappings Panel */
.value-mappings-panel {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}

.value-mappings-header {
    margin-bottom: 12px;
}

.value-mappings-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.value-mappings-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.value-mapping-row {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.value-mapping-row .platform-value {
    font-size: 13px;
    color: var(--text-primary);
}

.value-mapping-row .value-arrow {
    text-align: center;
    color: var(--text-muted);
}

.value-mapping-row .local-value {
    min-width: 150px;
}

/* Panel States */
.panel-loading,
.panel-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.panel-error {
    color: var(--error);
}

/* ========================================
   Customer Questions Page
   ======================================== */
.questions-page {
    display: flex;
    height: calc(100vh - 73px);
    overflow: hidden;
}

.questions-left-panel {
    width: 40%;
    min-width: 380px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
}

.questions-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow-y: auto;
}

/* Panel Header */
.questions-left-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.questions-left-panel .panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.questions-left-panel .refresh-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.questions-left-panel .refresh-btn svg.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Store Tabs */
.store-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
    overflow-y: auto;
}

.store-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
}

.store-tab:hover {
    background: var(--bg-input);
    border-color: var(--border);
}

.store-tab.active {
    background: linear-gradient(135deg, var(--primary-alpha) 0%, transparent 100%);
    border-color: var(--primary);
}

.store-tab-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.store-tab-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.store-tab-info .store-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-tab-info .platform-name {
    font-size: 12px;
    color: var(--text-muted);
}

.question-count-badge {
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}

/* Question List */
.question-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.question-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.question-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-alpha) 0%, var(--bg-secondary) 100%);
}

.question-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.question-card .customer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.customer-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.customer-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-details .customer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.customer-details .question-date {
    font-size: 11px;
    color: var(--text-muted);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.waiting {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-indicator.answered {
    background: #10b981;
}

.status-indicator.rejected {
    background: #ef4444;
}

.status-indicator.reported {
    background: #8b5cf6;
}

.question-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.question-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.question-product .product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.question-product .product-name {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
}

.load-more-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.load-more-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Empty States */
.question-list .empty-state,
.answer-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    flex: 1;
}

.question-list .empty-state svg,
.answer-empty-state svg {
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.question-list .empty-state.success svg {
    color: #10b981;
    opacity: 0.7;
}

.question-list .empty-state h4,
.answer-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.question-list .empty-state p,
.answer-empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 280px;
}

.answer-empty-state {
    height: 100%;
}

.empty-illustration {
    width: 120px;
    height: 120px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 2px dashed var(--border);
}

.empty-illustration svg {
    opacity: 0.3;
    margin: 0 !important;
}

/* Answer Panel */
.answer-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.question-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.question-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.question-customer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.question-customer .customer-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.question-customer .question-time {
    font-size: 13px;
    color: var(--text-muted);
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.status-badge.waiting {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.answered {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.question-content {
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.question-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}

.question-product-detail {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.question-product-detail .product-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.question-product-detail .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.question-product-detail .product-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.question-product-detail .product-sku {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.question-product-detail .product-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    margin-top: auto;
}

.question-product-detail .product-link:hover {
    text-decoration: underline;
}

/* Product Detail Loading */
.product-detail-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Product Extended Info */
.product-extended-info {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.product-extended-info h6 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-value.stock.in-stock {
    color: var(--success);
}

.detail-value.stock.out-of-stock {
    color: var(--danger);
}

.detail-value.price {
    color: var(--primary);
    font-weight: 600;
}

.product-extended-info .product-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.product-extended-info .product-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Other Variants */
.other-variants {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.other-variants h6 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    padding-bottom: 0;
    border-bottom: none;
}

.variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 11px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.variant-chip.out-of-stock {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.variant-chip.more {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-style: italic;
}

.variant-thumb {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.variant-name {
    font-weight: 500;
}

.variant-stock {
    color: var(--text-muted);
    font-size: 10px;
}

/* Answer Form */
.answer-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.answer-form-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.ai-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.ai-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.ai-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-generate-btn.loading {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
}

.ai-generate-btn svg {
    width: 16px;
    height: 16px;
}

.ai-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.answer-textarea-wrapper {
    position: relative;
}

.answer-textarea-wrapper.ai-loading .answer-textarea {
    background: linear-gradient(90deg, var(--bg-input) 0%, rgba(139, 92, 246, 0.05) 50%, var(--bg-input) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.textarea-footer .ai-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8b5cf6;
    font-size: 12px;
    font-weight: 500;
}

.ai-dot {
    width: 6px;
    height: 6px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.answer-textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.answer-textarea::placeholder {
    color: var(--text-muted);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    gap: 12px;
}

.textarea-footer .char-count {
    margin-left: auto;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

.char-count.warning {
    color: #f59e0b;
}

.answer-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #f59e0b;
    margin-bottom: 16px;
}

.answer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.answer-actions .btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.answer-actions .btn svg {
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
    .questions-left-panel {
        width: 45%;
        min-width: 320px;
    }
}

@media (max-width: 900px) {
    .questions-page {
        flex-direction: column;
        height: auto;
    }

    .questions-left-panel {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .questions-right-panel {
        min-height: 50vh;
    }

    .store-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }

    .store-tab {
        flex: 1;
        min-width: 150px;
    }

    .answer-panel {
        padding: 20px;
    }
}
