* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Heavenly Color Palette - Enhanced */
    --primary-yellow: #FFFDF0;
    --secondary-yellow: #FFF9E6;
    --accent-yellow: #FFE599;
    --warm-yellow: #FFD966;

    --primary-blue: #F0F9FF;
    --secondary-blue: #E0F2FE;
    --accent-blue: #7DD3FC;
    --deep-blue: #0EA5E9;
    --vibrant-blue: #0284C7;

    /* Neutral Colors */
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --white: #FFFFFF;
    --border-light: rgba(14, 165, 233, 0.15);

    /* Gradients */
    --gradient-heaven: linear-gradient(135deg, #FFFDF0 0%, #F0F9FF 50%, #FFF9E6 100%);
    --gradient-soft: linear-gradient(180deg, #F0F9FF 0%, #FFFDF0 100%);
    --gradient-sidebar: linear-gradient(180deg, #E0F2FE 0%, #F0F9FF 100%);
    --gradient-vibrant: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);

    /* Shadows */
    --shadow-soft: 0 10px 30px -10px rgba(14, 165, 233, 0.1);
    --shadow-medium: 0 20px 40px -15px rgba(14, 165, 233, 0.15);
    --shadow-glow: 0 0 50px -10px rgba(14, 165, 233, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(12px);

    /* Spacing & Transitions */
    --sidebar-width: 280px;
    --border-radius: 24px;
    --border-radius-sm: 12px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-heaven);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow-y: auto;
}

/* ===== LAYOUT ===== */
.container {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
    overflow-y: auto;
}

/* ===== SIDEBAR (Heavenly Theme) ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition-smooth);
    box-shadow: 2px 0 24px -4px rgba(14, 165, 233, 0.08);
}

.logo {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.3);
}

.logo-icon {
    color: var(--deep-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--deep-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-links .nav-logout {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.nav-links .nav-logout .nav-link {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.nav-links .nav-logout:hover .nav-link {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.08);
}

.nav-links .nav-logout .nav-link i:first-of-type {
    color: inherit;
}

.nav-links > li {
    margin-bottom: 2px;
    border-radius: 10px;
    overflow: hidden;
}

.nav-links > li.nav-item:not(.nav-dropdown):not(.nav-section) {
    display: flex;
    align-items: center;
}

.nav-links .nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.nav-links .nav-item .nav-link i:first-of-type {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-links .nav-item:hover .nav-link {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
}

.nav-links .nav-item:hover .nav-link i:first-of-type {
    color: var(--deep-blue);
}

.nav-links .nav-item.active .nav-link {
    background: var(--white);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
}

.nav-links .nav-item.active .nav-link i:first-of-type {
    color: var(--deep-blue);
}

/* Dropdown parent row */
.nav-dropdown .nav-link.nav-dropdown-toggle {
    position: relative;
}

.nav-dropdown .dropdown-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
}

.nav-dropdown.open .nav-link {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    border-radius: 10px 10px 0 0;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--deep-blue);
}

.nav-dropdown.active .nav-link {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
}

.nav-dropdown.active .nav-link i:first-of-type {
    color: var(--deep-blue);
}

/* Dropdown menu container */
.nav-dropdown-menu {
    list-style: none;
    padding: 6px 0 8px 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 10px 10px;
    margin-top: -2px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-top: none;
    box-shadow: inset 0 4px 8px -2px rgba(14, 165, 233, 0.06);
}

.nav-dropdown.open .nav-dropdown-menu {
    max-height: 220px;
}

.nav-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.nav-links .nav-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 38px;
    border-radius: 8px;
    margin: 2px 6px 4px 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: calc(100% - 12px);
}

.nav-links .nav-sublink::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.6;
    transition: background 0.2s ease;
}

.nav-links .nav-sublink:hover {
    background: var(--white);
    color: var(--text-primary);
}

.nav-links .nav-sublink:hover::before {
    background: var(--deep-blue);
}

.nav-links .nav-sublink.active {
    background: var(--white);
    color: var(--deep-blue);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(14, 165, 233, 0.15);
}

.nav-links .nav-sublink.active::before {
    background: var(--deep-blue);
    opacity: 1;
    width: 6px;
    height: 6px;
    left: 16px;
}

/* Chat History section */
.nav-section .nav-link.nav-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-section .dropdown-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.nav-section.open .nav-link {
    background: rgba(255, 255, 255, 0.6);
}

.nav-section.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--deep-blue);
}

.sidebar-chat-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
    padding: 0 12px 12px 12px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 0 0 10px 10px;
    margin-left: 2px;
    margin-right: 2px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: none;
}

.nav-section.open .sidebar-chat-history {
    max-height: 280px;
}

.nav-section .nav-link {
    border-radius: 10px;
}

.nav-section.open .nav-link {
    border-radius: 10px 10px 0 0;
}

.btn-new-chat-sidebar {
    width: 100%;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--deep-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08);
}

.btn-new-chat-sidebar:hover {
    background: var(--primary-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

.sidebar-history-list,
.sidebar-history-list li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-history-list {
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-history-list li.sidebar-history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s ease, color 0.2s ease;
    margin: 0 2px;
}

.sidebar-history-list li.sidebar-history-item:hover {
    background: var(--white);
    color: var(--text-primary);
}

.sidebar-history-list li.sidebar-history-item.active-chat {
    background: var(--white);
    color: var(--deep-blue);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(14, 165, 233, 0.12);
}

/* Decorative Clouds */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 100px;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.cloud-1 {
    width: 400px;
    height: 200px;
    top: -50px;
    right: 10%;
    animation: cloudFloat 20s ease-in-out infinite;
}

.cloud-2 {
    width: 300px;
    height: 150px;
    bottom: 20%;
    left: 5%;
    animation: cloudFloat 25s ease-in-out infinite reverse;
}

.cloud-3 {
    width: 350px;
    height: 180px;
    top: 40%;
    right: -5%;
    animation: cloudFloat 22s ease-in-out infinite;
}

/* ===== GLOBAL SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--deep-blue);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) transparent;
}

@keyframes cloudFloat {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(20px) translateY(-10px);
    }

    50% {
        transform: translateX(-10px) translateY(5px);
    }

    75% {
        transform: translateX(15px) translateY(-5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ===== MAIN DASHBOARD ===== */
.main-dashboard {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: transparent;
    position: relative;
    z-index: 1;
}

header {
    background: var(--white);
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-soft);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ===== BUTTONS (Heavenly Theme) ===== */
.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
}

.btn:hover {
    background: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-primary {
    background: var(--deep-blue);
    border-color: var(--deep-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: #5DA8CC;
    border-color: #5DA8CC;
    transform: translateY(-2px);
}

.btn-success {
    background: #10B981;
    border-color: #10B981;
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.btn-enhance {
    background: var(--warm-yellow);
    border-color: var(--warm-yellow);
    color: var(--text-primary);
}

.btn-enhance:hover {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

.btn-danger {
    background: var(--white);
    border-color: #FECACA;
    color: #DC2626;
}

.btn-danger:hover {
    background: #FEE2E2;
}

.btn-secondary {
    background: var(--white);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--primary-yellow);
}

.btn-view {
    background: var(--white);
    border: 1px solid var(--border-light);
    color: var(--deep-blue);
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-view:hover {
    background: var(--primary-light);
    border-color: var(--primary-blue);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    max-height: 90vh;
    overflow-y: auto;
}


/* ===== DASHBOARD ===== */
.view {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 4rem;
}

.welcome-section {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.welcome-section h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: var(--text-muted);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow-y: auto;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.stat-card:nth-child(1)::before {
    background: var(--primary-blue);
}

.stat-card:nth-child(2)::before {
    background: var(--accent-green);
}

.stat-card:nth-child(3)::before {
    background: var(--accent-cyan);
}

.stat-card:nth-child(4)::before {
    background: var(--accent-purple);
}

.stat-icon {
    font-size: 1.8rem;
    background: var(--primary-light);
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content h3 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--text-main);
}

.stat-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== CARDS (Heavenly Theme) ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    margin-bottom: 32px;
    transition: var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.card h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
}

/* ===== SUPPLIER CATEGORY CARDS (Separated) ===== */
#vendor-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    /* Separated spacing */
    margin-top: 1.5rem;
}

.category-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    /* Rounded Cards */
    padding: 0;
    /* Header separation */
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Distinct Header for each card */
.category-card h3 {
    background: #f8fafc;
    padding: 1.25rem;
    margin: 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 700;
}

.empty-category {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: white;
}

/* Supplier Items inside Card */
.supplier-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    background: white;
}

.supplier-item:hover {
    background: var(--primary-light);
}

.supplier-item:last-child {
    border-bottom: none;
}

.supplier-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.supplier-email {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: block;
}

.supplier-actions {
    display: flex;
    gap: 0.75rem;
}

.supplier-actions .btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ===== EMAIL ITEMS ===== */
#email-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

#email-list li:hover {
    background: var(--bg-body);
}

/* ===== INPUTS ===== */
input,
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border 0.2s;
    background: white;
    color: var(--text-main);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== AI ASSISTANT (Light/Clean) ===== */
.chat-window {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.chat-message {
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    max-width: 85%;
    line-height: 1.5;
}

.chat-message.user-message {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    margin-left: auto;
    color: var(--text-main);
}

.chat-message.assistant-message {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.chat-message strong {
    color: var(--primary-blue);
}

/* ===== COMPARISON TABLE UI ===== */
#comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

#comparison-table th {
    padding: 1rem;
    text-align: left;
    background: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-light);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

#comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    transition: background 0.2s;
}

#comparison-table tr:hover td {
    background: #f8fafc;
}

/* Product Group Header */
.product-group-header {
    background: #f1f5f9;
}

.product-group-header td {
    padding: 0.75rem 1rem;
    color: var(--primary-dark);
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
}

/* Price Badges */
.badge-best {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.badge-high {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.badge-recommended {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    display: inline-block;
}

.price-text {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.05rem;
}

.quick-actions a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.drafts-page-header,
.page-header {
    margin-bottom: 1.5rem;
}

.drafts-page-header h2,
.page-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drafts-layout {
    display: flex;
    gap: 1.5rem;
    min-height: 400px;
}

.drafts-list-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.drafts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow-y: auto;
}

.drafts-list li {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.drafts-list li:hover {
    background: var(--primary-blue);
}

.drafts-list li.active-draft {
    background: var(--secondary-blue);
    border-left: 4px solid var(--deep-blue);
    font-weight: 500;
}

.drafts-list li .draft-subject {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.drafts-list li .draft-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.drafts-preview-panel {
    flex: 1;
    min-width: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.drafts-preview-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 2rem;
}

.drafts-preview-content .drafts-preview-meta {
    margin-bottom: 1rem;
}

.drafts-preview-content .drafts-preview-meta p {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
}

.drafts-preview-body {
    margin: 1rem 0;
}

.drafts-preview-body label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.drafts-preview-body pre {
    background: var(--primary-blue);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    white-space: pre-wrap;
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
}

.drafts-preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    background: var(--primary-blue);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border-light);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

.data-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.05);
}

.rate-list-toolbar {
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--deep-blue);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-dashboard {
        margin-left: 0;
        height: auto;
    }

    #vendor-categories {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .nav-links li {
        white-space: nowrap;
        margin-bottom: 0;
        flex: 0 0 auto;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 180px;
    }

    .drafts-layout {
        flex-direction: column;
    }

    .drafts-list-panel {
        width: 100%;
        max-height: 280px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* AI Chat Formatting Fixes */
.chat-message ul,
.chat-message ol {
    margin-left: 1.5rem;
    padding-left: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-message li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
    list-style-position: outside;
    padding-left: 0;
    text-indent: 0;
}

/* AI Assistant Container (Drop Zone Indicator) */
.ai-assistant-container {
    transition: var(--transition-smooth);
    border: 3px dashed transparent !important;
}

.ai-assistant-container.drag-over {
    border-color: var(--deep-blue) !important;
    background: rgba(14, 165, 233, 0.05);
}

.ai-upload-zone {
    display: none;
}

/* AI Quick Actions (Heavenly Style) */
.ai-quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 32px;
}

.ai-quick-btn {
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-soft);
}

.ai-quick-btn:hover {
    background: var(--primary-yellow);
    border-color: var(--accent-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.ai-quick-btn i {
    color: var(--deep-blue);
    font-size: 1rem;
}

/* ===== GREETING SECTION (Heavenly) ===== */
.greeting-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.greeting-content {
    text-align: center;
    max-width: 650px;
}

.greeting-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.greeting-icon {
    display: flex;
    align-items: center;
    filter: drop-shadow(0 4px 12px rgba(126, 196, 232, 0.4));
}

.greeting-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--deep-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.greeting-message {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.greeting-line {
    margin-bottom: 8px;
}

.greeting-line.line-3 {
    margin-top: 16px;
    color: var(--deep-blue);
    font-weight: 500;
}

/* Chat Messages Container */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 0;
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    display: none;
}

.chat-messages-container.active {
    display: block;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Chat Message Bubbles (Heavenly Style) */
.chat-message {
    display: flex;
    gap: 16px;
    padding: 24px;
    border-radius: var(--border-radius);
    line-height: 1.8;
    animation: messageFadeIn 0.5s ease-out;
    max-width: 90%;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: var(--white);
    border: 1px solid var(--glass-border);
    margin-left: auto;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    border-bottom-right-radius: 4px;
}

.assistant-message {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-soft);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.assistant-message strong {
    color: var(--deep-blue);
}

/* AI Input Container (Heavenly) */
.ai-input-container {
    padding-top: 24px;
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
}

.ai-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 10px 16px;
    min-height: 64px;
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
    gap: 16px;
}

.ai-input-wrapper:focus-within {
    border-color: var(--deep-blue);
    box-shadow: var(--shadow-glow);
}

.ai-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: var(--text-primary);
    background: transparent;
}

.ai-send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--deep-blue) 100%);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(126, 196, 232, 0.5);
}

.ai-send-btn:active {
    transform: scale(0.95);
}

.ai-input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-clear-btn-small {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.ai-clear-btn-small:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-upload-prominent {
    width: 44px;
    height: 44px;
    background: var(--vibrant-blue);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.btn-upload-prominent:hover {
    transform: scale(1.05);
    background: var(--deep-blue);
    box-shadow: var(--shadow-medium);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ai-assistant-container {
        padding: 1rem;
    }

    .ai-welcome-title {
        font-size: 1.5rem;
    }

    .ai-quick-actions {
        flex-direction: column;
        width: 100%;
    }

    .ai-quick-btn {
        width: 100%;
        justify-content: center;
    }

    .ai-input-container {
        flex-direction: column;
    }

    .ai-clear-btn-small {
        width: 100%;
        justify-content: center;
        border: 1px solid #fee2e2;
        padding: 10px;
        border-radius: var(--border-radius-sm);
    }
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ===== PRICE COMPARISON BADGES (Heavenly) ===== */
.badge-best {
    background: #D1FAE5;
    color: #059669;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-high {
    background: #FEE2E2;
    color: #DC2626;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-recommended {
    background: var(--primary-yellow);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--accent-yellow);
}

.product-group-header {
    background: rgba(232, 244, 253, 0.5) !important;
    font-weight: 600;
}

/* ===== AI ASSISTANT UPGRADE (ChatGPT Style) ===== */
.ai-view-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.ai-chat-history {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-header h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.btn-new-chat {
    width: 100%;
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--accent-blue);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-new-chat:hover {
    background: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.history-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 10px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.history-item:hover {
    background: var(--white);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.history-item.active {
    background: var(--white);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
}

.ai-assistant-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents overflow in flexbox */
}

/* Voice Button Styles */
.voice-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.voice-btn:hover {
    color: var(--deep-blue);
}

.voice-btn.listening {
    color: #DC2626;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .ai-view-layout {
        flex-direction: column;
        height: auto;
    }

    .ai-chat-history {
        width: 100%;
        height: 200px;
    }
}