/* Modern CSS for Bright Chatbot */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;       /* Indigo */
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --accent: #6b7280;        /* Slate Accent */
    --success: #10b981;
    --error: #ef4444;
    --white: #ffffff;
    --bg-app: #f8fafc;        /* Soft Cool Gray */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-premium: 0 10px 30px -5px rgba(0, 0, 0, 0.08); /* Modern Glow Shadow */
    --radius-xl: 1.25rem;
    --radius-2xl: 2rem;
    --glass-bg: rgba(255, 255, 255, 0.75);
    /* NEW Transitions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

/* Login Page Styles */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape-1 { width: 80px; height: 80px; top: 20%; left: 10%; animation-delay: 0s; }
.shape-2 { width: 120px; height: 120px; top: 60%; right: 10%; animation-delay: 2s; }
.shape-3 { width: 60px; height: 60px; top: 80%; left: 20%; animation-delay: 4s; }
.shape-4 { width: 100px; height: 100px; top: 10%; right: 30%; animation-delay: 1s; }
.shape-5 { width: 40px; height: 40px; top: 40%; left: 60%; animation-delay: 3s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

.login-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.logo-section {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    border: 4px solid var(--white);
}

.brand-name {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-tagline {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.login-form-section {
    width: 100%;
    max-width: 450px;
    margin-top: 5rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-header h2 i {
    color: var(--primary);
    font-size: 1.25rem;
}

.login-header p {
    color: var(--gray-500);
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.input-container {
    position: relative;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--gray-800);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

.login-btn {
    position: relative;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    pointer-events: none;
}

.login-btn.success {
    background: linear-gradient(135deg, var(--success) 0%, #38d9a9 100%);
}

.btn-text, .btn-icon, .btn-loading {
    transition: opacity 0.3s ease;
}

.btn-loading {
    opacity: 0;
    position: absolute;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: var(--radius-lg);
    color: var(--error);
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.error-message i {
    font-size: 1.125rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.login-footer p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.help-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.help-link:hover {
    color: var(--primary-dark);
}

.login-footer-main {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--white);
    font-size: 0.875rem;
    z-index: 3;
}

.login-footer-main a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
}

.login-footer-main i {
    color: var(--error);
    margin: 0 0.25rem;
}

/* ================================================================
   CHAT PAGE — Complete Professional Redesign
   Layout: Fixed Header → Scrollable Messages → Fixed Input
   ================================================================ */

.chat-body {
    height: 100vh;
    overflow: hidden; /* Prevent body scroll — only chat-messages scrolls */
    background: #eef2f7;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.chat-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.brand-info { display: flex; flex-direction: column; }

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Premium Model Switch Button */
.chat-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-toggle-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

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

.chat-toggle-btn i {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Mode-specific Button Variants */
.chat-toggle-btn.mode-unified { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.chat-toggle-btn.mode-sales { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.chat-toggle-btn.mode-sales_ai { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.chat-toggle-btn.mode-size { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.chat-toggle-btn.mode-company_wise { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #f1f5f9;
    border-radius: 8px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-info i {
    font-size: 1rem;
    color: var(--primary);
}

/* === MAIN LAYOUT (the key fix) === */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0.75rem;
    min-height: 0; /* critical for nested flex scroll */
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    min-height: 0; /* critical for nested flex scroll */
    overflow: hidden;
}

/* === SCROLLABLE MESSAGES === */
.chat-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: #fafbfc;
    min-height: 0; /* lets flex child scroll */
}

.chat-messages::-webkit-scrollbar {
    width: 7px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === MESSAGES === */
.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    animation: msgIn 0.25s ease-out;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    color: #fff;
}

.message.user .message-avatar {
    background: #334155;
    color: #fff;
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.message-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* AI message bubble */
.message-text {
    background: #ffffff;
    color: #1e293b;
    padding: 1rem 1.15rem;
    border-radius: 0 14px 14px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    line-height: 1.65;
    font-size: 0.92rem;
    position: relative;
    border: 1px solid #e8ecf1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* User message bubble */
.message.user .message-text {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #ffffff;
    border-radius: 14px 0 14px 14px;
    border: none;
}

/* Variant overrides (keep text dark on white) */
.message.ai.variant-unified .message-text,
.message.ai.variant-sales_ai .message-text {
    color: #1e293b;
}

/* === COPY BUTTON === */
.copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 5;
}

.message-text:hover .copy-btn { opacity: 1; }

.copy-btn:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.copy-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.message-text p { margin-bottom: 0.6rem; }
.message-text p:last-child { margin-bottom: 0; }

.product-list {
    list-style: none;
    margin: 0.5rem 0;
}

.product-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.product-list li i {
    color: #4f46e5;
    font-size: 6px;
}

.example-text {
    font-style: italic;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #eef2ff;
    border-radius: 8px;
    border-left: 3px solid #4f46e5;
}

.welcome-message {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.welcome-message .message-text {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}

/* === FILTER SECTION === */
.chat-filter-container {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 1.25rem;
    flex-shrink: 0;
    animation: slideDown 0.25s ease-out;
}

.filter-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 0.6rem;
    gap: 0.5rem;
}

.filter-icon { color: #4f46e5; }

#chat-filter-input {
    flex: 1;
    border: none;
    padding: 0.6rem 0;
    font-size: 0.88rem;
    outline: none;
    color: #1e293b;
    background: transparent;
}

.close-filter-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-filter-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

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

/* === SEARCH HIGHLIGHTING (NEW) === */
.search-highlight {
    background-color: #ffeb3b; /* Bright Yellow */
    color: #000;
    padding: 0 1px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px #fbc02d;
}

.search-highlight-active {
    background-color: #ff9800 !important; /* Vivid Orange for Active */
    color: #fff !important;
    box-shadow: 0 0 0 2px #ef6c00;
    transform: scale(1.05);
    display: inline-block;
}

.filter-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    border-left: 1px solid #e2e8f0;
    margin-left: 0.5rem;
}

.filter-results-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    min-width: 45px;
    text-align: center;
    font-family: monospace;
}

.filter-nav-btns {
    display: flex;
    gap: 0.25rem;
}

.filter-nav-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-nav-btn:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.filter-nav-btn:active {
    transform: translateY(1px);
}

/* === INPUT AREA (FIXED AT BOTTOM) === */
.chat-input-area {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    flex-shrink: 0; /* KEY: prevents shrinking */
}

.chat-form { margin: 0; }

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.2rem 0.4rem 0.2rem 1rem;
    transition: all 0.25s ease;
}

.input-wrapper:focus-within {
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#user-input {
    flex: 1;
    padding: 0.7rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 0.92rem;
    color: #1e293b;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

#user-input::placeholder {
    color: #94a3b8;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
}

.char-count {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #cbd5e1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn.active {
    background: #4f46e5;
    color: #fff;
}

.send-btn:hover.active {
    background: #3730a3;
    transform: scale(1.05);
}

.send-btn i { font-size: 0.9rem; }

/* === FOOTER === */
.chat-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.6rem;
    text-align: center;
    flex-shrink: 0;
}

.chat-footer .footer-content p {
    color: #94a3b8;
    font-size: 0.75rem;
}

.chat-footer .footer-content a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.loading-spinner {
    font-size: 1.75rem;
    color: #4f46e5;
}

.loading-content p {
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ================================================================
   RESPONSIVE — Chat Interface
   ================================================================ */

/* Tablet & Small Desktop */
@media (max-width: 768px) {
    .chat-main {
        max-width: 100%;
        padding: 0;
    }

    .chat-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .header-content {
        padding: 0.5rem 0.75rem;
    }

    .brand-section {
        gap: 0.5rem;
    }

    .header-logo {
        width: 34px;
        height: 34px;
    }

    .brand-title { font-size: 0.95rem; }
    .brand-subtitle { font-size: 0.65rem; }

    .header-actions { gap: 0.4rem; }

    .desktop-only { display: none; }

    .chat-messages { padding: 0.75rem; }

    .message-content { max-width: 88%; }

    .message-text { padding: 0.8rem; font-size: 0.88rem; }

    .chat-input-area { padding: 0.6rem 0.75rem; }
}

/* Mobile */
@media (max-width: 480px) {
    .message { gap: 0.5rem; }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .message-content { max-width: 92%; }

    .message-text {
        padding: 0.65rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 0 10px 10px 10px;
    }

    .message.user .message-text {
        border-radius: 10px 0 10px 10px;
    }

    .chat-input-area { padding: 0.5rem; }

    .input-wrapper { border-radius: 10px; }

    #user-input { font-size: 0.88rem; padding: 0.6rem 0.4rem; }

    .send-btn { width: 32px; height: 32px; border-radius: 8px; }
}


/* Login Page Responsive */
@media (max-width: 768px) {
    .login-wrapper { padding: 0.75rem; }
    .login-card { padding: 1.5rem; margin-top: 4rem; }
    .brand-name { font-size: 1.5rem; }
    .brand-tagline { font-size: 1rem; }
}

@media (max-width: 480px) {
    .login-card { padding: 1rem; }
}


/* Chat Mode Selection Badge */
.company-badge {
    display: flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 20px;
    padding: 4px 12px;
    gap: 8px;
    margin-left: 12px;
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 600;
    backdrop-filter: blur(5px);
    animation: fadeInSlide 0.3s ease-out;
}

.company-icon {
    font-size: 14px;
}

#reset-company-btn {
    background: none;
    border: none;
    color: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

#reset-company-btn:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* --- Sales Search Result Cards (High-End Design) --- */
.sales-results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
    animation: fadeIn 0.4s ease-out;
}

.sales-result-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(209, 213, 219, 0.3);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.sales-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #4f46e5, #7c3aed);
}

.sales-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.2);
}

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

.result-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-right: 12px;
}

.result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.res-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.res-badge.bill { background: #f1f5f9; color: #475569; }
.res-badge.date { background: #eef2ff; color: #4f46e5; }
.res-badge.company { background: #f0fdf4; color: #16a34a; }

.result-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.price-item {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-top: 2px;
}

.price-value.total {
    color: #4f46e5;
}

.result-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #d97706;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 600px) {
    .result-pricing-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* --- Price List Cards (EMERALD THEME) --- */
.price-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    padding: 10px 0;
}

.price-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(to bottom, #10b981, #34d399);
}

.price-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.1);
}

.price-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-box-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-supplier {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #f0fdf4;
    padding: 10px;
    border-radius: 10px;
}

.price-item-val {
    display: flex;
    flex-direction: column;
}

.price-item-val .label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

.price-item-val .value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #065f46;
}

/* --- SUGGESTION SECTION --- */
.unified-suggestions {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(241, 245, 249, 0.5));
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
}

.suggestion-header i { color: #f59e0b; }

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.suggestion-chip:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #f5f3ff;
    transform: translateY(-2px);
}

.suggestion-chip .sub-text {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
    .company-results-container {
        grid-template-columns: 1fr;
    }
    .company-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}

/* --- Autocomplete Dropdown --- */
.autocomplete-dropdown {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(209, 213, 219, 0.3);
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 
                0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 2100;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    animation: dropdownUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: default;
}

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

.autocomplete-item {
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.autocomplete-item:last-child {
    margin-bottom: 0;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    border-color: rgba(52, 152, 219, 0.2);
    transform: translateX(5px);
}

.autocomplete-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autocomplete-details {
    font-size: 0.8rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-city {
    display: flex;
    align-items: center;
    gap: 4px;
}

.autocomplete-code {
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
}

.admin-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

.admin-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

button.variant-unified,
.start-option-btn.variant-unified {
    background: linear-gradient(135deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(120, 75, 160, 0.4) !important;
    transform: scale(1.05);
}

button.variant-unified:hover,
.start-option-btn.variant-unified:hover {
    filter: brightness(1.1);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(120, 75, 160, 0.6) !important;
}


.variant-unified i {
    margin-right: 8px;
    animation: brain-pulse 2s infinite;
}

@keyframes brain-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.logo-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.logo-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #718096;
}

.admin-logout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

.admin-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-content p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.admin-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.admin-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i {
    font-size: 1.25rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-content {
    padding: 1.5rem;
}

/* Modern Form Elements */
.modern-input, .modern-select, .modern-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Poppins', sans-serif;
}

.modern-input:focus, .modern-select:focus, .modern-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-textarea {
    resize: vertical;
    min-height: 120px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3748;
}

.form-group label i {
    color: #667eea;
}

/* Modern Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Training Rules */
.training-rules {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.rules-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.rules-header i {
    color: #667eea;
    font-size: 1.25rem;
}

.rules-header h4 {
    margin: 0;
    color: #2d3748;
    font-weight: 600;
}

.rules-content {
    display: grid;
    gap: 0.75rem;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rule-item i {
    color: #667eea;
    font-size: 0.9rem;
}

.rule-item span {
    font-size: 0.9rem;
    color: #4a5568;
}

/* Shortcut Tip */
.shortcut-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fef5e7, #fed7aa);
    border-radius: 10px;
    border: 1px solid #f6ad55;
}

.shortcut-tip i {
    color: #d69e2e;
}

.shortcut-tip span {
    font-size: 0.85rem;
    color: #744210;
}

/* JSON Preview */
.json-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #1a202c;
    border-radius: 10px;
    border: 1px solid #2d3748;
}

.json-preview h4 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.json-preview pre {
    color: #a0aec0;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* File Upload Area */
.upload-section {
    margin-top: 1.5rem;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #f7fafc;
    margin-bottom: 1rem;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-placeholder i {
    font-size: 2rem;
    color: #a0aec0;
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    margin: 0 0 0.25rem 0;
    color: #4a5568;
    font-weight: 500;
}

.upload-placeholder small {
    color: #718096;
    font-size: 0.8rem;
}

/* Knowledge Display */
.knowledge-display-container {
    background: #f7fafc;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
}

.knowledge-display-container pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #4a5568;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Status Messages */
.status-container {
    margin-top: 2rem;
}

.status-message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.status-message.success {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #22543d;
    border: 1px solid #68d391;
}

.status-message.error {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #742a2a;
    border: 1px solid #fc8181;
}

.status-message.info {
    background: linear-gradient(135deg, #bee3f8, #90cdf4);
    color: #2a4365;
    border: 1px solid #63b3ed;
}

/* Divider */
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 1.5rem 0;
}

/* Admin Footer */
.admin-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.footer-content a:hover {
    text-decoration: underline;
}

.footer-content i {
    color: #f56565;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .training-rules {
        padding: 1rem;
    }
    
    .rules-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 0.5rem;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .admin-logo {
        width: 40px;
        height: 40px;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Scrollbar Styling */
.knowledge-display-container::-webkit-scrollbar {
    width: 8px;
}

.knowledge-display-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.knowledge-display-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.knowledge-display-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 

/* Start Option Overlay */
.start-option-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.start-option-content {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    width: 100%;
    max-width: 400px;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.start-option-content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #1a237e;
    font-weight: 600;
}
.start-option-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.start-option-btn {
    background: #f1f5f9;
    color: #1a237e;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.start-option-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.start-option-btn.variant-unified {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: white !important;
    border: none !important;
}

.start-option-btn.variant-unified:hover {
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4) !important;
}


/* Chat Header Toggle (in-header mode switcher) */
.chat-header-toggle {
    background: #f1f5f9;
    color: #3730a3;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-header-toggle:hover {
    background: #4f46e5;
    color: #fff;
}

/* Round icon buttons (Clear, Logout) */
.icon-btn-rounded {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.icon-btn-rounded:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.icon-btn-rounded.logout:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Mobile overrides for header toggle */
@media (max-width: 768px) {
    .toggle-label-text { font-size: 0.7rem; }
    .chat-header-toggle { padding: 0.35rem 0.6rem; font-size: 0.72rem; }
    .icon-btn-rounded { width: 30px; height: 30px; font-size: 0.8rem; }
}

/* Suggestion Sections (in AI replies) */
.suggestion-section {
    background: #eef2ff;
    border: 1.5px solid #818cf8;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 10px;
    margin-bottom: 6px;
}

.suggestion-title {
    font-weight: 600;
    color: #4f46e5;
    font-size: 0.95em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.suggestion-title i { color: #f59e0b; }

.suggestion-list { margin-left: 6px; }

.suggestion-item {
    padding: 5px 0;
    border-bottom: 1px solid #c7d2fe;
    font-size: 0.92em;
}

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

/* MODERN GLASS INVOICE (v5 FINAL) */
.bill-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 16px;
    margin: 10px 0;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    animation: fadeInSlideUp 0.4s ease-out;
}

/* --- Knowledge Base / Price List Cards (High-End Design) --- */
.reply-source-container {
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.source-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.source-header-pill.kb { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.source-header-pill.sales { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.kb-results-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kb-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.kb-card:hover {
    transform: translateX(4px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.kb-card-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-data-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.kb-data-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kb-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
}

.kb-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.kb-value.price {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 800;
}

.kb-value.material {
    color: #10b981;
}

@media (max-width: 500px) {
    .kb-data-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.kb-no-result {
    padding: 16px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: #b91c1c;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
    border-left: 4px solid #3b82f6;
}

.suggestion-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.s-main {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9rem;
}

.s-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

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

.bill-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 16px 20px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.bill-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.bill-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bill-company {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bill-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.bill-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
}

.bill-body {
    padding: 0;
    margin: 0;
    overflow-x: auto;
}

.bill-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bill-table th {
    background: #f8fafc;
    padding: 10px 14px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e2e8f0;
}

.bill-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.bill-table tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.6);
}

.bill-table tr:hover {
    background-color: rgba(79, 70, 229, 0.04);
}

.bill-footer {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.bill-total-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-right: 15px;
}

.bill-total-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .bill-header { padding: 12px 14px; }
    .bill-company { font-size: 1.1rem; }
    .bill-meta { grid-template-columns: 1fr; }
    .bill-table { font-size: 0.8rem; }
    .bill-table th, .bill-table td { padding: 8px 10px; }
}