        :root {
            --bg-body: #fdfdfd;
            --bg-sidebar: #ffffff;
            --bg-content: #ffffff;
            --bg-hover: #f5f5f5;
            --bg-active: #f0f0f0;
            --bg-input: #ffffff;

            --border-color: #e5e7eb;
            --border-focus: #111827;

            --text-primary: #111827;
            --text-secondary: #6b7280;
            --text-muted: #9ca3af;

            --accent-color: #111827;
            /* Dark almost black for elegance */
            --accent-text: #ffffff;

            --success: #10b981;
            --danger: #ef4444;

            --radius: 8px;
            --font-main: 'Inter', sans-serif;

            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-main);
            background: var(--bg-body);
            color: var(--text-primary);
            height: 100vh;
            display: flex;
            overflow: hidden;
            font-size: 14px;
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }

        /* Sidebar */
        .sidebar {
            width: 240px;
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            height: 100%;
        }

        .sidebar-header {
            height: 70px;
            display: flex;
            align-items: center;
            padding: 0 1.5rem;
            border-bottom: 1px solid transparent;
            /* Subtle or none */
        }

        .logo {
            font-weight: 600;
            font-size: 1.1rem;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logo svg {
            width: 20px;
            height: 20px;
        }

        .sidebar-nav {
            flex: 1;
            padding: 1.5rem 0.75rem;
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            overflow-y: auto;
        }

        .nav-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 0.75rem 0.75rem 0.5rem;
            margin-top: 0.5rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.6rem 0.75rem;
            border-radius: var(--radius);
            color: var(--text-secondary);
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s ease;
            text-decoration: none;
        }

        .nav-item:hover {
            color: var(--text-primary);
            background: var(--bg-hover);
        }

        .nav-item.active {
            background: var(--bg-active);
            color: var(--text-primary);
        }

        .nav-item svg {
            width: 18px;
            height: 18px;
            stroke-width: 1.5;
        }

        .sidebar-footer {
            padding: 1rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            background: var(--bg-active);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text-primary);
        }

        .user-info {
            flex: 1;
            min-width: 0;
        }

        .user-name {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .user-role {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .logout-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 4px;
        }

        .logout-btn:hover {
            color: var(--danger);
            background: #fee2e2;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            background: var(--bg-body);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .view {
            display: none;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
        }

        .view.active {
            display: flex;
        }

        .view-header {
            padding: 2rem 2.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--bg-body);
        }

        .view-title {
            font-size: 1.5rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            color: var(--text-primary);
        }

        .view-subtitle {
            margin-top: 0.25rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .dashboard-container {
            flex: 1;
            padding: 0 2.5rem 2rem;
            overflow-y: auto;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: var(--bg-content);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            box-shadow: var(--shadow-sm);
        }

        .stat-label {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 600;
            letter-spacing: -0.03em;
            color: var(--text-primary);
        }

        .stat-change {
            font-size: 0.8rem;
            font-weight: 500;
        }

        .stat-change.up {
            color: var(--success);
        }

        .stat-change.down {
            color: var(--danger);
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        /* General Card */
        .card {
            background: var(--bg-content);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            overflow: hidden;
        }

        .card-header {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-title {
            font-size: 1rem;
            font-weight: 600;
        }

        .card-body {
            padding: 1.5rem;
        }

        /* Lists & Tables */
        .activity-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 0;
            border-bottom: 1px solid var(--border-color);
        }

        .activity-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .activity-item:first-child {
            padding-top: 0;
        }

        .activity-content h4 {
            font-size: 0.9rem;
            font-weight: 500;
        }

        .activity-content p {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .activity-time {
            margin-left: auto;
            font-size: 0.75rem;
            color: var(--text-muted);
            white-space: nowrap;
        }

        /* Login Screen */
        .login-overlay {
            position: fixed;
            inset: 0;
            background: #ffffff;
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .login-box {
            width: 100%;
            max-width: 380px;
            padding: 2rem;
        }

        .login-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }

        .login-header h1 {
            font-size: 1.75rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            margin-bottom: 0.5rem;
        }

        .login-header p {
            color: var(--text-secondary);
        }

        .form-group {
            margin-bottom: 1.25rem;
        }

        .input-field {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            font-size: 0.95rem;
            outline: none;
            transition: all 0.2s;
            font-family: inherit;
        }

        .input-field:focus {
            border-color: var(--border-focus);
            box-shadow: 0 0 0 1px var(--border-focus);
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.75rem 1.5rem;
            border-radius: var(--radius);
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
            gap: 0.5rem;
        }

        .btn-primary {
            background: var(--accent-color);
            color: var(--accent-text);
            width: 100%;
        }

        .btn-primary:hover {
            opacity: 0.9;
        }

        .btn-secondary {
            background: #ffffff;
            border: 1px solid var(--border-color);
            color: var(--text-primary);
        }

        .btn-secondary:hover {
            background: var(--bg-hover);
        }

        .error-msg {
            color: var(--danger);
            font-size: 0.85rem;
            text-align: center;
            margin-top: 1rem;
            display: none;
        }

        /* Utilities */
        .hidden {
            display: none !important;
        }

        /* Specific Views */
        /* Live Chat */
        .chat-layout {
            display: flex;
            height: 100%;
            border-top: 1px solid var(--border-color);
            overflow: hidden;
        }

        .chat-sidebar {
            width: 300px;
            min-width: 300px;
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            background: #fff;
        }

        .chat-main {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            background: #fdfdfd;
        }

        .user-details-panel {
            width: 280px;
            min-width: 280px;
            flex-shrink: 0;
            background: #fff;
            border-left: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
        }

        .chat-search {
            padding: 1rem;
            border-bottom: 1px solid var(--border-color);
        }

        .contact-list {
            flex: 1;
            overflow-y: auto;
        }

        .contact-item {
            padding: 1rem;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            transition: background 0.1s;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .contact-item:hover {
            background: var(--bg-hover);
        }

        .contact-item.active {
            background: var(--bg-active);
        }

        .chat-messages {
            flex: 1;
            padding: 2rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .chat-input-area {
            padding: 1.5rem;
            border-top: 1px solid var(--border-color);
            background: #fff;
            display: flex;
            gap: 1rem;
        }

        /* Message Bubbles - Minimalist */
        .msg {
            max-width: 85%;
            padding: 0.75rem 1rem;
            border-radius: 12px;
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .msg p {
            margin: 0.25rem 0;
        }

        .msg p:first-child {
            margin-top: 0;
        }

        .msg p:last-child {
            margin-bottom: 0;
        }

        .msg.user {
            align-self: flex-end;
            background: var(--accent-color);
            color: #fff;
            border-bottom-right-radius: 2px;
        }

        .msg.assistant {
            align-self: flex-start;
            background: #fff;
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            border-bottom-left-radius: 2px;
        }

        .msg.system {
            align-self: center;
            background: #f9fafb;
            border: 1px dashed var(--border-color);
            color: var(--text-secondary);
            font-size: 0.8rem;
            max-width: 90%;
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-thumb {
            background: #d1d5db;
            border-radius: 3px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        /* Delete button - Minimalist trash icon */
        .delete-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            opacity: 0;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .delete-btn:hover {
            color: var(--danger);
            background: #fee2e2;
        }

        .contact-item:hover .delete-btn,
        tr:hover .delete-btn {
            opacity: 1;
        }

        .delete-btn svg {
            width: 14px;
            height: 14px;
        }

        /* FAQ Styles */
        .faq-list {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .faq-row {
            border-bottom: 1px solid var(--border-color);
            transition: background 0.15s;
        }

        .faq-row:last-child {
            border-bottom: none;
        }

        .faq-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.9rem 1rem;
            cursor: pointer;
            user-select: none;
        }

        .faq-header:hover {
            background: var(--bg-hover);
        }

        .faq-chevron {
            flex-shrink: 0;
            width: 16px;
            height: 16px;
            color: var(--text-muted);
            transition: transform 0.2s;
        }

        .faq-row.open .faq-chevron {
            transform: rotate(90deg);
        }

        .faq-question {
            flex: 1;
            font-weight: 500;
            font-size: 0.9rem;
            color: var(--text-primary);
            min-width: 0;
        }

        .faq-meta {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-shrink: 0;
        }

        .faq-category {
            display: inline-block;
            padding: 2px 8px;
            background: var(--bg-hover);
            border-radius: 4px;
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-transform: capitalize;
        }

        .faq-status-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .faq-status-dot.active {
            background: var(--success);
        }

        .faq-status-dot.inactive {
            background: var(--text-muted);
        }

        .faq-actions {
            display: flex;
            gap: 2px;
            flex-shrink: 0;
        }

        .faq-actions button {
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            color: var(--text-muted);
            transition: all 0.15s;
        }

        .faq-actions button:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .faq-actions button.delete-action:hover {
            color: var(--danger);
            background: #fee2e2;
        }

        .faq-actions button svg {
            width: 14px;
            height: 14px;
        }

        .faq-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.25s ease;
        }

        .faq-row.open .faq-body {
            max-height: 300px;
        }

        .faq-answer {
            padding: 0 1rem 1rem 2.65rem;
            font-size: 0.82rem;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
        }

        .modal-overlay.open {
            opacity: 1;
            pointer-events: auto;
        }

        .modal {
            background: #fff;
            border-radius: 12px;
            width: 100%;
            max-width: 1200px;
            /* Widened from 800px */
            max-height: 90vh;
            overflow-y: auto;
            padding: 2rem;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
            transform: translateY(10px);
            transition: transform 0.2s;
        }

        /* 2-Column Grid for Product Edit */
        .modal-grid {
            display: grid;
            grid-template-columns: 350px 1fr;
            gap: 2rem;
            align-items: start;
        }

        .modal-left {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .modal-right {
            display: flex;
            flex-direction: column;
            gap: 0;
            /* Form groups handle their own margin */
        }

        /* Form Row for grid usage */
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        @media (max-width: 900px) {
            .modal-grid {
                grid-template-columns: 1fr;
            }

            .form-row {
                grid-template-columns: 1fr;
            }
        }

        .modal-overlay.open .modal {
            transform: translateY(0);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .modal-header h3 {
            font-size: 1.1rem;
            font-weight: 600;
        }

        .modal-close {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-muted);
            padding: 4px;
        }

        .modal-close:hover {
            color: var(--text-primary);
        }

        .modal .form-group {
            margin-bottom: 1.25rem;
        }

        .modal label {
            display: block;
            font-size: 0.85rem;
            font-weight: 500;
            margin-bottom: 0.4rem;
            color: var(--text-secondary);
        }

        .modal textarea {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            font-size: 0.9rem;
            font-family: inherit;
            resize: vertical;
            min-height: 80px;
            color: var(--text-primary);
            transition: border-color 0.15s;
        }

        .modal textarea:focus {
            outline: none;
            border-color: var(--border-focus);
            box-shadow: 0 0 0 1px var(--border-focus);
        }

        .modal select {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            font-size: 0.9rem;
            font-family: inherit;
            color: var(--text-primary);
            cursor: pointer;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        .modal-footer .btn {
            width: auto;
            padding: 0.6rem 1.25rem;
        }

        .toggle-switch {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .toggle-switch input[type="checkbox"] {
            position: relative;
            width: 36px;
            height: 20px;
            appearance: none;
            background: #d1d5db;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .toggle-switch input[type="checkbox"]:checked {
            background: var(--success);
        }

        .toggle-switch input[type="checkbox"]::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: transform 0.2s;
        }

        .toggle-switch input[type="checkbox"]:checked::after {
            transform: translateX(16px);
        }

        .faq-toolbar {
            display: flex;
            gap: 0.75rem;
            align-items: center;
        }

        .faq-toolbar select {
            padding: 0.5rem 0.75rem;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            font-size: 0.85rem;
            color: var(--text-primary);
            cursor: pointer;
        }

        .faq-empty {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--text-muted);
        }

        .faq-empty svg {
            opacity: 0.3;
            margin-bottom: 1rem;
        }

        /* Category filter tabs */
        .category-tabs {
            display: flex;
            gap: 0.5rem;
            padding: 0 2rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .category-tab {
            padding: 0.35rem 0.9rem;
            border-radius: 20px;
            border: 1px solid var(--border-color);
            background: var(--bg-input);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all 0.15s;
        }

        .category-tab:hover {
            background: var(--bg-hover);
        }

        .category-tab.active {
            background: var(--accent-color);
            color: var(--accent-text);
            border-color: var(--accent-color);
        }

        /* Compact filter bar replacing the horizontal tabs */
        .featured-filter-bar {
            display: flex;
            gap: 0.6rem;
            padding: 0 2rem;
            margin-bottom: 1rem;
            align-items: center;
        }

        .featured-filter-bar select {
            padding: 0.35rem 0.75rem;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 0.82rem;
            font-family: var(--font-main);
            cursor: pointer;
            min-width: 170px;
        }

        .btn-toggle-recommended {
            padding: 0.35rem 0.85rem;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background: var(--bg-input);
            color: var(--text-secondary);
            font-size: 0.82rem;
            font-family: var(--font-main);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .btn-toggle-recommended:hover {
            background: var(--bg-hover);
        }

        .btn-toggle-recommended.active {
            background: #f0fdf4;
            color: #16a34a;
            border-color: #86efac;
        }

        /* Info icon button */
        .info-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 1.5px solid var(--text-muted);
            background: transparent;
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 700;
            cursor: pointer;
            position: relative;
            margin-left: 0.4rem;
            vertical-align: middle;
            flex-shrink: 0;
            transition: all 0.15s;
        }

        .info-btn:hover {
            border-color: var(--accent-color);
            color: var(--accent-color);
        }

        .info-btn:hover .info-tooltip {
            display: block;
        }

        .info-tooltip {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #1a1a1a;
            color: #fff;
            font-size: 0.78rem;
            font-weight: 400;
            line-height: 1.55;
            padding: 0.6rem 0.85rem;
            border-radius: 8px;
            width: 240px;
            white-space: normal;
            z-index: 999;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
            pointer-events: none;
        }

        .info-tooltip::after {
            content: '';
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-bottom-color: #1a1a1a;
        }

        .category-group-header {
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-hover);
        }

        .priority-stars {
            font-size: 0.75rem;
            letter-spacing: 1px;
        }

        .priority-stars .filled {
            color: #f59e0b;
        }

        .priority-stars .empty {
            color: #e5e7eb;
        }

        .variant-badge {
            font-size: 0.7rem;
            background: var(--bg-active);
            padding: 1px 6px;
            border-radius: 10px;
            color: var(--text-secondary);
            margin-left: 4px;
        }

        .faq-count {
            font-size: 0.85rem;
            color: var(--text-muted);
        }
